@ikas/storefront 0.0.7 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/build/__generated__/global-types.d.ts +8 -0
  2. package/build/api/apollo.d.ts +2 -2
  3. package/build/api/category/__generated__/listCategory.d.ts +1 -1
  4. package/build/api/checkout/index.d.ts +4 -4
  5. package/build/api/customer/index.d.ts +6 -6
  6. package/build/api/product/__generated__/listProduct.d.ts +4 -5
  7. package/build/api/product-stock-location/index.d.ts +1 -1
  8. package/build/api/stock-location/index.d.ts +1 -1
  9. package/build/components/checkout/components/address-form/model.d.ts +19 -19
  10. package/build/components/checkout/model.d.ts +4 -4
  11. package/build/components/gtm/functions.d.ts +12 -12
  12. package/build/components/hoc/ThemeComponent.d.ts +2 -1
  13. package/build/components/page-editor/model.d.ts +4 -4
  14. package/build/index.es.js +539 -82
  15. package/build/index.js +538 -80
  16. package/build/models/data/order/line-item/variant/index.d.ts +1 -1
  17. package/build/models/data/product/attribute-value/index.d.ts +1 -1
  18. package/build/models/data/product/index.d.ts +1 -1
  19. package/build/models/data/product/variant/index.d.ts +1 -1
  20. package/build/models/data/variant-type/variant-value/index.d.ts +1 -1
  21. package/build/models/theme/component/prop/index.d.ts +4 -1
  22. package/build/models/theme/index.d.ts +2 -0
  23. package/build/models/theme/page/component/prop-value/category-list.d.ts +9 -0
  24. package/build/models/theme/page/component/prop-value/category.d.ts +5 -0
  25. package/build/models/theme/theme.d.ts +2 -2
  26. package/build/models/ui/brand-list/index.d.ts +1 -1
  27. package/build/models/ui/category-list/index.d.ts +58 -0
  28. package/build/models/ui/index.d.ts +1 -0
  29. package/build/models/ui/product-detail/index.d.ts +1 -1
  30. package/build/models/ui/product-list/index.d.ts +3 -3
  31. package/build/store/cart.d.ts +2 -2
  32. package/build/store/customer.d.ts +2 -2
  33. package/build/utils/providers/page-data.d.ts +3 -2
  34. package/build/utils/providers/prop-value/boolean.d.ts +6 -0
  35. package/build/utils/providers/prop-value/category-list.d.ts +7 -0
  36. package/build/utils/providers/prop-value/category.d.ts +8 -0
  37. package/build/utils/providers/prop-value/image-list.d.ts +7 -0
  38. package/build/utils/providers/prop-value/image.d.ts +7 -0
  39. package/build/utils/providers/prop-value/link.d.ts +1 -1
  40. package/build/utils/providers/prop-value/text.d.ts +6 -0
  41. package/package.json +1 -1
  42. package/build/models/theme/component/prop/value/index.d.ts +0 -14
package/build/index.js CHANGED
@@ -10883,7 +10883,7 @@ var IkasStorefrontConfig = /** @class */ (function () {
10883
10883
  IkasStorefrontConfig.components = components;
10884
10884
  IkasStorefrontConfig.config = config;
10885
10885
  IkasStorefrontConfig.localTheme = localTheme;
10886
- IkasStorefrontConfig.apiUrlOverride = apiUrlOverride;
10886
+ IkasStorefrontConfig.apiUrlOverride = apiUrlOverride || null;
10887
10887
  };
10888
10888
  IkasStorefrontConfig.components = {};
10889
10889
  IkasStorefrontConfig.config = {};
@@ -11655,8 +11655,8 @@ var IkasBrandPropValueProvider = /** @class */ (function () {
11655
11655
  }());
11656
11656
 
11657
11657
  var IkasLinkPropValueProvider = /** @class */ (function () {
11658
- function IkasLinkPropValueProvider(prop, theme) {
11659
- this.linkPropValue = prop;
11658
+ function IkasLinkPropValueProvider(linkPropValue, theme) {
11659
+ this.linkPropValue = linkPropValue;
11660
11660
  this.theme = theme;
11661
11661
  }
11662
11662
  IkasLinkPropValueProvider.prototype.getNavigationLink = function (linkPropValue) {
@@ -11712,7 +11712,7 @@ var IkasLinkPropValueProvider = /** @class */ (function () {
11712
11712
  exports.IkasThemePageType.BRAND,
11713
11713
  exports.IkasThemePageType.CATEGORY,
11714
11714
  ].includes(linkPropValue.pageType)) return [3 /*break*/, 11];
11715
- return [4 /*yield*/, IkasHTMLMetaDataAPI.listHTMLMetaData(undefined, linkPropValue.itemId)];
11715
+ return [4 /*yield*/, IkasHTMLMetaDataAPI.listHTMLMetaData(undefined, linkPropValue.itemId || undefined)];
11716
11716
  case 10:
11717
11717
  metaDataList = _d.sent();
11718
11718
  if (metaDataList.length) {
@@ -11781,6 +11781,122 @@ var IkasNavigationLink = /** @class */ (function () {
11781
11781
  return IkasNavigationLink;
11782
11782
  }());
11783
11783
 
11784
+ var IkasImageListPropValueProvider = /** @class */ (function () {
11785
+ function IkasImageListPropValueProvider(imageListPropValue) {
11786
+ this.imageListPropValue = imageListPropValue;
11787
+ }
11788
+ IkasImageListPropValueProvider.prototype.getValue = function () {
11789
+ return __awaiter(this, void 0, void 0, function () {
11790
+ return __generator(this, function (_a) {
11791
+ return [2 /*return*/, this.imageListPropValue.map(function (i) { return new IkasImage(i); })];
11792
+ });
11793
+ });
11794
+ };
11795
+ return IkasImageListPropValueProvider;
11796
+ }());
11797
+
11798
+ var IkasTextPropValueProvider = /** @class */ (function () {
11799
+ function IkasTextPropValueProvider(textPropValue) {
11800
+ this.text = textPropValue;
11801
+ }
11802
+ IkasTextPropValueProvider.prototype.getValue = function () {
11803
+ return __awaiter(this, void 0, void 0, function () {
11804
+ return __generator(this, function (_a) {
11805
+ return [2 /*return*/, this.text];
11806
+ });
11807
+ });
11808
+ };
11809
+ return IkasTextPropValueProvider;
11810
+ }());
11811
+
11812
+ var IkasBooleanPropValueProvider = /** @class */ (function () {
11813
+ function IkasBooleanPropValueProvider(textPropValue) {
11814
+ this.bool = textPropValue;
11815
+ }
11816
+ IkasBooleanPropValueProvider.prototype.getValue = function () {
11817
+ return __awaiter(this, void 0, void 0, function () {
11818
+ return __generator(this, function (_a) {
11819
+ return [2 /*return*/, this.bool];
11820
+ });
11821
+ });
11822
+ };
11823
+ return IkasBooleanPropValueProvider;
11824
+ }());
11825
+
11826
+ var IkasImagePropValueProvider = /** @class */ (function () {
11827
+ function IkasImagePropValueProvider(imagePropValue) {
11828
+ this.imagePropValue = imagePropValue;
11829
+ }
11830
+ IkasImagePropValueProvider.prototype.getValue = function () {
11831
+ return __awaiter(this, void 0, void 0, function () {
11832
+ return __generator(this, function (_a) {
11833
+ return [2 /*return*/, new IkasImage(this.imagePropValue)];
11834
+ });
11835
+ });
11836
+ };
11837
+ return IkasImagePropValueProvider;
11838
+ }());
11839
+
11840
+ var IkasCategoryPropValueProvider = /** @class */ (function () {
11841
+ function IkasCategoryPropValueProvider(prop, pageSpecificData) {
11842
+ this.categoryPropValue = prop;
11843
+ this.pageSpecificData = pageSpecificData;
11844
+ }
11845
+ IkasCategoryPropValueProvider.prototype.getValue = function () {
11846
+ return __awaiter(this, void 0, void 0, function () {
11847
+ var response, category, err_1;
11848
+ return __generator(this, function (_a) {
11849
+ switch (_a.label) {
11850
+ case 0:
11851
+ if (this.categoryPropValue.usePageData) {
11852
+ return [2 /*return*/, this.pageSpecificData];
11853
+ }
11854
+ _a.label = 1;
11855
+ case 1:
11856
+ _a.trys.push([1, 3, , 4]);
11857
+ return [4 /*yield*/, IkasCategoryAPI.listCategories({
11858
+ idList: [this.categoryPropValue.categoryId],
11859
+ })];
11860
+ case 2:
11861
+ response = _a.sent();
11862
+ category = response.categories[0];
11863
+ return [2 /*return*/, new IkasCategory(category)];
11864
+ case 3:
11865
+ err_1 = _a.sent();
11866
+ console.log(err_1);
11867
+ return [3 /*break*/, 4];
11868
+ case 4: return [2 /*return*/, new IkasCategory({})];
11869
+ }
11870
+ });
11871
+ });
11872
+ };
11873
+ return IkasCategoryPropValueProvider;
11874
+ }());
11875
+
11876
+ var IkasCategoryListPropValueProvider = /** @class */ (function () {
11877
+ function IkasCategoryListPropValueProvider(categoryListPropValue) {
11878
+ this.categoryListPropValue = categoryListPropValue;
11879
+ }
11880
+ IkasCategoryListPropValueProvider.prototype.getValue = function () {
11881
+ return __awaiter(this, void 0, void 0, function () {
11882
+ var categoryList;
11883
+ return __generator(this, function (_a) {
11884
+ switch (_a.label) {
11885
+ case 0:
11886
+ categoryList = new IkasCategoryList({
11887
+ categoryListPropValue: this.categoryListPropValue,
11888
+ });
11889
+ return [4 /*yield*/, categoryList.getInitial()];
11890
+ case 1:
11891
+ _a.sent();
11892
+ return [2 /*return*/, categoryList];
11893
+ }
11894
+ });
11895
+ });
11896
+ };
11897
+ return IkasCategoryListPropValueProvider;
11898
+ }());
11899
+
11784
11900
  var IkasPageDataProvider = /** @class */ (function () {
11785
11901
  function IkasPageDataProvider(theme, pageParams, pageType) {
11786
11902
  this.pageType = null;
@@ -12015,10 +12131,17 @@ var IkasPageDataProvider = /** @class */ (function () {
12015
12131
  return [2 /*return*/, null];
12016
12132
  switch (prop.type) {
12017
12133
  case exports.IkasThemeComponentPropType.TEXT:
12134
+ propValueProvider = new IkasTextPropValueProvider(propValue);
12135
+ break;
12018
12136
  case exports.IkasThemeComponentPropType.BOOLEAN:
12019
- return [2 /*return*/, propValue];
12137
+ propValueProvider = new IkasBooleanPropValueProvider(propValue);
12138
+ break;
12020
12139
  case exports.IkasThemeComponentPropType.IMAGE:
12021
- return [2 /*return*/, new IkasImage(propValue)];
12140
+ propValueProvider = new IkasImagePropValueProvider(propValue);
12141
+ break;
12142
+ case exports.IkasThemeComponentPropType.IMAGE_LIST:
12143
+ propValueProvider = new IkasImageListPropValueProvider(propValue);
12144
+ break;
12022
12145
  case exports.IkasThemeComponentPropType.BRAND:
12023
12146
  propValueProvider = new IkasBrandPropValueProvider(propValue, this.pageSpecificData);
12024
12147
  break;
@@ -12031,6 +12154,12 @@ var IkasPageDataProvider = /** @class */ (function () {
12031
12154
  case exports.IkasThemeComponentPropType.PRODUCT_DETAIL:
12032
12155
  propValueProvider = new IkasProductDetailPropValueProvider(propValue, this.pageSpecificData);
12033
12156
  break;
12157
+ case exports.IkasThemeComponentPropType.CATEGORY:
12158
+ propValueProvider = new IkasCategoryPropValueProvider(propValue, this.pageSpecificData);
12159
+ break;
12160
+ case exports.IkasThemeComponentPropType.CATEGORY_LIST:
12161
+ propValueProvider = new IkasCategoryListPropValueProvider(propValue);
12162
+ break;
12034
12163
  case exports.IkasThemeComponentPropType.LINK:
12035
12164
  case exports.IkasThemeComponentPropType.LIST_OF_LINK:
12036
12165
  propValueProvider = new IkasLinkPropValueProvider(propValue, this.theme);
@@ -12067,6 +12196,9 @@ var IkasPageDataProvider = /** @class */ (function () {
12067
12196
  case exports.IkasThemeComponentPropType.BRAND_LIST:
12068
12197
  IkasPageDataProvider.initBrandListPropValue(prop, propValue, pageComponentPropValue);
12069
12198
  break;
12199
+ case exports.IkasThemeComponentPropType.CATEGORY_LIST:
12200
+ IkasPageDataProvider.initCategoryListPropValue(prop, propValue, pageComponentPropValue);
12201
+ break;
12070
12202
  case exports.IkasThemeComponentPropType.PRODUCT_LIST:
12071
12203
  IkasPageDataProvider.initProductListPropValue(prop, propValue, pageComponentPropValue);
12072
12204
  break;
@@ -12086,6 +12218,10 @@ var IkasPageDataProvider = /** @class */ (function () {
12086
12218
  var brandList = new IkasBrandList(propValue);
12087
12219
  pageComponentPropValue.propValues[prop.name] = brandList;
12088
12220
  };
12221
+ IkasPageDataProvider.initCategoryListPropValue = function (prop, propValue, pageComponentPropValue) {
12222
+ var categoryList = new IkasCategoryList(propValue);
12223
+ pageComponentPropValue.propValues[prop.name] = categoryList;
12224
+ };
12089
12225
  IkasPageDataProvider.initProductListPropValue = function (prop, propValue, pageComponentPropValue) {
12090
12226
  var productList = new IkasProductList(propValue);
12091
12227
  pageComponentPropValue.propValues[prop.name] = productList;
@@ -12123,7 +12259,9 @@ var IkasPageDataProvider = /** @class */ (function () {
12123
12259
  };
12124
12260
  IkasPageDataProvider.initLinkPropValue = function (prop, propValue, pageComponentPropValue) {
12125
12261
  if (Array.isArray(propValue)) {
12126
- pageComponentPropValue.propValues[prop.name] = propValue.map(function (p) { return new IkasNavigationLink(p.href, p.label, p.subLinks, p.isExternal); });
12262
+ pageComponentPropValue.propValues[prop.name] = propValue.map(function (p) {
12263
+ return new IkasNavigationLink(p.href, p.label, p.subLinks, p.isExternal || undefined);
12264
+ });
12127
12265
  }
12128
12266
  else if (propValue) {
12129
12267
  pageComponentPropValue.propValues[prop.name] = new IkasNavigationLink(propValue.href, propValue.label, propValue.subLinks, propValue.isExternal);
@@ -13099,56 +13237,6 @@ var IkasTransactionCardTypeEnum;
13099
13237
  IkasTransactionTypeEnum["VOID"] = "VOID";
13100
13238
  })(exports.IkasTransactionTypeEnum || (exports.IkasTransactionTypeEnum = {}));
13101
13239
 
13102
- var IkasThemeComponentProp = /** @class */ (function () {
13103
- function IkasThemeComponentProp(data) {
13104
- this.name = data.name || "";
13105
- this.displayName = data.displayName || "";
13106
- this.type = data.type || exports.IkasThemeComponentPropType.TEXT;
13107
- mobx.makeAutoObservable(this);
13108
- }
13109
- return IkasThemeComponentProp;
13110
- }());
13111
- (function (IkasThemeComponentPropType) {
13112
- IkasThemeComponentPropType["IMAGE"] = "IMAGE";
13113
- IkasThemeComponentPropType["TEXT"] = "TEXT";
13114
- IkasThemeComponentPropType["BOOLEAN"] = "BOOLEAN";
13115
- IkasThemeComponentPropType["LINK"] = "LINK";
13116
- IkasThemeComponentPropType["LIST_OF_LINK"] = "LIST_OF_LINK";
13117
- IkasThemeComponentPropType["PRODUCT_DETAIL"] = "PRODUCT_DETAIL";
13118
- IkasThemeComponentPropType["PRODUCT_LIST"] = "PRODUCT_LIST";
13119
- IkasThemeComponentPropType["BRAND"] = "BRAND";
13120
- IkasThemeComponentPropType["BRAND_LIST"] = "BRAND_LIST";
13121
- IkasThemeComponentPropType["CATEGORY"] = "CATEGORY";
13122
- IkasThemeComponentPropType["CATEGORY_LIST"] = "CATEGORY_LIST";
13123
- // TODO number
13124
- // TODO productAttribute
13125
- })(exports.IkasThemeComponentPropType || (exports.IkasThemeComponentPropType = {}));
13126
-
13127
- var IkasThemeComponent = /** @class */ (function () {
13128
- function IkasThemeComponent(data) {
13129
- this.id = data.id || "";
13130
- this.dir = data.dir || "";
13131
- this.displayName = data.displayName || "";
13132
- this.props = data.props
13133
- ? data.props.map(function (p) { return new IkasThemeComponentProp(p); })
13134
- : [];
13135
- this.isHeader = data.isHeader || false;
13136
- this.isFooter = data.isFooter || false;
13137
- mobx.makeAutoObservable(this);
13138
- }
13139
- return IkasThemeComponent;
13140
- }());
13141
-
13142
- var IkasThemePageComponent = /** @class */ (function () {
13143
- function IkasThemePageComponent(data) {
13144
- this.id = data.id || "";
13145
- this.componentId = data.componentId || "";
13146
- this.propValues = data.propValues || {};
13147
- mobx.makeAutoObservable(this);
13148
- }
13149
- return IkasThemePageComponent;
13150
- }());
13151
-
13152
13240
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
13153
13241
  // require the crypto API and do not support built-in fallback to lower quality random number
13154
13242
  // generators (like Math.random()).
@@ -13223,6 +13311,59 @@ function v4(options, buf, offset) {
13223
13311
  return stringify(rnds);
13224
13312
  }
13225
13313
 
13314
+ var IkasThemeComponentProp = /** @class */ (function () {
13315
+ function IkasThemeComponentProp(data) {
13316
+ this.id = data.id || v4();
13317
+ this.name = data.name || "";
13318
+ this.displayName = data.displayName || "";
13319
+ this.type = data.type || exports.IkasThemeComponentPropType.TEXT;
13320
+ this.isRequired = data.isRequired || false;
13321
+ mobx.makeAutoObservable(this);
13322
+ }
13323
+ return IkasThemeComponentProp;
13324
+ }());
13325
+ (function (IkasThemeComponentPropType) {
13326
+ IkasThemeComponentPropType["TEXT"] = "TEXT";
13327
+ IkasThemeComponentPropType["BOOLEAN"] = "BOOLEAN";
13328
+ IkasThemeComponentPropType["IMAGE"] = "IMAGE";
13329
+ IkasThemeComponentPropType["IMAGE_LIST"] = "IMAGE_LIST";
13330
+ IkasThemeComponentPropType["LINK"] = "LINK";
13331
+ IkasThemeComponentPropType["LIST_OF_LINK"] = "LIST_OF_LINK";
13332
+ IkasThemeComponentPropType["PRODUCT_DETAIL"] = "PRODUCT_DETAIL";
13333
+ IkasThemeComponentPropType["PRODUCT_LIST"] = "PRODUCT_LIST";
13334
+ IkasThemeComponentPropType["BRAND"] = "BRAND";
13335
+ IkasThemeComponentPropType["BRAND_LIST"] = "BRAND_LIST";
13336
+ IkasThemeComponentPropType["CATEGORY"] = "CATEGORY";
13337
+ IkasThemeComponentPropType["CATEGORY_LIST"] = "CATEGORY_LIST";
13338
+ // TODO number
13339
+ // TODO productAttribute
13340
+ })(exports.IkasThemeComponentPropType || (exports.IkasThemeComponentPropType = {}));
13341
+
13342
+ var IkasThemeComponent = /** @class */ (function () {
13343
+ function IkasThemeComponent(data) {
13344
+ this.id = data.id || "";
13345
+ this.dir = data.dir || "";
13346
+ this.displayName = data.displayName || "";
13347
+ this.props = data.props
13348
+ ? data.props.map(function (p) { return new IkasThemeComponentProp(p); })
13349
+ : [];
13350
+ this.isHeader = data.isHeader || false;
13351
+ this.isFooter = data.isFooter || false;
13352
+ mobx.makeAutoObservable(this);
13353
+ }
13354
+ return IkasThemeComponent;
13355
+ }());
13356
+
13357
+ var IkasThemePageComponent = /** @class */ (function () {
13358
+ function IkasThemePageComponent(data) {
13359
+ this.id = data.id || "";
13360
+ this.componentId = data.componentId || "";
13361
+ this.propValues = data.propValues || {};
13362
+ mobx.makeAutoObservable(this);
13363
+ }
13364
+ return IkasThemePageComponent;
13365
+ }());
13366
+
13226
13367
  var IkasThemePage = /** @class */ (function () {
13227
13368
  function IkasThemePage(data) {
13228
13369
  this.id = data.id || v4();
@@ -13345,7 +13486,9 @@ var IkasBrandList = /** @class */ (function () {
13345
13486
  case 1:
13346
13487
  _a.trys.push([1, 3, 4, 5]);
13347
13488
  return [4 /*yield*/, IkasBrandAPI.listBrands({
13348
- idList: this.isStatic ? this._brandListPropValue.brandIds : undefined,
13489
+ idList: this.isStatic
13490
+ ? this._brandListPropValue.brandIds || undefined
13491
+ : undefined,
13349
13492
  page: this.isStatic ? undefined : this.page,
13350
13493
  limit: this.isStatic ? undefined : this.limit,
13351
13494
  })];
@@ -13609,6 +13752,274 @@ var IkasBrandListPropValue = /** @class */ (function () {
13609
13752
  return IkasBrandListPropValue;
13610
13753
  }());
13611
13754
 
13755
+ var IkasCategoryList = /** @class */ (function () {
13756
+ function IkasCategoryList(data) {
13757
+ var _this = this;
13758
+ this._initialized = false;
13759
+ this._minPage = null;
13760
+ this._isLoading = false;
13761
+ this.getInitial = function () { return __awaiter(_this, void 0, void 0, function () {
13762
+ var response_1, err_1;
13763
+ var _this = this;
13764
+ return __generator(this, function (_a) {
13765
+ switch (_a.label) {
13766
+ case 0:
13767
+ if (this._isLoading)
13768
+ return [2 /*return*/];
13769
+ this._isLoading = true;
13770
+ _a.label = 1;
13771
+ case 1:
13772
+ _a.trys.push([1, 3, 4, 5]);
13773
+ return [4 /*yield*/, IkasCategoryAPI.listCategories({
13774
+ idList: this.isStatic
13775
+ ? this._categoryListPropValue.categoryIds || undefined
13776
+ : undefined,
13777
+ page: this.isStatic ? undefined : this.page,
13778
+ limit: this.isStatic ? undefined : this.limit,
13779
+ })];
13780
+ case 2:
13781
+ response_1 = _a.sent();
13782
+ mobx.runInAction(function () {
13783
+ _this.data = response_1.categories;
13784
+ _this._count = response_1.count;
13785
+ _this._initialized = true;
13786
+ _this._minPage = _this.page;
13787
+ });
13788
+ return [3 /*break*/, 5];
13789
+ case 3:
13790
+ err_1 = _a.sent();
13791
+ console.log(err_1);
13792
+ return [3 /*break*/, 5];
13793
+ case 4:
13794
+ mobx.runInAction(function () {
13795
+ _this._isLoading = false;
13796
+ });
13797
+ return [7 /*endfinally*/];
13798
+ case 5: return [2 /*return*/];
13799
+ }
13800
+ });
13801
+ }); };
13802
+ this.getPrev = function () { return __awaiter(_this, void 0, void 0, function () {
13803
+ var minPage_1, response_2, err_2;
13804
+ var _this = this;
13805
+ return __generator(this, function (_a) {
13806
+ switch (_a.label) {
13807
+ case 0:
13808
+ if (this.isStatic || this._isLoading || !this.hasPrev)
13809
+ return [2 /*return*/];
13810
+ this._isLoading = true;
13811
+ _a.label = 1;
13812
+ case 1:
13813
+ _a.trys.push([1, 3, 4, 5]);
13814
+ minPage_1 = this._minPage - 1;
13815
+ return [4 /*yield*/, IkasCategoryAPI.listCategories({
13816
+ page: minPage_1,
13817
+ limit: this.limit,
13818
+ })];
13819
+ case 2:
13820
+ response_2 = _a.sent();
13821
+ mobx.runInAction(function () {
13822
+ _this.data = response_2.categories.concat(_this.data);
13823
+ _this._count = response_2.count;
13824
+ _this._minPage = minPage_1;
13825
+ });
13826
+ return [3 /*break*/, 5];
13827
+ case 3:
13828
+ err_2 = _a.sent();
13829
+ console.log(err_2);
13830
+ return [3 /*break*/, 5];
13831
+ case 4:
13832
+ mobx.runInAction(function () {
13833
+ _this._isLoading = false;
13834
+ });
13835
+ return [7 /*endfinally*/];
13836
+ case 5: return [2 /*return*/];
13837
+ }
13838
+ });
13839
+ }); };
13840
+ this.getNext = function () { return __awaiter(_this, void 0, void 0, function () {
13841
+ var response_3, err_3;
13842
+ var _this = this;
13843
+ return __generator(this, function (_a) {
13844
+ switch (_a.label) {
13845
+ case 0:
13846
+ if (this.isStatic || this._isLoading || !this.hasNext)
13847
+ return [2 /*return*/];
13848
+ this._isLoading = true;
13849
+ _a.label = 1;
13850
+ case 1:
13851
+ _a.trys.push([1, 3, 4, 5]);
13852
+ return [4 /*yield*/, IkasCategoryAPI.listCategories({
13853
+ page: this.page + 1,
13854
+ limit: this.limit,
13855
+ })];
13856
+ case 2:
13857
+ response_3 = _a.sent();
13858
+ mobx.runInAction(function () {
13859
+ _this.data = _this.data.concat(response_3.categories);
13860
+ _this._count = response_3.count;
13861
+ _this._page = _this.page + 1;
13862
+ });
13863
+ return [3 /*break*/, 5];
13864
+ case 3:
13865
+ err_3 = _a.sent();
13866
+ console.log(err_3);
13867
+ return [3 /*break*/, 5];
13868
+ case 4:
13869
+ mobx.runInAction(function () {
13870
+ _this._isLoading = false;
13871
+ });
13872
+ return [7 /*endfinally*/];
13873
+ case 5: return [2 /*return*/];
13874
+ }
13875
+ });
13876
+ }); };
13877
+ this.getPage = function (page) { return __awaiter(_this, void 0, void 0, function () {
13878
+ var response_4, err_4;
13879
+ var _this = this;
13880
+ return __generator(this, function (_a) {
13881
+ switch (_a.label) {
13882
+ case 0:
13883
+ if (this._isLoading || this.isStatic)
13884
+ return [2 /*return*/];
13885
+ this._isLoading = true;
13886
+ _a.label = 1;
13887
+ case 1:
13888
+ _a.trys.push([1, 3, 4, 5]);
13889
+ return [4 /*yield*/, IkasCategoryAPI.listCategories({
13890
+ page: page,
13891
+ limit: this.limit,
13892
+ })];
13893
+ case 2:
13894
+ response_4 = _a.sent();
13895
+ mobx.runInAction(function () {
13896
+ _this.data = response_4.categories;
13897
+ _this._count = response_4.count;
13898
+ _this._page = page;
13899
+ _this._minPage = page;
13900
+ });
13901
+ return [3 /*break*/, 5];
13902
+ case 3:
13903
+ err_4 = _a.sent();
13904
+ console.log(err_4);
13905
+ return [3 /*break*/, 5];
13906
+ case 4:
13907
+ mobx.runInAction(function () {
13908
+ _this._isLoading = false;
13909
+ });
13910
+ return [7 /*endfinally*/];
13911
+ case 5: return [2 /*return*/];
13912
+ }
13913
+ });
13914
+ }); };
13915
+ this.data = data.data ? data.data.map(function (b) { return new IkasCategory(b); }) : [];
13916
+ this._type =
13917
+ data.type ||
13918
+ data.categoryListPropValue.categoryListType ||
13919
+ exports.IkasCategoryListType.ALL;
13920
+ this._sort =
13921
+ data.sort ||
13922
+ data.categoryListPropValue.initialSort ||
13923
+ exports.IkasCategoryListSortType.A_Z;
13924
+ this._limit = data.limit || data.categoryListPropValue.initialLimit || 20;
13925
+ this._page = data.page || 1;
13926
+ this._count = data.count || 0;
13927
+ this._initialized = data.initialized || false;
13928
+ this._minPage = data.minPage;
13929
+ this._categoryListPropValue = data.categoryListPropValue;
13930
+ mobx.makeAutoObservable(this);
13931
+ }
13932
+ Object.defineProperty(IkasCategoryList.prototype, "sort", {
13933
+ get: function () {
13934
+ return this._sort;
13935
+ },
13936
+ enumerable: false,
13937
+ configurable: true
13938
+ });
13939
+ Object.defineProperty(IkasCategoryList.prototype, "limit", {
13940
+ get: function () {
13941
+ return this._limit;
13942
+ },
13943
+ enumerable: false,
13944
+ configurable: true
13945
+ });
13946
+ Object.defineProperty(IkasCategoryList.prototype, "page", {
13947
+ get: function () {
13948
+ return this._page;
13949
+ },
13950
+ enumerable: false,
13951
+ configurable: true
13952
+ });
13953
+ Object.defineProperty(IkasCategoryList.prototype, "count", {
13954
+ get: function () {
13955
+ return this._count;
13956
+ },
13957
+ enumerable: false,
13958
+ configurable: true
13959
+ });
13960
+ Object.defineProperty(IkasCategoryList.prototype, "isInitialized", {
13961
+ get: function () {
13962
+ return this._initialized;
13963
+ },
13964
+ enumerable: false,
13965
+ configurable: true
13966
+ });
13967
+ Object.defineProperty(IkasCategoryList.prototype, "isStatic", {
13968
+ get: function () {
13969
+ return this._type === exports.IkasCategoryListType.STATIC;
13970
+ },
13971
+ enumerable: false,
13972
+ configurable: true
13973
+ });
13974
+ Object.defineProperty(IkasCategoryList.prototype, "hasPrev", {
13975
+ get: function () {
13976
+ if (this.isStatic || !this._minPage)
13977
+ return false;
13978
+ return this._minPage > 1;
13979
+ },
13980
+ enumerable: false,
13981
+ configurable: true
13982
+ });
13983
+ Object.defineProperty(IkasCategoryList.prototype, "hasNext", {
13984
+ get: function () {
13985
+ if (this.isStatic)
13986
+ return false;
13987
+ return this.page * this.limit < this.count;
13988
+ },
13989
+ enumerable: false,
13990
+ configurable: true
13991
+ });
13992
+ Object.defineProperty(IkasCategoryList.prototype, "isLoading", {
13993
+ get: function () {
13994
+ return this._isLoading;
13995
+ },
13996
+ enumerable: false,
13997
+ configurable: true
13998
+ });
13999
+ IkasCategoryList.prototype.toJSON = function () {
14000
+ return {
14001
+ data: this.data,
14002
+ type: this._type,
14003
+ sort: this._sort,
14004
+ limit: this._limit,
14005
+ page: this._page,
14006
+ count: this._count,
14007
+ initialized: this._initialized,
14008
+ minPage: this._minPage,
14009
+ categoryListPropValue: this._categoryListPropValue,
14010
+ };
14011
+ };
14012
+ return IkasCategoryList;
14013
+ }());
14014
+ (function (IkasCategoryListType) {
14015
+ IkasCategoryListType["ALL"] = "ALL";
14016
+ IkasCategoryListType["STATIC"] = "STATIC";
14017
+ })(exports.IkasCategoryListType || (exports.IkasCategoryListType = {}));
14018
+ (function (IkasCategoryListSortType) {
14019
+ IkasCategoryListSortType["A_Z"] = "A_Z";
14020
+ IkasCategoryListSortType["Z_A"] = "Z_A";
14021
+ })(exports.IkasCategoryListSortType || (exports.IkasCategoryListSortType = {}));
14022
+
13612
14023
  var IkasProductDetail = /** @class */ (function () {
13613
14024
  function IkasProductDetail(product, selectedVariantValues, usePageData, router) {
13614
14025
  this.usePageData = null;
@@ -14087,6 +14498,35 @@ var IkasProductDetailPropValue = /** @class */ (function () {
14087
14498
  return IkasProductDetailPropValue;
14088
14499
  }());
14089
14500
 
14501
+ var IkasCategoryPropValue = /** @class */ (function () {
14502
+ function IkasCategoryPropValue(data) {
14503
+ this.categoryId = null;
14504
+ // Only for category detail page
14505
+ this.usePageData = null;
14506
+ this.categoryId = data.categoryId;
14507
+ this.usePageData = data.usePageData;
14508
+ mobx.makeAutoObservable(this);
14509
+ }
14510
+ return IkasCategoryPropValue;
14511
+ }());
14512
+
14513
+ var IkasCategoryListPropValue = /** @class */ (function () {
14514
+ function IkasCategoryListPropValue(data) {
14515
+ this.initialSort = null;
14516
+ this.initialLimit = null;
14517
+ // Only for static lists
14518
+ this.categoryCount = null;
14519
+ this.categoryIds = null;
14520
+ this.categoryListType = data.categoryListType || exports.IkasCategoryListType.ALL;
14521
+ this.initialSort = data.initialSort || exports.IkasCategoryListSortType.A_Z;
14522
+ this.initialLimit = data.initialLimit || 20;
14523
+ this.categoryCount = data.categoryCount;
14524
+ this.categoryIds = data.categoryIds;
14525
+ mobx.makeAutoObservable(this);
14526
+ }
14527
+ return IkasCategoryListPropValue;
14528
+ }());
14529
+
14090
14530
  var IkasBrandAPI = /** @class */ (function () {
14091
14531
  function IkasBrandAPI() {
14092
14532
  }
@@ -14246,7 +14686,7 @@ var IkasCategoryAPI = /** @class */ (function () {
14246
14686
  return __generator(this, function (_b) {
14247
14687
  switch (_b.label) {
14248
14688
  case 0:
14249
- LIST_QUERY = src(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n query listCategory(\n $id: StringFilterInput!\n $paginationInput: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, paginationInput: $paginationInput, name: $name) {\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 }\n count\n }\n }\n "], ["\n query listCategory(\n $id: StringFilterInput!\n $paginationInput: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, paginationInput: $paginationInput, name: $name) {\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 }\n count\n }\n }\n "])));
14689
+ LIST_QUERY = src(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n query listCategory(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, paginationInput: $paginationInput, name: $name) {\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 }\n count\n }\n }\n "], ["\n query listCategory(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, paginationInput: $paginationInput, name: $name) {\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 }\n count\n }\n }\n "])));
14250
14690
  _b.label = 1;
14251
14691
  case 1:
14252
14692
  _b.trys.push([1, 3, , 4]);
@@ -14255,9 +14695,11 @@ var IkasCategoryAPI = /** @class */ (function () {
14255
14695
  .query({
14256
14696
  query: LIST_QUERY,
14257
14697
  variables: {
14258
- id: {
14259
- in: (params === null || params === void 0 ? void 0 : params.idList) || [],
14260
- },
14698
+ id: (params === null || params === void 0 ? void 0 : params.idList) && params.idList.length
14699
+ ? {
14700
+ in: params.idList,
14701
+ }
14702
+ : undefined,
14261
14703
  paginationInput: (params === null || params === void 0 ? void 0 : params.page) ? {
14262
14704
  page: params.page,
14263
14705
  limit: params.limit || 10,
@@ -18838,7 +19280,7 @@ var IkasProductAPI = /** @class */ (function () {
18838
19280
  return __generator(this, function (_b) {
18839
19281
  switch (_b.label) {
18840
19282
  case 0:
18841
- LIST_PRODUCTS = src(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n query listProduct(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $search: String\n ) {\n listProduct(\n id: $id\n paginationInput: $paginationInput\n search: $search\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n type\n shortDescription\n description\n taxValue\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryIds\n productVariantTypes {\n order\n variantTypeId\n variantValueIds\n }\n variants {\n id\n createdAt\n updatedAt\n deleted\n sku\n barcodeList\n isActive\n variantValueIds {\n variantTypeId\n variantValueId\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n images {\n order\n isMain\n imageId\n }\n prices {\n sellPrice\n discountPrice\n buyPrice\n currency\n salesChannelId\n }\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n }\n count\n }\n }\n "], ["\n query listProduct(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $search: String\n ) {\n listProduct(\n id: $id\n paginationInput: $paginationInput\n search: $search\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n type\n shortDescription\n description\n taxValue\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryIds\n productVariantTypes {\n order\n variantTypeId\n variantValueIds\n }\n variants {\n id\n createdAt\n updatedAt\n deleted\n sku\n barcodeList\n isActive\n variantValueIds {\n variantTypeId\n variantValueId\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n images {\n order\n isMain\n imageId\n }\n prices {\n sellPrice\n discountPrice\n buyPrice\n currency\n salesChannelId\n }\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n }\n count\n }\n }\n "])));
19283
+ LIST_PRODUCTS = src(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n query listProduct(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $search: String\n ) {\n listProduct(\n id: $id\n paginationInput: $paginationInput\n search: $search\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n type\n shortDescription\n description\n taxValue\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryIds\n productVariantTypes {\n order\n variantTypeId\n variantValueIds\n }\n variants {\n id\n createdAt\n updatedAt\n deleted\n sku\n barcodeList\n isActive\n variantValueIds {\n variantTypeId\n variantValueId\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n images {\n order\n isMain\n imageId\n }\n prices {\n sellPrice\n discountPrice\n buyPrice\n currency\n }\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n }\n count\n }\n }\n "], ["\n query listProduct(\n $id: StringFilterInput\n $paginationInput: PaginationInput\n $search: String\n ) {\n listProduct(\n id: $id\n paginationInput: $paginationInput\n search: $search\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n type\n shortDescription\n description\n taxValue\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryIds\n productVariantTypes {\n order\n variantTypeId\n variantValueIds\n }\n variants {\n id\n createdAt\n updatedAt\n deleted\n sku\n barcodeList\n isActive\n variantValueIds {\n variantTypeId\n variantValueId\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n images {\n order\n isMain\n imageId\n }\n prices {\n sellPrice\n discountPrice\n buyPrice\n currency\n }\n }\n attributes {\n value\n productAttributeId\n productAttributeOptionId\n }\n }\n count\n }\n }\n "])));
18842
19284
  _b.label = 1;
18843
19285
  case 1:
18844
19286
  _b.trys.push([1, 8, , 9]);
@@ -20795,7 +21237,7 @@ var CheckoutViewModel = /** @class */ (function () {
20795
21237
  this.changeStep(CheckoutStep.SUCCESS);
20796
21238
  }
20797
21239
  else if (transactionStatus === exports.IkasTransactionStatusEnum.PENDING &&
20798
- response.returnSlug) {
21240
+ !!(response === null || response === void 0 ? void 0 : response.returnSlug)) {
20799
21241
  window.location.href =
20800
21242
  process.env.NEXT_PUBLIC_BASE_URL + response.returnSlug;
20801
21243
  }
@@ -21656,7 +22098,7 @@ var CheckoutStepInfo = mobxReactLite.observer(function (_a) {
21656
22098
  React.createElement(FormItem, { type: FormItemType.SELECT, label: "Kaydedilen adresler", value: vm.selectedShippingAddressId, onChange: vm.onSelectedShippingAddressIdChange, options: vm.customerAddressOptions }))),
21657
22099
  React.createElement(AddressForm, { address: vm.checkout.shippingAddress, customer: vm.checkout.customer && vm.checkout.customer.id
21658
22100
  ? undefined
21659
- : vm.checkout.customer, isErrorsVisible: vm.isErrorsVisible, allowedCountryIds: vm.shippingCountryIds, validationResult: vm.checkout.shippingAddress.validationResult }),
22101
+ : vm.checkout.customer || undefined, isErrorsVisible: vm.isErrorsVisible, allowedCountryIds: vm.shippingCountryIds, validationResult: vm.checkout.shippingAddress.validationResult }),
21660
22102
  !!vm.customerStore.customer && vm.selectedShippingAddressId === "-1" && (React.createElement("div", { style: { marginTop: "12px" } },
21661
22103
  React.createElement(Checkbox, { value: vm.shouldSaveAddress, label: "Bir sonraki i\u015Flem i\u00E7in bu bilgileri kaydet", onChange: vm.setShouldSaveAddress }),
21662
22104
  vm.shouldSaveAddress && (React.createElement("div", { style: { marginTop: "8px" } },
@@ -21869,7 +22311,7 @@ var BillingAddress = mobxReactLite.observer(function (_a) {
21869
22311
  !!vm.customerStore.customer &&
21870
22312
  !!vm.customerStore.customer.addresses.length && (React.createElement("div", { className: styles$2.RowPB },
21871
22313
  React.createElement(FormItem, { type: FormItemType.SELECT, label: "Kaydedilen adresler", value: vm.selectedBillingAddressId, onChange: vm.onSelectedBillingAddressIdChange, options: vm.customerAddressOptions }))),
21872
- React.createElement(AddressForm, { address: vm.checkout.billingAddress, customer: vm.checkout.customer, isErrorsVisible: vm.isErrorsVisible, validationResult: vm.checkout.billingAddress.validationResult }))),
22314
+ React.createElement(AddressForm, { address: vm.checkout.billingAddress, customer: vm.checkout.customer || undefined, isErrorsVisible: vm.isErrorsVisible, validationResult: vm.checkout.billingAddress.validationResult }))),
21873
22315
  },
21874
22316
  ]; });
21875
22317
  return (React.createElement(React.Fragment, null,
@@ -22766,10 +23208,15 @@ var style = {
22766
23208
  };
22767
23209
 
22768
23210
  var ThemeComponent = mobxReactLite.observer(function (_a) {
22769
- var propValues = _a.propValues, pageComponent = _a.pageComponent, index = _a.index;
23211
+ var pageComponentPropValue = _a.pageComponentPropValue, pageComponent = _a.pageComponent, index = _a.index;
22770
23212
  var store = IkasStorefrontConfig.store, components = IkasStorefrontConfig.components;
23213
+ var propValues = pageComponentPropValue.propValues;
22771
23214
  var hasNullValue = mobx.computed(function () {
22772
- return Object.values(propValues || {}).some(function (pv) { return pv === null || pv === undefined; });
23215
+ return Object.entries(propValues || {}).some(function (_a) {
23216
+ var _b;
23217
+ var propName = _a[0], propValue = _a[1];
23218
+ return (propValue === null || propValue === undefined) && ((_b = pageComponentPropValue.component.props.find(function (p) { return p.name === propName; })) === null || _b === void 0 ? void 0 : _b.isRequired);
23219
+ });
22773
23220
  });
22774
23221
  var Component = components[pageComponent.componentId];
22775
23222
  return (React.createElement("div", { id: index + "" }, hasNullValue.get() ? (React.createElement(ErrorComponent, null)) : (React.createElement(Component, __assign({ key: pageComponent.id }, propValues, { store: store })))));
@@ -22780,7 +23227,7 @@ var IkasPage = mobxReactLite.observer(function (_a) {
22780
23227
  var propValues = _a.propValues, page = _a.page;
22781
23228
  var renderComponent = function (pageComponent, index) {
22782
23229
  var pageComponentPropValue = propValues.find(function (pv) { return pv.pageComponent.id === pageComponent.id; });
22783
- return (React.createElement(ThemeComponent, { key: pageComponent.id, index: index, propValues: pageComponentPropValue.propValues, pageComponent: pageComponent }));
23230
+ return (React.createElement(ThemeComponent, { key: pageComponent.id, index: index, pageComponentPropValue: pageComponentPropValue, pageComponent: pageComponent }));
22784
23231
  };
22785
23232
  var headerComponent = (_b = propValues.find(function (pv) { return pv.component.isHeader; })) === null || _b === void 0 ? void 0 : _b.pageComponent;
22786
23233
  var footerComponent = (_c = propValues.find(function (pv) { return pv.component.isFooter; })) === null || _c === void 0 ? void 0 : _c.pageComponent;
@@ -22836,10 +23283,10 @@ var PageViewModel = /** @class */ (function () {
22836
23283
  case BridgeMessageType.UPDATE_PROP_VALUE: return [3 /*break*/, 3];
22837
23284
  case BridgeMessageType.UPDATE_PAGE_PARAMS: return [3 /*break*/, 5];
22838
23285
  case BridgeMessageType.UPDATE_PAGE_COMPONENT_ORDER: return [3 /*break*/, 7];
22839
- case BridgeMessageType.ADD_NEW_COMPONENT: return [3 /*break*/, 9];
23286
+ case BridgeMessageType.ADD_COMPONENT: return [3 /*break*/, 9];
22840
23287
  case BridgeMessageType.DELETE_COMPONENT: return [3 /*break*/, 10];
22841
23288
  case BridgeMessageType.UPDATE_COMPONENT: return [3 /*break*/, 11];
22842
- case BridgeMessageType.ADD_NEW_PAGE_COMPONENT: return [3 /*break*/, 12];
23289
+ case BridgeMessageType.ADD_PAGE_COMPONENT: return [3 /*break*/, 12];
22843
23290
  case BridgeMessageType.DELETE_PAGE_COMPONENT: return [3 /*break*/, 14];
22844
23291
  case BridgeMessageType.SET_SELECTED_COMPONENT: return [3 /*break*/, 15];
22845
23292
  case BridgeMessageType.SET_HOVERED_COMPONENT: return [3 /*break*/, 16];
@@ -22969,7 +23416,7 @@ var PageViewModel = /** @class */ (function () {
22969
23416
  this.pageParams = data.pageParams;
22970
23417
  this.queryParams = data.queryParams;
22971
23418
  this.apiKey = data.apiKey;
22972
- apollo.createApolloClient(this.apiKey);
23419
+ apollo.createApolloClient(this.apiKey || undefined);
22973
23420
  window.editorApiKey = data.apiKey;
22974
23421
  return [4 /*yield*/, this.getPagePropValues()];
22975
23422
  case 1:
@@ -23046,13 +23493,16 @@ var PageViewModel = /** @class */ (function () {
23046
23493
  this.handleAddNewPageComponent = function (data) { return __awaiter(_this, void 0, void 0, function () {
23047
23494
  var pageComponent, pageComponentPropValue;
23048
23495
  var _this = this;
23049
- return __generator(this, function (_a) {
23050
- switch (_a.label) {
23496
+ var _a;
23497
+ return __generator(this, function (_b) {
23498
+ switch (_b.label) {
23051
23499
  case 0:
23052
23500
  pageComponent = new IkasThemePageComponent(data.pageComponent);
23501
+ if ((_a = this.page) === null || _a === void 0 ? void 0 : _a.components.some(function (pc) { return pc.id === pageComponent.id; }))
23502
+ return [2 /*return*/];
23053
23503
  return [4 /*yield*/, this.pageDataProvider.getPageComponentPropValues(pageComponent)];
23054
23504
  case 1:
23055
- pageComponentPropValue = _a.sent();
23505
+ pageComponentPropValue = _b.sent();
23056
23506
  mobx.runInAction(function () {
23057
23507
  var _a;
23058
23508
  _this.pageDataProvider.pageComponentPropValues.push(pageComponentPropValue);
@@ -23113,10 +23563,10 @@ var BridgeMessageType;
23113
23563
  BridgeMessageType["UPDATE_PROP_VALUE"] = "UPDATE_PROP_VALUE";
23114
23564
  BridgeMessageType["UPDATE_PAGE_PARAMS"] = "UPDATE_PAGE_PARAMS";
23115
23565
  BridgeMessageType["UPDATE_PAGE_COMPONENT_ORDER"] = "UPDATE_PAGE_COMPONENT_ORDER";
23116
- BridgeMessageType["ADD_NEW_COMPONENT"] = "ADD_NEW_COMPONENT";
23566
+ BridgeMessageType["ADD_COMPONENT"] = "ADD_COMPONENT";
23117
23567
  BridgeMessageType["DELETE_COMPONENT"] = "DELETE_COMPONENT";
23118
23568
  BridgeMessageType["UPDATE_COMPONENT"] = "UPDATE_COMPONENT";
23119
- BridgeMessageType["ADD_NEW_PAGE_COMPONENT"] = "ADD_NEW_PAGE_COMPONENT";
23569
+ BridgeMessageType["ADD_PAGE_COMPONENT"] = "ADD_PAGE_COMPONENT";
23120
23570
  BridgeMessageType["DELETE_PAGE_COMPONENT"] = "DELETE_PAGE_COMPONENT";
23121
23571
  BridgeMessageType["COMPONENT_MOUSE_OVER"] = "COMPONENT_MOUSE_OVER";
23122
23572
  BridgeMessageType["COMPONENT_MOUSE_LEAVE"] = "COMPONENT_MOUSE_LEAVE";
@@ -23134,10 +23584,10 @@ var ThemeEditorComponent = mobxReactLite.observer(function (_a) {
23134
23584
  React.useEffect(function () {
23135
23585
  vm.setComponentRef(ref.current, pageComponent);
23136
23586
  }, []);
23137
- var pageComponentPropValues = mobx.computed(function () {
23587
+ var pageComponentPropValue = mobx.computed(function () {
23138
23588
  return vm.pageDataProvider.pageComponentPropValues.find(function (pc) { return pc.pageComponent.id === pageComponent.id; });
23139
23589
  });
23140
- var propValues = (_b = pageComponentPropValues.get()) === null || _b === void 0 ? void 0 : _b.propValues;
23590
+ var propValues = (_b = pageComponentPropValue.get()) === null || _b === void 0 ? void 0 : _b.propValues;
23141
23591
  if (!propValues)
23142
23592
  return null;
23143
23593
  var Component = components[pageComponent.componentId];
@@ -23148,7 +23598,12 @@ var ThemeEditorComponent = mobxReactLite.observer(function (_a) {
23148
23598
  return vm.hoveredPageComponentId === pageComponent.id;
23149
23599
  });
23150
23600
  var hasNullValue = mobx.computed(function () {
23151
- return Object.values(propValues || {}).some(function (pv) { return pv === null || pv === undefined; });
23601
+ return Object.entries(propValues || {}).some(function (_a) {
23602
+ var _b, _c;
23603
+ var propName = _a[0], propValue = _a[1];
23604
+ return (propValue === null || propValue === undefined) && ((_c = (_b = pageComponentPropValue
23605
+ .get()) === null || _b === void 0 ? void 0 : _b.component.props.find(function (p) { return p.name === propName; })) === null || _c === void 0 ? void 0 : _c.isRequired);
23606
+ });
23152
23607
  });
23153
23608
  var onMouseEnter = function () {
23154
23609
  vm.onMouseOver(pageComponent.id);
@@ -23716,6 +24171,9 @@ exports.IkasBrandPropValue = IkasBrandPropValue;
23716
24171
  exports.IkasCartAPI = IkasCartAPI;
23717
24172
  exports.IkasCategory = IkasCategory;
23718
24173
  exports.IkasCategoryAPI = IkasCategoryAPI;
24174
+ exports.IkasCategoryList = IkasCategoryList;
24175
+ exports.IkasCategoryListPropValue = IkasCategoryListPropValue;
24176
+ exports.IkasCategoryPropValue = IkasCategoryPropValue;
23719
24177
  exports.IkasCheckout = IkasCheckout;
23720
24178
  exports.IkasCheckoutAPI = IkasCheckoutAPI;
23721
24179
  exports.IkasCheckoutPage = IkasCheckoutPage;