@ikas/storefront 0.0.122 → 0.0.124
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/analytics/analytics.d.ts +2 -2
- package/build/analytics/googleTagManager.d.ts +21 -1
- package/build/components/hoc/ThemeComponent.d.ts +2 -3
- package/build/components/page/index.d.ts +2 -1
- package/build/components/page-editor/model.d.ts +0 -1
- package/build/index.es.js +921 -676
- package/build/index.js +748 -502
- package/build/models/theme/component/prop/index.d.ts +4 -1
- package/build/models/theme/custom-data/index.d.ts +3 -0
- package/build/models/ui/component-renderer/index.d.ts +7 -0
- package/build/models/ui/index.d.ts +1 -0
- package/build/store/base.d.ts +2 -0
- package/build/utils/providers/page-data.d.ts +8 -4
- package/build/utils/providers/prop-value/custom.d.ts +5 -1
- package/build/utils/providers/prop-value/rich-text.d.ts +6 -0
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var mobx = require('mobx');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var mobxReactLite = require('mobx-react-lite');
|
|
8
|
+
var Head = require('next/head');
|
|
8
9
|
var router = require('next/router');
|
|
9
10
|
var Image$1 = require('next/image');
|
|
10
11
|
var Link = require('next/link');
|
|
11
|
-
var Head = require('next/head');
|
|
12
12
|
var fs = require('fs');
|
|
13
13
|
var getConfig = require('next/config');
|
|
14
14
|
var dynamic = require('next/dynamic');
|
|
@@ -17,9 +17,9 @@ var Error$1 = require('next/error');
|
|
|
17
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
18
|
|
|
19
19
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
|
+
var Head__default = /*#__PURE__*/_interopDefaultLegacy(Head);
|
|
20
21
|
var Image__default = /*#__PURE__*/_interopDefaultLegacy(Image$1);
|
|
21
22
|
var Link__default = /*#__PURE__*/_interopDefaultLegacy(Link);
|
|
22
|
-
var Head__default = /*#__PURE__*/_interopDefaultLegacy(Head);
|
|
23
23
|
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
24
24
|
var getConfig__default = /*#__PURE__*/_interopDefaultLegacy(getConfig);
|
|
25
25
|
var dynamic__default = /*#__PURE__*/_interopDefaultLegacy(dynamic);
|
|
@@ -11401,12 +11401,27 @@ var IkasCategoryListPropValueProvider = /** @class */ (function () {
|
|
|
11401
11401
|
return IkasCategoryListPropValueProvider;
|
|
11402
11402
|
}());
|
|
11403
11403
|
|
|
11404
|
+
var IkasRichTextPropValueProvider = /** @class */ (function () {
|
|
11405
|
+
function IkasRichTextPropValueProvider(textPropValue) {
|
|
11406
|
+
this.text = textPropValue;
|
|
11407
|
+
}
|
|
11408
|
+
IkasRichTextPropValueProvider.prototype.getValue = function () {
|
|
11409
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11410
|
+
return __generator(this, function (_a) {
|
|
11411
|
+
return [2 /*return*/, this.text];
|
|
11412
|
+
});
|
|
11413
|
+
});
|
|
11414
|
+
};
|
|
11415
|
+
return IkasRichTextPropValueProvider;
|
|
11416
|
+
}());
|
|
11417
|
+
|
|
11404
11418
|
var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
11405
|
-
function IkasCustomPropValueProvider(value, customData, theme, pageType, pageSpecificData, pageParams) {
|
|
11419
|
+
function IkasCustomPropValueProvider(value, customData, theme, pageType, pageDataProvider, pageSpecificData, pageParams) {
|
|
11406
11420
|
this.value = value;
|
|
11407
11421
|
this.customData = customData;
|
|
11408
11422
|
this.theme = theme;
|
|
11409
11423
|
this.pageType = pageType;
|
|
11424
|
+
this.pageDataProvider = pageDataProvider;
|
|
11410
11425
|
this.pageSpecificData = pageSpecificData;
|
|
11411
11426
|
this.pageParams = pageParams;
|
|
11412
11427
|
}
|
|
@@ -11420,89 +11435,100 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
11420
11435
|
return [2 /*return*/];
|
|
11421
11436
|
_b.label = 1;
|
|
11422
11437
|
case 1:
|
|
11423
|
-
_b.trys.push([1,
|
|
11438
|
+
_b.trys.push([1, 36, , 37]);
|
|
11424
11439
|
_a = this.customData.type;
|
|
11425
11440
|
switch (_a) {
|
|
11426
11441
|
case exports.IkasThemeCustomDataType.TEXT: return [3 /*break*/, 2];
|
|
11427
|
-
case exports.IkasThemeCustomDataType.
|
|
11428
|
-
case exports.IkasThemeCustomDataType.
|
|
11429
|
-
case exports.IkasThemeCustomDataType.
|
|
11430
|
-
case exports.IkasThemeCustomDataType.
|
|
11431
|
-
case exports.IkasThemeCustomDataType.
|
|
11432
|
-
case exports.IkasThemeCustomDataType.
|
|
11433
|
-
case exports.IkasThemeCustomDataType.
|
|
11434
|
-
case exports.IkasThemeCustomDataType.
|
|
11435
|
-
case exports.IkasThemeCustomDataType.
|
|
11436
|
-
case exports.IkasThemeCustomDataType.
|
|
11437
|
-
case exports.IkasThemeCustomDataType.
|
|
11438
|
-
case exports.IkasThemeCustomDataType.
|
|
11439
|
-
case exports.IkasThemeCustomDataType.
|
|
11440
|
-
case exports.IkasThemeCustomDataType.
|
|
11441
|
-
case exports.IkasThemeCustomDataType.
|
|
11442
|
+
case exports.IkasThemeCustomDataType.RICH_TEXT: return [3 /*break*/, 4];
|
|
11443
|
+
case exports.IkasThemeCustomDataType.BOOLEAN: return [3 /*break*/, 6];
|
|
11444
|
+
case exports.IkasThemeCustomDataType.BRAND_LIST: return [3 /*break*/, 8];
|
|
11445
|
+
case exports.IkasThemeCustomDataType.BRAND: return [3 /*break*/, 10];
|
|
11446
|
+
case exports.IkasThemeCustomDataType.CATEGORY_LIST: return [3 /*break*/, 12];
|
|
11447
|
+
case exports.IkasThemeCustomDataType.CATEGORY: return [3 /*break*/, 14];
|
|
11448
|
+
case exports.IkasThemeCustomDataType.COLOR: return [3 /*break*/, 16];
|
|
11449
|
+
case exports.IkasThemeCustomDataType.IMAGE_LIST: return [3 /*break*/, 18];
|
|
11450
|
+
case exports.IkasThemeCustomDataType.IMAGE: return [3 /*break*/, 20];
|
|
11451
|
+
case exports.IkasThemeCustomDataType.LINK: return [3 /*break*/, 22];
|
|
11452
|
+
case exports.IkasThemeCustomDataType.LIST_OF_LINK: return [3 /*break*/, 22];
|
|
11453
|
+
case exports.IkasThemeCustomDataType.PRODUCT_DETAIL: return [3 /*break*/, 24];
|
|
11454
|
+
case exports.IkasThemeCustomDataType.PRODUCT_LIST: return [3 /*break*/, 26];
|
|
11455
|
+
case exports.IkasThemeCustomDataType.OBJECT: return [3 /*break*/, 28];
|
|
11456
|
+
case exports.IkasThemeCustomDataType.DYNAMIC_LIST: return [3 /*break*/, 30];
|
|
11457
|
+
case exports.IkasThemeCustomDataType.STATIC_LIST: return [3 /*break*/, 30];
|
|
11458
|
+
case exports.IkasThemeCustomDataType.COMPONENT: return [3 /*break*/, 32];
|
|
11459
|
+
case exports.IkasThemeCustomDataType.COMPONENT_LIST: return [3 /*break*/, 32];
|
|
11442
11460
|
}
|
|
11443
|
-
return [3 /*break*/,
|
|
11461
|
+
return [3 /*break*/, 34];
|
|
11444
11462
|
case 2: return [4 /*yield*/, this.getTextValue()];
|
|
11445
11463
|
case 3:
|
|
11446
11464
|
customDataValue = _b.sent();
|
|
11447
|
-
return [3 /*break*/,
|
|
11448
|
-
case 4: return [4 /*yield*/, this.
|
|
11465
|
+
return [3 /*break*/, 35];
|
|
11466
|
+
case 4: return [4 /*yield*/, this.getRichTextPropValue()];
|
|
11449
11467
|
case 5:
|
|
11450
11468
|
customDataValue = _b.sent();
|
|
11451
|
-
return [3 /*break*/,
|
|
11452
|
-
case 6: return [4 /*yield*/, this.
|
|
11469
|
+
return [3 /*break*/, 35];
|
|
11470
|
+
case 6: return [4 /*yield*/, this.getBooleanValue()];
|
|
11453
11471
|
case 7:
|
|
11454
11472
|
customDataValue = _b.sent();
|
|
11455
|
-
return [3 /*break*/,
|
|
11456
|
-
case 8: return [4 /*yield*/, this.
|
|
11473
|
+
return [3 /*break*/, 35];
|
|
11474
|
+
case 8: return [4 /*yield*/, this.getBrandListPropValue()];
|
|
11457
11475
|
case 9:
|
|
11458
11476
|
customDataValue = _b.sent();
|
|
11459
|
-
return [3 /*break*/,
|
|
11460
|
-
case 10: return [4 /*yield*/, this.
|
|
11477
|
+
return [3 /*break*/, 35];
|
|
11478
|
+
case 10: return [4 /*yield*/, this.getBrandPropValue()];
|
|
11461
11479
|
case 11:
|
|
11462
11480
|
customDataValue = _b.sent();
|
|
11463
|
-
return [3 /*break*/,
|
|
11464
|
-
case 12: return [4 /*yield*/, this.
|
|
11481
|
+
return [3 /*break*/, 35];
|
|
11482
|
+
case 12: return [4 /*yield*/, this.getCategoryListPropValue()];
|
|
11465
11483
|
case 13:
|
|
11466
11484
|
customDataValue = _b.sent();
|
|
11467
|
-
return [3 /*break*/,
|
|
11468
|
-
case 14: return [4 /*yield*/, this.
|
|
11485
|
+
return [3 /*break*/, 35];
|
|
11486
|
+
case 14: return [4 /*yield*/, this.getCategoryPropValue()];
|
|
11469
11487
|
case 15:
|
|
11470
11488
|
customDataValue = _b.sent();
|
|
11471
|
-
return [3 /*break*/,
|
|
11472
|
-
case 16: return [4 /*yield*/, this.
|
|
11489
|
+
return [3 /*break*/, 35];
|
|
11490
|
+
case 16: return [4 /*yield*/, this.getColorPropValue()];
|
|
11473
11491
|
case 17:
|
|
11474
11492
|
customDataValue = _b.sent();
|
|
11475
|
-
return [3 /*break*/,
|
|
11476
|
-
case 18: return [4 /*yield*/, this.
|
|
11493
|
+
return [3 /*break*/, 35];
|
|
11494
|
+
case 18: return [4 /*yield*/, this.getImageListPropValue()];
|
|
11477
11495
|
case 19:
|
|
11478
11496
|
customDataValue = _b.sent();
|
|
11479
|
-
return [3 /*break*/,
|
|
11480
|
-
case 20: return [4 /*yield*/, this.
|
|
11497
|
+
return [3 /*break*/, 35];
|
|
11498
|
+
case 20: return [4 /*yield*/, this.getImagePropValue()];
|
|
11481
11499
|
case 21:
|
|
11482
11500
|
customDataValue = _b.sent();
|
|
11483
|
-
return [3 /*break*/,
|
|
11484
|
-
case 22: return [4 /*yield*/, this.
|
|
11501
|
+
return [3 /*break*/, 35];
|
|
11502
|
+
case 22: return [4 /*yield*/, this.getLinkPropValue()];
|
|
11485
11503
|
case 23:
|
|
11486
11504
|
customDataValue = _b.sent();
|
|
11487
|
-
return [3 /*break*/,
|
|
11488
|
-
case 24: return [4 /*yield*/, this.
|
|
11505
|
+
return [3 /*break*/, 35];
|
|
11506
|
+
case 24: return [4 /*yield*/, this.getProductDetailPropValue()];
|
|
11489
11507
|
case 25:
|
|
11490
11508
|
customDataValue = _b.sent();
|
|
11491
|
-
return [3 /*break*/,
|
|
11492
|
-
case 26: return [4 /*yield*/, this.
|
|
11509
|
+
return [3 /*break*/, 35];
|
|
11510
|
+
case 26: return [4 /*yield*/, this.getProductListPropValue()];
|
|
11493
11511
|
case 27:
|
|
11494
11512
|
customDataValue = _b.sent();
|
|
11495
|
-
return [3 /*break*/,
|
|
11496
|
-
case 28: return [4 /*yield*/, this.
|
|
11513
|
+
return [3 /*break*/, 35];
|
|
11514
|
+
case 28: return [4 /*yield*/, this.getObjectValue()];
|
|
11497
11515
|
case 29:
|
|
11498
11516
|
customDataValue = _b.sent();
|
|
11499
|
-
return [3 /*break*/,
|
|
11500
|
-
case 30: return [
|
|
11501
|
-
case 31:
|
|
11502
|
-
|
|
11517
|
+
return [3 /*break*/, 35];
|
|
11518
|
+
case 30: return [4 /*yield*/, this.getArrayValue()];
|
|
11519
|
+
case 31:
|
|
11520
|
+
customDataValue = _b.sent();
|
|
11521
|
+
return [3 /*break*/, 35];
|
|
11522
|
+
case 32: return [4 /*yield*/, this.getComponentListValue()];
|
|
11523
|
+
case 33:
|
|
11524
|
+
customDataValue = _b.sent();
|
|
11525
|
+
return [3 /*break*/, 35];
|
|
11526
|
+
case 34: return [3 /*break*/, 35];
|
|
11527
|
+
case 35: return [3 /*break*/, 37];
|
|
11528
|
+
case 36:
|
|
11503
11529
|
_b.sent();
|
|
11504
11530
|
return [2 /*return*/];
|
|
11505
|
-
case
|
|
11531
|
+
case 37: return [2 /*return*/, JSON.parse(JSON.stringify(customDataValue))];
|
|
11506
11532
|
}
|
|
11507
11533
|
});
|
|
11508
11534
|
});
|
|
@@ -11615,6 +11641,24 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
11615
11641
|
});
|
|
11616
11642
|
});
|
|
11617
11643
|
};
|
|
11644
|
+
IkasCustomPropValueProvider.prototype.getRichTextPropValue = function () {
|
|
11645
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11646
|
+
var provider, value;
|
|
11647
|
+
return __generator(this, function (_a) {
|
|
11648
|
+
switch (_a.label) {
|
|
11649
|
+
case 0:
|
|
11650
|
+
provider = new IkasRichTextPropValueProvider(this.value);
|
|
11651
|
+
return [4 /*yield*/, provider.getValue()];
|
|
11652
|
+
case 1:
|
|
11653
|
+
value = _a.sent();
|
|
11654
|
+
return [2 /*return*/, {
|
|
11655
|
+
value: value,
|
|
11656
|
+
customData: this.customData,
|
|
11657
|
+
}];
|
|
11658
|
+
}
|
|
11659
|
+
});
|
|
11660
|
+
});
|
|
11661
|
+
};
|
|
11618
11662
|
IkasCustomPropValueProvider.prototype.getImageListPropValue = function () {
|
|
11619
11663
|
return __awaiter(this, void 0, void 0, function () {
|
|
11620
11664
|
var provider, value;
|
|
@@ -11741,7 +11785,7 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
11741
11785
|
if (nestedData.isRequired &&
|
|
11742
11786
|
(nestedValue === undefined || nestedValue === null))
|
|
11743
11787
|
throw new Error("Required data is missing");
|
|
11744
|
-
nestedProvider = new IkasCustomPropValueProvider(nestedValue, nestedData, this.theme, this.pageSpecificData);
|
|
11788
|
+
nestedProvider = new IkasCustomPropValueProvider(nestedValue, nestedData, this.theme, this.pageType, this.pageDataProvider, this.pageSpecificData);
|
|
11745
11789
|
return [4 /*yield*/, nestedProvider.getValue()];
|
|
11746
11790
|
case 2:
|
|
11747
11791
|
_itemValue = _b.sent();
|
|
@@ -11779,7 +11823,7 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
11779
11823
|
if (nestedData.isRequired &&
|
|
11780
11824
|
(itemValue === undefined || itemValue === null))
|
|
11781
11825
|
throw new Error("Required data is missing");
|
|
11782
|
-
provider = new IkasCustomPropValueProvider(itemValue, nestedData, this.theme, this.pageSpecificData);
|
|
11826
|
+
provider = new IkasCustomPropValueProvider(itemValue, nestedData, this.theme, this.pageType, this.pageDataProvider, this.pageSpecificData);
|
|
11783
11827
|
return [4 /*yield*/, provider.getValue()];
|
|
11784
11828
|
case 2:
|
|
11785
11829
|
_itemValue = _b.sent();
|
|
@@ -11801,6 +11845,28 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
11801
11845
|
});
|
|
11802
11846
|
});
|
|
11803
11847
|
};
|
|
11848
|
+
IkasCustomPropValueProvider.prototype.getComponentListValue = function () {
|
|
11849
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11850
|
+
var pageComponents;
|
|
11851
|
+
var _a;
|
|
11852
|
+
var _this = this;
|
|
11853
|
+
return __generator(this, function (_b) {
|
|
11854
|
+
switch (_b.label) {
|
|
11855
|
+
case 0:
|
|
11856
|
+
pageComponents = this.value
|
|
11857
|
+
? this.value.map(function (v) { return new IkasThemePageComponent(v); })
|
|
11858
|
+
: [];
|
|
11859
|
+
_a = {};
|
|
11860
|
+
return [4 /*yield*/, Promise.all(pageComponents.map(function (tp) {
|
|
11861
|
+
return _this.pageDataProvider.getPageComponentPropValues(tp);
|
|
11862
|
+
}))];
|
|
11863
|
+
case 1: return [2 /*return*/, (_a.value = _b.sent(),
|
|
11864
|
+
_a.customData = this.customData,
|
|
11865
|
+
_a)];
|
|
11866
|
+
}
|
|
11867
|
+
});
|
|
11868
|
+
});
|
|
11869
|
+
};
|
|
11804
11870
|
return IkasCustomPropValueProvider;
|
|
11805
11871
|
}());
|
|
11806
11872
|
|
|
@@ -11832,79 +11898,346 @@ var decodeBase64 = function (base64) {
|
|
|
11832
11898
|
return buffer.toString("ascii");
|
|
11833
11899
|
};
|
|
11834
11900
|
|
|
11835
|
-
var
|
|
11836
|
-
|
|
11837
|
-
|
|
11838
|
-
|
|
11839
|
-
|
|
11840
|
-
|
|
11841
|
-
|
|
11842
|
-
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
|
|
11846
|
-
}
|
|
11847
|
-
Object.defineProperty(IkasPageDataProvider.prototype, "page", {
|
|
11848
|
-
get: function () {
|
|
11849
|
-
var _this = this;
|
|
11850
|
-
if (this.pageType === exports.IkasThemePageType.CUSTOM) {
|
|
11851
|
-
var slug_1 = this.pageParams.slug;
|
|
11852
|
-
return this.theme.pages.find(function (page) { return page.type === exports.IkasThemePageType.CUSTOM && page.slug === slug_1; });
|
|
11853
|
-
}
|
|
11854
|
-
return this.theme.pages.find(function (page) { return page.type === _this.pageType; });
|
|
11855
|
-
},
|
|
11856
|
-
enumerable: false,
|
|
11857
|
-
configurable: true
|
|
11858
|
-
});
|
|
11859
|
-
Object.defineProperty(IkasPageDataProvider.prototype, "nextPageData", {
|
|
11860
|
-
get: function () {
|
|
11861
|
-
return {
|
|
11862
|
-
props: {
|
|
11863
|
-
propValuesStr: JSON.stringify(this.pageComponentPropValues),
|
|
11864
|
-
pageSpecificDataStr: this.pageSpecificData
|
|
11865
|
-
? JSON.stringify(this.pageSpecificData || {})
|
|
11866
|
-
: "",
|
|
11867
|
-
page: mobx.toJS(this.page) || null,
|
|
11868
|
-
settingsStr: JSON.stringify(this.theme.settings || {}),
|
|
11869
|
-
merchantSettings: this.merchantSettings
|
|
11870
|
-
? JSON.stringify(this.merchantSettings)
|
|
11871
|
-
: null,
|
|
11872
|
-
configJson: IkasStorefrontConfig.getJson(),
|
|
11873
|
-
},
|
|
11874
|
-
};
|
|
11875
|
-
},
|
|
11876
|
-
enumerable: false,
|
|
11877
|
-
configurable: true
|
|
11901
|
+
var ThemeComponent = mobxReactLite.observer(function (_a) {
|
|
11902
|
+
var pageComponentPropValue = _a.pageComponentPropValue, index = _a.index, settings = _a.settings;
|
|
11903
|
+
var store = IkasStorefrontConfig.store, components = IkasStorefrontConfig.components;
|
|
11904
|
+
var pageComponent = pageComponentPropValue.pageComponent;
|
|
11905
|
+
var propValues = pageComponentPropValue.propValues;
|
|
11906
|
+
var hasNullValue = mobx.computed(function () {
|
|
11907
|
+
return Object.entries(propValues || {}).some(function (_a) {
|
|
11908
|
+
var _b;
|
|
11909
|
+
var propName = _a[0], propValue = _a[1];
|
|
11910
|
+
return (propValue === null || propValue === undefined) && ((_b = pageComponentPropValue.component.props.find(function (p) { return p.name === propName; })) === null || _b === void 0 ? void 0 : _b.isRequired);
|
|
11911
|
+
});
|
|
11878
11912
|
});
|
|
11879
|
-
|
|
11880
|
-
|
|
11881
|
-
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
11913
|
+
var Component = components[pageComponent.componentId];
|
|
11914
|
+
return (React.createElement("div", { id: index + "" }, hasNullValue.get() ? null : (React.createElement(Component, __assign({ key: pageComponent.id }, propValues, { settings: settings, store: store })))));
|
|
11915
|
+
});
|
|
11916
|
+
|
|
11917
|
+
var IkasPageHead = mobxReactLite.observer(function (_a) {
|
|
11918
|
+
var _b;
|
|
11919
|
+
var page = _a.page, pageTitle = _a.pageTitle, description = _a.description, pageSpecificDataStr = _a.pageSpecificDataStr, props = __rest(_a, ["page", "pageTitle", "description", "pageSpecificDataStr"]);
|
|
11920
|
+
var ogpMetas = [];
|
|
11921
|
+
var schemas = [];
|
|
11922
|
+
var isCanonicalLinkAdd = false;
|
|
11923
|
+
var canonicalHref = "";
|
|
11924
|
+
if (props.addOgpMetas) {
|
|
11925
|
+
ogpMetas.push({
|
|
11926
|
+
property: "og:type",
|
|
11927
|
+
content: "website",
|
|
11928
|
+
});
|
|
11929
|
+
if (typeof window !== "undefined") {
|
|
11930
|
+
ogpMetas.push({
|
|
11931
|
+
property: "og:site_name",
|
|
11932
|
+
content: "https://" + window.location.hostname,
|
|
11933
|
+
});
|
|
11934
|
+
}
|
|
11935
|
+
if (pageTitle) {
|
|
11936
|
+
ogpMetas.push({
|
|
11937
|
+
property: "og:title",
|
|
11938
|
+
content: pageTitle,
|
|
11939
|
+
});
|
|
11940
|
+
}
|
|
11941
|
+
if (description) {
|
|
11942
|
+
ogpMetas.push({
|
|
11943
|
+
property: "og:description",
|
|
11944
|
+
content: description,
|
|
11945
|
+
});
|
|
11946
|
+
}
|
|
11947
|
+
if (typeof window !== "undefined") {
|
|
11948
|
+
ogpMetas.push({
|
|
11949
|
+
property: "og:url",
|
|
11950
|
+
content: window.location.href,
|
|
11951
|
+
});
|
|
11952
|
+
}
|
|
11953
|
+
if (props.merchantSettings) {
|
|
11954
|
+
if (pageSpecificDataStr && (page === null || page === void 0 ? void 0 : page.type) === exports.IkasThemePageType.PRODUCT) {
|
|
11955
|
+
var productDetailParsed = JSON.parse(pageSpecificDataStr);
|
|
11956
|
+
var productDetail = new IkasProductDetail(productDetailParsed.product, productDetailParsed.selectedVariantValues);
|
|
11957
|
+
if (productDetail.selectedVariant.mainImage) {
|
|
11958
|
+
ogpMetas.push({
|
|
11959
|
+
property: "og:image",
|
|
11960
|
+
content: (_b = productDetail.selectedVariant.mainImage) === null || _b === void 0 ? void 0 : _b.src,
|
|
11961
|
+
});
|
|
11962
|
+
}
|
|
11887
11963
|
}
|
|
11888
|
-
|
|
11889
|
-
|
|
11964
|
+
else {
|
|
11965
|
+
var merchantSettings = new IkasMerchantSettings(JSON.parse(props.merchantSettings));
|
|
11966
|
+
ogpMetas.push({
|
|
11967
|
+
property: "og:image",
|
|
11968
|
+
content: merchantSettings.logo.src,
|
|
11969
|
+
});
|
|
11890
11970
|
}
|
|
11891
|
-
|
|
11892
|
-
|
|
11971
|
+
}
|
|
11972
|
+
}
|
|
11973
|
+
if (props.merchantSettings) {
|
|
11974
|
+
// for schema.org
|
|
11975
|
+
var merchantSettings = new IkasMerchantSettings(JSON.parse(props.merchantSettings));
|
|
11976
|
+
var websiteSchema = createWebsiteSchema();
|
|
11977
|
+
var storeSchema = createStoreSchema(merchantSettings);
|
|
11978
|
+
schemas.push(websiteSchema);
|
|
11979
|
+
schemas.push(storeSchema);
|
|
11980
|
+
}
|
|
11981
|
+
if (pageSpecificDataStr && (page === null || page === void 0 ? void 0 : page.type) === exports.IkasThemePageType.PRODUCT) {
|
|
11982
|
+
var productDetailParsed = JSON.parse(pageSpecificDataStr);
|
|
11983
|
+
var productDetail = new IkasProductDetail(productDetailParsed.product, productDetailParsed.selectedVariantValues);
|
|
11984
|
+
if (typeof window !== "undefined" && productDetail.product.hasVariant) {
|
|
11985
|
+
isCanonicalLinkAdd =
|
|
11986
|
+
window.location.pathname !== productDetail.product.href;
|
|
11987
|
+
canonicalHref =
|
|
11988
|
+
"https://" + window.location.hostname + productDetail.product.href;
|
|
11989
|
+
}
|
|
11990
|
+
var schema = createProductSchema(productDetail);
|
|
11991
|
+
if (schema)
|
|
11992
|
+
schemas.push(schema);
|
|
11993
|
+
}
|
|
11994
|
+
if (pageSpecificDataStr && (page === null || page === void 0 ? void 0 : page.type) === exports.IkasThemePageType.CATEGORY) {
|
|
11995
|
+
var categorySchema = createCategorySchema(pageSpecificDataStr);
|
|
11996
|
+
if (categorySchema)
|
|
11997
|
+
schemas.push(categorySchema);
|
|
11998
|
+
var categoryBreadcrumbSchema = createCategoryBreadcrumbSchema(pageSpecificDataStr);
|
|
11999
|
+
if (categoryBreadcrumbSchema)
|
|
12000
|
+
schemas.push(categoryBreadcrumbSchema);
|
|
12001
|
+
}
|
|
12002
|
+
return (React.createElement(Head__default['default'], null,
|
|
12003
|
+
React.createElement("title", null, pageTitle || ""),
|
|
12004
|
+
React.createElement("meta", { name: "description", content: description || "" }),
|
|
12005
|
+
isCanonicalLinkAdd && React.createElement("link", { rel: "canonical", href: canonicalHref }),
|
|
12006
|
+
!!props.addOgpMetas &&
|
|
12007
|
+
ogpMetas.map(function (ogpMeta, index) { return (React.createElement("meta", { key: ogpMeta.content + "-" + index, property: ogpMeta.property, content: ogpMeta.content })); }),
|
|
12008
|
+
!!schemas.length &&
|
|
12009
|
+
schemas.map(function (schema, index) { return (React.createElement("script", { key: index, type: "application/ld+json", dangerouslySetInnerHTML: {
|
|
12010
|
+
__html: JSON.stringify(schema),
|
|
12011
|
+
} })); })));
|
|
12012
|
+
});
|
|
12013
|
+
function createWebsiteSchema() {
|
|
12014
|
+
var _a;
|
|
12015
|
+
var hostname = "";
|
|
12016
|
+
if (typeof window !== "undefined") {
|
|
12017
|
+
hostname = (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.hostname;
|
|
12018
|
+
}
|
|
12019
|
+
return {
|
|
12020
|
+
"@context": "https://schema.org",
|
|
12021
|
+
"@type": "Website",
|
|
12022
|
+
url: "https://" + hostname,
|
|
12023
|
+
};
|
|
12024
|
+
}
|
|
12025
|
+
function createStoreSchema(merchantSettings) {
|
|
12026
|
+
var _a, _b;
|
|
12027
|
+
var hostname = "";
|
|
12028
|
+
if (typeof window !== "undefined") {
|
|
12029
|
+
hostname = (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.hostname;
|
|
12030
|
+
}
|
|
12031
|
+
return {
|
|
12032
|
+
"@context": "https://schema.org",
|
|
12033
|
+
"@type": "Store",
|
|
12034
|
+
name: merchantSettings === null || merchantSettings === void 0 ? void 0 : merchantSettings.merchantName,
|
|
12035
|
+
logo: (_b = merchantSettings === null || merchantSettings === void 0 ? void 0 : merchantSettings.logo) === null || _b === void 0 ? void 0 : _b.src,
|
|
12036
|
+
url: "https://" + hostname,
|
|
12037
|
+
};
|
|
12038
|
+
}
|
|
12039
|
+
function createProductSchema(productDetail) {
|
|
12040
|
+
var _a, _b;
|
|
12041
|
+
try {
|
|
12042
|
+
var isBrowser = typeof window !== "undefined";
|
|
12043
|
+
if (isBrowser) {
|
|
12044
|
+
var urlParams = new URLSearchParams(window.location.search);
|
|
12045
|
+
var vid_1 = urlParams.get("vid");
|
|
12046
|
+
if (vid_1) {
|
|
12047
|
+
var variant = productDetail.product.variants.find(function (v) { return v.id === vid_1; });
|
|
12048
|
+
if (variant) {
|
|
12049
|
+
productDetail.selectedVariantValues = variant.variantValues;
|
|
12050
|
+
}
|
|
11893
12051
|
}
|
|
11894
|
-
|
|
11895
|
-
|
|
11896
|
-
|
|
11897
|
-
|
|
11898
|
-
|
|
11899
|
-
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
12052
|
+
}
|
|
12053
|
+
var productUrl = isBrowser
|
|
12054
|
+
? "https://" + window.location.hostname + productDetail.href
|
|
12055
|
+
: "";
|
|
12056
|
+
return {
|
|
12057
|
+
"@context": "https://schema.org/",
|
|
12058
|
+
"@type": "Product",
|
|
12059
|
+
name: productDetail.product.name,
|
|
12060
|
+
description: (_a = productDetail.product.metaData) === null || _a === void 0 ? void 0 : _a.description,
|
|
12061
|
+
image: productDetail.selectedVariant.images.map(function (i) { return i.src; }),
|
|
12062
|
+
productId: productDetail.selectedVariant.id,
|
|
12063
|
+
sku: productDetail.selectedVariant.sku,
|
|
12064
|
+
mpn: productDetail.selectedVariant.barcodeList.length
|
|
12065
|
+
? productDetail.selectedVariant.barcodeList[0]
|
|
12066
|
+
: "",
|
|
12067
|
+
brand: {
|
|
12068
|
+
"@type": "Brand",
|
|
12069
|
+
name: (_b = productDetail.product.brand) === null || _b === void 0 ? void 0 : _b.name,
|
|
12070
|
+
},
|
|
12071
|
+
offers: {
|
|
12072
|
+
"@type": "Offer",
|
|
12073
|
+
url: productUrl,
|
|
12074
|
+
priceCurrency: productDetail.selectedVariant.price.currency || "TRY",
|
|
12075
|
+
price: productDetail.selectedVariant.price.finalPrice,
|
|
12076
|
+
priceValidUntil: "",
|
|
12077
|
+
itemCondition: "https://schema.org/NewCondition",
|
|
12078
|
+
availability: productDetail.selectedVariant.stock > 0
|
|
12079
|
+
? "https://schema.org/InStock"
|
|
12080
|
+
: "https://schema.org/OutOfStock",
|
|
12081
|
+
},
|
|
12082
|
+
};
|
|
12083
|
+
}
|
|
12084
|
+
catch (err) { }
|
|
12085
|
+
}
|
|
12086
|
+
function createCategorySchema(pageSpecificDataStr) {
|
|
12087
|
+
var _a, _b, _c;
|
|
12088
|
+
try {
|
|
12089
|
+
var categoryParsed = JSON.parse(pageSpecificDataStr);
|
|
12090
|
+
var category = new IkasCategory(categoryParsed);
|
|
12091
|
+
var categoryUrl = typeof window !== undefined
|
|
12092
|
+
? "https://" + window.location.hostname + category.href
|
|
12093
|
+
: "";
|
|
12094
|
+
return {
|
|
12095
|
+
"@context": "http://schema.org",
|
|
12096
|
+
"@type": "CollectionPage",
|
|
12097
|
+
url: categoryUrl,
|
|
12098
|
+
name: (_a = category.metaData) === null || _a === void 0 ? void 0 : _a.pageTitle,
|
|
12099
|
+
description: (_b = category.metaData) === null || _b === void 0 ? void 0 : _b.description,
|
|
12100
|
+
image: (_c = category.image) === null || _c === void 0 ? void 0 : _c.src,
|
|
12101
|
+
};
|
|
12102
|
+
}
|
|
12103
|
+
catch (_d) { }
|
|
12104
|
+
}
|
|
12105
|
+
function createCategoryBreadcrumbSchema(pageSpecificDataStr) {
|
|
12106
|
+
try {
|
|
12107
|
+
var categoryParsed = JSON.parse(pageSpecificDataStr);
|
|
12108
|
+
var category = new IkasCategory(categoryParsed);
|
|
12109
|
+
return {
|
|
12110
|
+
"@context": "http://schema.org",
|
|
12111
|
+
"@type": "BreadcrumbList",
|
|
12112
|
+
itemListElement: category.path.map(function (categoryPath, index) { return ({
|
|
12113
|
+
"@type": "ListItem",
|
|
12114
|
+
position: index + 1,
|
|
12115
|
+
name: categoryPath.name,
|
|
12116
|
+
item: typeof window !== undefined
|
|
12117
|
+
? "https://" + window.location.hostname + categoryPath.href
|
|
12118
|
+
: "",
|
|
12119
|
+
}); }),
|
|
12120
|
+
};
|
|
12121
|
+
}
|
|
12122
|
+
catch (_a) { }
|
|
12123
|
+
}
|
|
12124
|
+
|
|
12125
|
+
var IkasPage = mobxReactLite.observer(function (_a) {
|
|
12126
|
+
var propValues = _a.propValues, page = _a.page, pageSpecificDataStr = _a.pageSpecificDataStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings, addOgpMetas = _a.addOgpMetas;
|
|
12127
|
+
var store = IkasStorefrontConfig.store;
|
|
12128
|
+
var settings = React.useState(new IkasThemeSettings(JSON.parse(settingsStr)))[0];
|
|
12129
|
+
if (page) {
|
|
12130
|
+
store.currentPageType = page.type;
|
|
12131
|
+
}
|
|
12132
|
+
React.useEffect(function () {
|
|
12133
|
+
//@ts-ignore
|
|
12134
|
+
store.setSettings(settingsStr);
|
|
12135
|
+
//@ts-ignore
|
|
12136
|
+
store.cartStore.getCart();
|
|
12137
|
+
store.checkLocalization();
|
|
12138
|
+
}, []);
|
|
12139
|
+
var headerComponentPropValue = propValues.find(function (pv) { return pv.component.isHeader; });
|
|
12140
|
+
var footerComponentPropValue = propValues.find(function (pv) { return pv.component.isFooter; });
|
|
12141
|
+
var others = propValues.filter(function (pv) { return !pv.component.isHeader && !pv.component.isFooter; }) || [];
|
|
12142
|
+
if (!page)
|
|
12143
|
+
return null;
|
|
12144
|
+
return (React.createElement(React.Fragment, null,
|
|
12145
|
+
React.createElement(IkasPageHead, { page: page, pageTitle: page.pageTitle, description: page.description, pageSpecificDataStr: pageSpecificDataStr, merchantSettings: merchantSettings, addOgpMetas: addOgpMetas }),
|
|
12146
|
+
React.createElement("div", { style: pageStyle },
|
|
12147
|
+
React.createElement("div", null,
|
|
12148
|
+
headerComponentPropValue &&
|
|
12149
|
+
renderComponent(headerComponentPropValue, settings, -1),
|
|
12150
|
+
others.map(function (pageComponentPropValue, index) {
|
|
12151
|
+
return renderComponent(pageComponentPropValue, settings, index);
|
|
12152
|
+
})),
|
|
12153
|
+
footerComponentPropValue &&
|
|
12154
|
+
renderComponent(footerComponentPropValue, settings, -1))));
|
|
12155
|
+
});
|
|
12156
|
+
var renderComponent = function (pageComponentPropValue, settings, index) {
|
|
12157
|
+
return (React.createElement(ThemeComponent, { key: pageComponentPropValue.pageComponent.id, index: index, pageComponentPropValue: pageComponentPropValue, settings: settings }));
|
|
12158
|
+
};
|
|
12159
|
+
var pageStyle = {
|
|
12160
|
+
position: "relative",
|
|
12161
|
+
minHeight: "100vh",
|
|
12162
|
+
width: "100vw",
|
|
12163
|
+
display: "flex",
|
|
12164
|
+
flexDirection: "column",
|
|
12165
|
+
justifyContent: "space-between",
|
|
12166
|
+
};
|
|
12167
|
+
|
|
12168
|
+
var IkasPageDataProvider = /** @class */ (function () {
|
|
12169
|
+
function IkasPageDataProvider(theme, pageParams, pageType) {
|
|
12170
|
+
this.pageType = null;
|
|
12171
|
+
this.pageParams = {};
|
|
12172
|
+
this.pageComponentPropValues = [];
|
|
12173
|
+
this.pageSpecificData = null;
|
|
12174
|
+
this.merchantSettings = null;
|
|
12175
|
+
this.theme = new IkasTheme(theme);
|
|
12176
|
+
this.pageParams = pageParams || {};
|
|
12177
|
+
this.pageType = pageType;
|
|
12178
|
+
mobx.makeAutoObservable(this);
|
|
12179
|
+
}
|
|
12180
|
+
Object.defineProperty(IkasPageDataProvider.prototype, "page", {
|
|
12181
|
+
get: function () {
|
|
12182
|
+
var _this = this;
|
|
12183
|
+
if (this.pageType === exports.IkasThemePageType.CUSTOM) {
|
|
12184
|
+
var slug_1 = this.pageParams.slug;
|
|
12185
|
+
return this.theme.pages.find(function (page) { return page.type === exports.IkasThemePageType.CUSTOM && page.slug === slug_1; });
|
|
12186
|
+
}
|
|
12187
|
+
return this.theme.pages.find(function (page) { return page.type === _this.pageType; });
|
|
12188
|
+
},
|
|
12189
|
+
enumerable: false,
|
|
12190
|
+
configurable: true
|
|
12191
|
+
});
|
|
12192
|
+
Object.defineProperty(IkasPageDataProvider.prototype, "nextPageData", {
|
|
12193
|
+
get: function () {
|
|
12194
|
+
return {
|
|
12195
|
+
props: {
|
|
12196
|
+
propValuesStr: JSON.stringify(this.pageComponentPropValues),
|
|
12197
|
+
pageSpecificDataStr: this.pageSpecificData
|
|
12198
|
+
? JSON.stringify(this.pageSpecificData || {})
|
|
12199
|
+
: "",
|
|
12200
|
+
page: mobx.toJS(this.page) || null,
|
|
12201
|
+
settingsStr: JSON.stringify(this.theme.settings || {}),
|
|
12202
|
+
merchantSettings: this.merchantSettings
|
|
12203
|
+
? JSON.stringify(this.merchantSettings)
|
|
12204
|
+
: null,
|
|
12205
|
+
configJson: IkasStorefrontConfig.getJson(),
|
|
12206
|
+
},
|
|
12207
|
+
};
|
|
12208
|
+
},
|
|
12209
|
+
enumerable: false,
|
|
12210
|
+
configurable: true
|
|
12211
|
+
});
|
|
12212
|
+
Object.defineProperty(IkasPageDataProvider.prototype, "specification", {
|
|
12213
|
+
get: function () {
|
|
12214
|
+
var _this = this;
|
|
12215
|
+
var _a, _b, _c;
|
|
12216
|
+
var selectedPage = this.page;
|
|
12217
|
+
var specification;
|
|
12218
|
+
if ((selectedPage === null || selectedPage === void 0 ? void 0 : selectedPage.type) === exports.IkasThemePageType.PRODUCT) {
|
|
12219
|
+
specification = (_a = selectedPage.specifications) === null || _a === void 0 ? void 0 : _a.find(function (s) { var _a; return s.id === ((_a = _this.pageSpecificData) === null || _a === void 0 ? void 0 : _a.product.id); });
|
|
12220
|
+
}
|
|
12221
|
+
if ((selectedPage === null || selectedPage === void 0 ? void 0 : selectedPage.type) === exports.IkasThemePageType.CATEGORY) {
|
|
12222
|
+
specification = (_b = selectedPage.specifications) === null || _b === void 0 ? void 0 : _b.find(function (s) { var _a; return s.id === ((_a = _this.pageSpecificData) === null || _a === void 0 ? void 0 : _a.id); });
|
|
12223
|
+
}
|
|
12224
|
+
if ((selectedPage === null || selectedPage === void 0 ? void 0 : selectedPage.type) === exports.IkasThemePageType.BRAND) {
|
|
12225
|
+
specification = (_c = selectedPage.specifications) === null || _c === void 0 ? void 0 : _c.find(function (s) { var _a; return s.id === ((_a = _this.pageSpecificData) === null || _a === void 0 ? void 0 : _a.id); });
|
|
12226
|
+
}
|
|
12227
|
+
return specification;
|
|
12228
|
+
},
|
|
12229
|
+
enumerable: false,
|
|
12230
|
+
configurable: true
|
|
12231
|
+
});
|
|
12232
|
+
Object.defineProperty(IkasPageDataProvider.prototype, "pageComponents", {
|
|
12233
|
+
get: function () {
|
|
12234
|
+
var _a;
|
|
12235
|
+
if (this.specification)
|
|
12236
|
+
return this.specification.components;
|
|
12237
|
+
return ((_a = this.page) === null || _a === void 0 ? void 0 : _a.components) || [];
|
|
12238
|
+
},
|
|
12239
|
+
enumerable: false,
|
|
12240
|
+
configurable: true
|
|
11908
12241
|
});
|
|
11909
12242
|
Object.defineProperty(IkasPageDataProvider.prototype, "isStaticPage", {
|
|
11910
12243
|
get: function () {
|
|
@@ -12155,60 +12488,87 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12155
12488
|
};
|
|
12156
12489
|
IkasPageDataProvider.prototype.getPageComponentPropValue = function (pageComponent, prop) {
|
|
12157
12490
|
return __awaiter(this, void 0, void 0, function () {
|
|
12158
|
-
var propValueProvider, propValue, customData;
|
|
12159
|
-
|
|
12160
|
-
|
|
12491
|
+
var propValueProvider, propValue, _a, customData, pageComponents;
|
|
12492
|
+
var _this = this;
|
|
12493
|
+
return __generator(this, function (_b) {
|
|
12494
|
+
switch (_b.label) {
|
|
12161
12495
|
case 0:
|
|
12162
12496
|
propValue = pageComponent.propValues[prop.name];
|
|
12163
12497
|
if (propValue === null || propValue === undefined)
|
|
12164
12498
|
return [2 /*return*/, null];
|
|
12165
|
-
|
|
12166
|
-
|
|
12167
|
-
|
|
12168
|
-
|
|
12169
|
-
case exports.IkasThemeComponentPropType.BOOLEAN:
|
|
12170
|
-
|
|
12171
|
-
|
|
12172
|
-
case exports.IkasThemeComponentPropType.
|
|
12173
|
-
|
|
12174
|
-
|
|
12175
|
-
case exports.IkasThemeComponentPropType.
|
|
12176
|
-
|
|
12177
|
-
|
|
12178
|
-
case exports.IkasThemeComponentPropType.
|
|
12179
|
-
|
|
12180
|
-
|
|
12181
|
-
case exports.IkasThemeComponentPropType.
|
|
12182
|
-
|
|
12183
|
-
|
|
12184
|
-
case exports.IkasThemeComponentPropType.PRODUCT_LIST:
|
|
12185
|
-
propValueProvider = new IkasProductListPropValueProvider(this.pageType, propValue, this.pageParams, this.pageSpecificData);
|
|
12186
|
-
break;
|
|
12187
|
-
case exports.IkasThemeComponentPropType.PRODUCT_DETAIL:
|
|
12188
|
-
propValueProvider = new IkasProductDetailPropValueProvider(propValue, this.pageSpecificData);
|
|
12189
|
-
break;
|
|
12190
|
-
case exports.IkasThemeComponentPropType.CATEGORY:
|
|
12191
|
-
propValueProvider = new IkasCategoryPropValueProvider(propValue, this.pageSpecificData);
|
|
12192
|
-
break;
|
|
12193
|
-
case exports.IkasThemeComponentPropType.CATEGORY_LIST:
|
|
12194
|
-
propValueProvider = new IkasCategoryListPropValueProvider(propValue);
|
|
12195
|
-
break;
|
|
12196
|
-
case exports.IkasThemeComponentPropType.LINK:
|
|
12197
|
-
case exports.IkasThemeComponentPropType.LIST_OF_LINK:
|
|
12198
|
-
propValueProvider = new IkasLinkPropValueProvider(propValue, this.theme);
|
|
12199
|
-
break;
|
|
12200
|
-
case exports.IkasThemeComponentPropType.COLOR:
|
|
12201
|
-
propValueProvider = new IkasColorPropValueProvider(propValue);
|
|
12202
|
-
break;
|
|
12203
|
-
case exports.IkasThemeComponentPropType.CUSTOM:
|
|
12204
|
-
customData = this.theme.customData.find(function (cd) { return cd.id === prop.customDataId; });
|
|
12205
|
-
if (!customData)
|
|
12206
|
-
return [2 /*return*/];
|
|
12207
|
-
propValueProvider = new IkasCustomPropValueProvider(propValue, customData, this.theme, this.pageType, this.pageSpecificData, this.pageParams);
|
|
12208
|
-
break;
|
|
12499
|
+
_a = prop.type;
|
|
12500
|
+
switch (_a) {
|
|
12501
|
+
case exports.IkasThemeComponentPropType.TEXT: return [3 /*break*/, 1];
|
|
12502
|
+
case exports.IkasThemeComponentPropType.RICH_TEXT: return [3 /*break*/, 2];
|
|
12503
|
+
case exports.IkasThemeComponentPropType.BOOLEAN: return [3 /*break*/, 3];
|
|
12504
|
+
case exports.IkasThemeComponentPropType.IMAGE: return [3 /*break*/, 4];
|
|
12505
|
+
case exports.IkasThemeComponentPropType.IMAGE_LIST: return [3 /*break*/, 5];
|
|
12506
|
+
case exports.IkasThemeComponentPropType.BRAND: return [3 /*break*/, 6];
|
|
12507
|
+
case exports.IkasThemeComponentPropType.BRAND_LIST: return [3 /*break*/, 7];
|
|
12508
|
+
case exports.IkasThemeComponentPropType.PRODUCT_LIST: return [3 /*break*/, 8];
|
|
12509
|
+
case exports.IkasThemeComponentPropType.PRODUCT_DETAIL: return [3 /*break*/, 9];
|
|
12510
|
+
case exports.IkasThemeComponentPropType.CATEGORY: return [3 /*break*/, 10];
|
|
12511
|
+
case exports.IkasThemeComponentPropType.CATEGORY_LIST: return [3 /*break*/, 11];
|
|
12512
|
+
case exports.IkasThemeComponentPropType.LINK: return [3 /*break*/, 12];
|
|
12513
|
+
case exports.IkasThemeComponentPropType.LIST_OF_LINK: return [3 /*break*/, 12];
|
|
12514
|
+
case exports.IkasThemeComponentPropType.COLOR: return [3 /*break*/, 13];
|
|
12515
|
+
case exports.IkasThemeComponentPropType.CUSTOM: return [3 /*break*/, 14];
|
|
12516
|
+
case exports.IkasThemeComponentPropType.COMPONENT: return [3 /*break*/, 15];
|
|
12517
|
+
case exports.IkasThemeComponentPropType.COMPONENT_LIST: return [3 /*break*/, 15];
|
|
12209
12518
|
}
|
|
12210
|
-
return [
|
|
12211
|
-
case 1:
|
|
12519
|
+
return [3 /*break*/, 17];
|
|
12520
|
+
case 1:
|
|
12521
|
+
propValueProvider = new IkasTextPropValueProvider(propValue);
|
|
12522
|
+
return [3 /*break*/, 18];
|
|
12523
|
+
case 2:
|
|
12524
|
+
propValueProvider = new IkasRichTextPropValueProvider(propValue);
|
|
12525
|
+
return [3 /*break*/, 18];
|
|
12526
|
+
case 3:
|
|
12527
|
+
propValueProvider = new IkasBooleanPropValueProvider(propValue);
|
|
12528
|
+
return [3 /*break*/, 18];
|
|
12529
|
+
case 4:
|
|
12530
|
+
propValueProvider = new IkasImagePropValueProvider(propValue);
|
|
12531
|
+
return [3 /*break*/, 18];
|
|
12532
|
+
case 5:
|
|
12533
|
+
propValueProvider = new IkasImageListPropValueProvider(propValue);
|
|
12534
|
+
return [3 /*break*/, 18];
|
|
12535
|
+
case 6:
|
|
12536
|
+
propValueProvider = new IkasBrandPropValueProvider(propValue, this.pageSpecificData);
|
|
12537
|
+
return [3 /*break*/, 18];
|
|
12538
|
+
case 7:
|
|
12539
|
+
propValueProvider = new IkasBrandListPropValueProvider(propValue);
|
|
12540
|
+
return [3 /*break*/, 18];
|
|
12541
|
+
case 8:
|
|
12542
|
+
propValueProvider = new IkasProductListPropValueProvider(this.pageType, propValue, this.pageParams, this.pageSpecificData);
|
|
12543
|
+
return [3 /*break*/, 18];
|
|
12544
|
+
case 9:
|
|
12545
|
+
propValueProvider = new IkasProductDetailPropValueProvider(propValue, this.pageSpecificData);
|
|
12546
|
+
return [3 /*break*/, 18];
|
|
12547
|
+
case 10:
|
|
12548
|
+
propValueProvider = new IkasCategoryPropValueProvider(propValue, this.pageSpecificData);
|
|
12549
|
+
return [3 /*break*/, 18];
|
|
12550
|
+
case 11:
|
|
12551
|
+
propValueProvider = new IkasCategoryListPropValueProvider(propValue);
|
|
12552
|
+
return [3 /*break*/, 18];
|
|
12553
|
+
case 12:
|
|
12554
|
+
propValueProvider = new IkasLinkPropValueProvider(propValue, this.theme);
|
|
12555
|
+
return [3 /*break*/, 18];
|
|
12556
|
+
case 13:
|
|
12557
|
+
propValueProvider = new IkasColorPropValueProvider(propValue);
|
|
12558
|
+
return [3 /*break*/, 18];
|
|
12559
|
+
case 14:
|
|
12560
|
+
customData = this.theme.customData.find(function (cd) { return cd.id === prop.customDataId; });
|
|
12561
|
+
if (!customData)
|
|
12562
|
+
return [2 /*return*/];
|
|
12563
|
+
propValueProvider = new IkasCustomPropValueProvider(propValue, customData, this.theme, this.pageType, this, this.pageSpecificData, this.pageParams);
|
|
12564
|
+
return [3 /*break*/, 18];
|
|
12565
|
+
case 15:
|
|
12566
|
+
pageComponents = propValue;
|
|
12567
|
+
return [4 /*yield*/, Promise.all(pageComponents.map(function (tp) { return _this.getPageComponentPropValues(tp); }))];
|
|
12568
|
+
case 16: return [2 /*return*/, _b.sent()];
|
|
12569
|
+
case 17: return [3 /*break*/, 18];
|
|
12570
|
+
case 18: return [4 /*yield*/, (propValueProvider === null || propValueProvider === void 0 ? void 0 : propValueProvider.getValue())];
|
|
12571
|
+
case 19: return [2 /*return*/, _b.sent()];
|
|
12212
12572
|
}
|
|
12213
12573
|
});
|
|
12214
12574
|
});
|
|
@@ -12222,7 +12582,8 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12222
12582
|
IkasPageDataProvider.isServer = function () {
|
|
12223
12583
|
return typeof window === "undefined";
|
|
12224
12584
|
};
|
|
12225
|
-
IkasPageDataProvider.initPropValues = function (propValuesStr, router, isBrowser) {
|
|
12585
|
+
IkasPageDataProvider.initPropValues = function (propValuesStr, router, settingsStr, isBrowser) {
|
|
12586
|
+
var settings = new IkasThemeSettings(JSON.parse(settingsStr));
|
|
12226
12587
|
var pageComponentPropValues = JSON.parse(propValuesStr).map(function (v) { return ({
|
|
12227
12588
|
pageComponent: new IkasThemePageComponent(v.pageComponent),
|
|
12228
12589
|
component: new IkasThemeComponent(v.component),
|
|
@@ -12263,8 +12624,14 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12263
12624
|
case exports.IkasThemeComponentPropType.LIST_OF_LINK:
|
|
12264
12625
|
IkasPageDataProvider.initLinkPropValue(prop, propValue, pageComponentPropValue);
|
|
12265
12626
|
break;
|
|
12627
|
+
case exports.IkasThemeComponentPropType.COMPONENT:
|
|
12628
|
+
IkasPageDataProvider.initComponentPropValue(prop, propValue, pageComponentPropValue, router, settings, isBrowser);
|
|
12629
|
+
break;
|
|
12630
|
+
case exports.IkasThemeComponentPropType.COMPONENT_LIST:
|
|
12631
|
+
IkasPageDataProvider.initComponentListPropValue(prop, propValue, pageComponentPropValue, router, settings, isBrowser);
|
|
12632
|
+
break;
|
|
12266
12633
|
case exports.IkasThemeComponentPropType.CUSTOM:
|
|
12267
|
-
IkasPageDataProvider.initCustomDataPropValue(prop, propValue, pageComponentPropValue, router, isBrowser);
|
|
12634
|
+
IkasPageDataProvider.initCustomDataPropValue(prop, propValue, pageComponentPropValue, router, settings, isBrowser);
|
|
12268
12635
|
break;
|
|
12269
12636
|
}
|
|
12270
12637
|
});
|
|
@@ -12346,14 +12713,14 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12346
12713
|
IkasPageDataProvider._initImageListPropValue = function (propValue) {
|
|
12347
12714
|
return propValue.map(function (i) { return new IkasImage(i.id); });
|
|
12348
12715
|
};
|
|
12349
|
-
IkasPageDataProvider.initCustomDataPropValue = function (prop, customDataValue, pageComponentPropValue, router, isBrowser) {
|
|
12716
|
+
IkasPageDataProvider.initCustomDataPropValue = function (prop, customDataValue, pageComponentPropValue, router, settings, isBrowser) {
|
|
12350
12717
|
if (!customDataValue ||
|
|
12351
12718
|
!customDataValue.value ||
|
|
12352
12719
|
!customDataValue.customData)
|
|
12353
12720
|
return;
|
|
12354
|
-
pageComponentPropValue.propValues[prop.name] = this._initCustomDataPropValue(customDataValue, customDataValue.customData, router, isBrowser);
|
|
12721
|
+
pageComponentPropValue.propValues[prop.name] = this._initCustomDataPropValue(customDataValue, customDataValue.customData, router, settings, isBrowser);
|
|
12355
12722
|
};
|
|
12356
|
-
IkasPageDataProvider._initCustomDataPropValue = function (customDataValue, customData, router, isBrowser) {
|
|
12723
|
+
IkasPageDataProvider._initCustomDataPropValue = function (customDataValue, customData, router, settings, isBrowser) {
|
|
12357
12724
|
var _this = this;
|
|
12358
12725
|
if (!customDataValue)
|
|
12359
12726
|
return null;
|
|
@@ -12384,7 +12751,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12384
12751
|
for (var _i = 0, _a = customData.nestedData || []; _i < _a.length; _i++) {
|
|
12385
12752
|
var nestedCustomData = _a[_i];
|
|
12386
12753
|
var value = propValue[nestedCustomData.key];
|
|
12387
|
-
objectValue[nestedCustomData.key] = this._initCustomDataPropValue(value, nestedCustomData, router, isBrowser);
|
|
12754
|
+
objectValue[nestedCustomData.key] = this._initCustomDataPropValue(value, nestedCustomData, router, settings, isBrowser);
|
|
12388
12755
|
}
|
|
12389
12756
|
return objectValue;
|
|
12390
12757
|
case exports.IkasThemeCustomDataType.DYNAMIC_LIST:
|
|
@@ -12395,17 +12762,51 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12395
12762
|
var listValue_1 = [];
|
|
12396
12763
|
var nestedCustomData_1 = customData.nestedData[0];
|
|
12397
12764
|
propValue.forEach(function (itemValue) {
|
|
12398
|
-
listValue_1.push(_this._initCustomDataPropValue(itemValue, nestedCustomData_1, router, isBrowser));
|
|
12765
|
+
listValue_1.push(_this._initCustomDataPropValue(itemValue, nestedCustomData_1, router, settings, isBrowser));
|
|
12399
12766
|
});
|
|
12400
12767
|
return listValue_1;
|
|
12401
12768
|
}
|
|
12402
12769
|
catch (err) {
|
|
12403
12770
|
return [];
|
|
12404
12771
|
}
|
|
12772
|
+
case exports.IkasThemeCustomDataType.COMPONENT:
|
|
12773
|
+
return this._initComponentPropValue(propValue, router, settings, isBrowser);
|
|
12774
|
+
case exports.IkasThemeCustomDataType.COMPONENT_LIST:
|
|
12775
|
+
return this._initComponentListPropValue(propValue, router, settings, isBrowser);
|
|
12405
12776
|
default:
|
|
12406
12777
|
return propValue;
|
|
12407
12778
|
}
|
|
12408
12779
|
};
|
|
12780
|
+
IkasPageDataProvider.initComponentPropValue = function (prop, propValue, pageComponentPropValue, router, settings, isBrowser) {
|
|
12781
|
+
pageComponentPropValue.propValues[prop.name] = this._initComponentPropValue(propValue, router, settings, isBrowser);
|
|
12782
|
+
};
|
|
12783
|
+
IkasPageDataProvider._initComponentPropValue = function (propValue, router, settings, isBrowser) {
|
|
12784
|
+
var pValue = propValue.length ? propValue[0] : undefined;
|
|
12785
|
+
if (!pValue)
|
|
12786
|
+
return;
|
|
12787
|
+
var pageComponentPropValue = new IkasPageComponentPropValue(pValue);
|
|
12788
|
+
var initializedPageComponentPropValues = this.initPropValues(JSON.stringify([pageComponentPropValue]), router, JSON.stringify(settings), isBrowser);
|
|
12789
|
+
if (!initializedPageComponentPropValues.length)
|
|
12790
|
+
return;
|
|
12791
|
+
return new IkasComponentRenderer(function () {
|
|
12792
|
+
return renderComponent(initializedPageComponentPropValues[0], settings, -10);
|
|
12793
|
+
});
|
|
12794
|
+
};
|
|
12795
|
+
IkasPageDataProvider.initComponentListPropValue = function (prop, propValue, pageComponentPropValue, router, settings, isBrowser) {
|
|
12796
|
+
pageComponentPropValue.propValues[prop.name] = this._initComponentListPropValue(propValue, router, settings, isBrowser);
|
|
12797
|
+
};
|
|
12798
|
+
IkasPageDataProvider._initComponentListPropValue = function (propValue, router, settings, isBrowser) {
|
|
12799
|
+
var _this = this;
|
|
12800
|
+
if (propValue && propValue.length)
|
|
12801
|
+
return propValue.map(function (p) {
|
|
12802
|
+
var pageComponentPropValue = new IkasPageComponentPropValue(p);
|
|
12803
|
+
var initializedPageComponentPropValues = _this.initPropValues(JSON.stringify([pageComponentPropValue]), router, JSON.stringify(settings), isBrowser);
|
|
12804
|
+
return new IkasComponentRenderer(function () {
|
|
12805
|
+
return renderComponent(initializedPageComponentPropValues[0], settings, -1);
|
|
12806
|
+
});
|
|
12807
|
+
});
|
|
12808
|
+
return [];
|
|
12809
|
+
};
|
|
12409
12810
|
return IkasPageDataProvider;
|
|
12410
12811
|
}());
|
|
12411
12812
|
var IkasPageComponentPropValue = /** @class */ (function () {
|
|
@@ -18580,6 +18981,58 @@ var GoogleTagManager = /** @class */ (function () {
|
|
|
18580
18981
|
console.error(err);
|
|
18581
18982
|
}
|
|
18582
18983
|
};
|
|
18984
|
+
GoogleTagManager.completeRegistration = function () {
|
|
18985
|
+
try {
|
|
18986
|
+
var event_8 = {
|
|
18987
|
+
event: "customer_register",
|
|
18988
|
+
};
|
|
18989
|
+
//@ts-ignore
|
|
18990
|
+
!isServer$2 && window.dataLayer && window.dataLayer.push(event_8);
|
|
18991
|
+
return event_8;
|
|
18992
|
+
}
|
|
18993
|
+
catch (err) {
|
|
18994
|
+
console.error(err);
|
|
18995
|
+
}
|
|
18996
|
+
};
|
|
18997
|
+
GoogleTagManager.search = function (searchKeyword) {
|
|
18998
|
+
try {
|
|
18999
|
+
var event_9 = {
|
|
19000
|
+
event: "search",
|
|
19001
|
+
search_string: searchKeyword,
|
|
19002
|
+
};
|
|
19003
|
+
//@ts-ignore
|
|
19004
|
+
!isServer$2 && window.dataLayer && window.dataLayer.push(event_9);
|
|
19005
|
+
return event_9;
|
|
19006
|
+
}
|
|
19007
|
+
catch (err) {
|
|
19008
|
+
console.error(err);
|
|
19009
|
+
}
|
|
19010
|
+
};
|
|
19011
|
+
GoogleTagManager.viewCategory = function (category, categoryPath) {
|
|
19012
|
+
try {
|
|
19013
|
+
var event_10 = {
|
|
19014
|
+
event: "view_category",
|
|
19015
|
+
ecommerce: {
|
|
19016
|
+
category: [
|
|
19017
|
+
{
|
|
19018
|
+
id: category.id,
|
|
19019
|
+
name: category.name,
|
|
19020
|
+
metaData: category.metaData,
|
|
19021
|
+
href: category.href,
|
|
19022
|
+
image: category.image,
|
|
19023
|
+
path: categoryPath,
|
|
19024
|
+
},
|
|
19025
|
+
],
|
|
19026
|
+
},
|
|
19027
|
+
};
|
|
19028
|
+
//@ts-ignore
|
|
19029
|
+
!isServer$2 && window.dataLayer && window.dataLayer.push(event_10);
|
|
19030
|
+
return event_10;
|
|
19031
|
+
}
|
|
19032
|
+
catch (err) {
|
|
19033
|
+
console.error(err);
|
|
19034
|
+
}
|
|
19035
|
+
};
|
|
18583
19036
|
return GoogleTagManager;
|
|
18584
19037
|
}());
|
|
18585
19038
|
function productToGTMItem(productDetail, quantity) {
|
|
@@ -18721,6 +19174,7 @@ var Analytics = /** @class */ (function () {
|
|
|
18721
19174
|
Analytics.search = function (searchKeyword) {
|
|
18722
19175
|
try {
|
|
18723
19176
|
FacebookPixel.search(searchKeyword);
|
|
19177
|
+
GoogleTagManager.search(searchKeyword);
|
|
18724
19178
|
}
|
|
18725
19179
|
catch (err) {
|
|
18726
19180
|
console.error(err);
|
|
@@ -18729,6 +19183,7 @@ var Analytics = /** @class */ (function () {
|
|
|
18729
19183
|
Analytics.completeRegistration = function () {
|
|
18730
19184
|
try {
|
|
18731
19185
|
FacebookPixel.completeRegistration();
|
|
19186
|
+
GoogleTagManager.completeRegistration();
|
|
18732
19187
|
}
|
|
18733
19188
|
catch (err) {
|
|
18734
19189
|
console.error(err);
|
|
@@ -18744,9 +19199,10 @@ var Analytics = /** @class */ (function () {
|
|
|
18744
19199
|
console.error(err);
|
|
18745
19200
|
}
|
|
18746
19201
|
};
|
|
18747
|
-
Analytics.viewCategory = function (categoryPath) {
|
|
19202
|
+
Analytics.viewCategory = function (categoryPath, category) {
|
|
18748
19203
|
try {
|
|
18749
19204
|
FacebookPixel.viewCategory(categoryPath);
|
|
19205
|
+
GoogleTagManager.viewCategory(category, categoryPath);
|
|
18750
19206
|
}
|
|
18751
19207
|
catch (err) {
|
|
18752
19208
|
console.error(err);
|
|
@@ -20073,6 +20529,7 @@ var IkasThemeComponentProp = /** @class */ (function () {
|
|
|
20073
20529
|
}());
|
|
20074
20530
|
(function (IkasThemeComponentPropType) {
|
|
20075
20531
|
IkasThemeComponentPropType["TEXT"] = "TEXT";
|
|
20532
|
+
IkasThemeComponentPropType["RICH_TEXT"] = "RICH_TEXT";
|
|
20076
20533
|
IkasThemeComponentPropType["BOOLEAN"] = "BOOLEAN";
|
|
20077
20534
|
IkasThemeComponentPropType["IMAGE"] = "IMAGE";
|
|
20078
20535
|
IkasThemeComponentPropType["IMAGE_LIST"] = "IMAGE_LIST";
|
|
@@ -20086,8 +20543,8 @@ var IkasThemeComponentProp = /** @class */ (function () {
|
|
|
20086
20543
|
IkasThemeComponentPropType["CATEGORY_LIST"] = "CATEGORY_LIST";
|
|
20087
20544
|
IkasThemeComponentPropType["COLOR"] = "COLOR";
|
|
20088
20545
|
IkasThemeComponentPropType["CUSTOM"] = "CUSTOM";
|
|
20089
|
-
|
|
20090
|
-
|
|
20546
|
+
IkasThemeComponentPropType["COMPONENT"] = "COMPONENT";
|
|
20547
|
+
IkasThemeComponentPropType["COMPONENT_LIST"] = "COMPONENT_LIST";
|
|
20091
20548
|
})(exports.IkasThemeComponentPropType || (exports.IkasThemeComponentPropType = {}));
|
|
20092
20549
|
|
|
20093
20550
|
var IkasThemeComponent = /** @class */ (function () {
|
|
@@ -20135,6 +20592,7 @@ var IkasThemeCustomData = /** @class */ (function () {
|
|
|
20135
20592
|
}());
|
|
20136
20593
|
(function (IkasThemeCustomDataType) {
|
|
20137
20594
|
IkasThemeCustomDataType["TEXT"] = "TEXT";
|
|
20595
|
+
IkasThemeCustomDataType["RICH_TEXT"] = "RICH_TEXT";
|
|
20138
20596
|
IkasThemeCustomDataType["NUMBER"] = "NUMBER";
|
|
20139
20597
|
IkasThemeCustomDataType["BOOLEAN"] = "BOOLEAN";
|
|
20140
20598
|
IkasThemeCustomDataType["IMAGE"] = "IMAGE";
|
|
@@ -20148,6 +20606,8 @@ var IkasThemeCustomData = /** @class */ (function () {
|
|
|
20148
20606
|
IkasThemeCustomDataType["CATEGORY"] = "CATEGORY";
|
|
20149
20607
|
IkasThemeCustomDataType["CATEGORY_LIST"] = "CATEGORY_LIST";
|
|
20150
20608
|
IkasThemeCustomDataType["COLOR"] = "COLOR";
|
|
20609
|
+
IkasThemeCustomDataType["COMPONENT"] = "COMPONENT";
|
|
20610
|
+
IkasThemeCustomDataType["COMPONENT_LIST"] = "COMPONENT_LIST";
|
|
20151
20611
|
IkasThemeCustomDataType["OBJECT"] = "OBJECT";
|
|
20152
20612
|
IkasThemeCustomDataType["STATIC_LIST"] = "STATIC_LIST";
|
|
20153
20613
|
IkasThemeCustomDataType["DYNAMIC_LIST"] = "DYNAMIC_LIST";
|
|
@@ -20338,12 +20798,19 @@ var IkasBrandList = /** @class */ (function () {
|
|
|
20338
20798
|
})];
|
|
20339
20799
|
case 2:
|
|
20340
20800
|
response_1 = _a.sent();
|
|
20341
|
-
|
|
20342
|
-
|
|
20343
|
-
|
|
20344
|
-
|
|
20345
|
-
|
|
20346
|
-
|
|
20801
|
+
if (this.isStatic) {
|
|
20802
|
+
this.data = this._brandListPropValue
|
|
20803
|
+
.brandIds.map(function (bID) {
|
|
20804
|
+
return response_1.brands.find(function (b) { return b.id === bID; });
|
|
20805
|
+
})
|
|
20806
|
+
.filter(function (b) { return !!b; });
|
|
20807
|
+
}
|
|
20808
|
+
else {
|
|
20809
|
+
this.data = response_1.brands;
|
|
20810
|
+
}
|
|
20811
|
+
this._count = response_1.count;
|
|
20812
|
+
this._initialized = true;
|
|
20813
|
+
this._minPage = this.page;
|
|
20347
20814
|
return [3 /*break*/, 5];
|
|
20348
20815
|
case 3:
|
|
20349
20816
|
err_1 = _a.sent();
|
|
@@ -20623,17 +21090,24 @@ var IkasCategoryList = /** @class */ (function () {
|
|
|
20623
21090
|
})];
|
|
20624
21091
|
case 2:
|
|
20625
21092
|
response_1 = _a.sent();
|
|
20626
|
-
|
|
20627
|
-
|
|
20628
|
-
|
|
20629
|
-
|
|
20630
|
-
|
|
20631
|
-
|
|
20632
|
-
|
|
20633
|
-
|
|
20634
|
-
|
|
20635
|
-
|
|
20636
|
-
|
|
21093
|
+
if (this.isStatic) {
|
|
21094
|
+
this.data = this._categoryListPropValue
|
|
21095
|
+
.categoryIds.map(function (cID) {
|
|
21096
|
+
return response_1.categories.find(function (c) { return c.id === cID; });
|
|
21097
|
+
})
|
|
21098
|
+
.filter(function (c) { return !!c; });
|
|
21099
|
+
}
|
|
21100
|
+
else {
|
|
21101
|
+
this.data = response_1.categories;
|
|
21102
|
+
}
|
|
21103
|
+
this._count = response_1.count;
|
|
21104
|
+
this._initialized = true;
|
|
21105
|
+
this._minPage = this.page;
|
|
21106
|
+
return [3 /*break*/, 5];
|
|
21107
|
+
case 3:
|
|
21108
|
+
err_1 = _a.sent();
|
|
21109
|
+
console.log(err_1);
|
|
21110
|
+
return [3 /*break*/, 5];
|
|
20637
21111
|
case 4:
|
|
20638
21112
|
mobx.runInAction(function () {
|
|
20639
21113
|
_this._isLoading = false;
|
|
@@ -24232,6 +24706,13 @@ var AccountInfoForm = /** @class */ (function () {
|
|
|
24232
24706
|
return AccountInfoForm;
|
|
24233
24707
|
}());
|
|
24234
24708
|
|
|
24709
|
+
var IkasComponentRenderer = /** @class */ (function () {
|
|
24710
|
+
function IkasComponentRenderer(render) {
|
|
24711
|
+
this.render = render;
|
|
24712
|
+
}
|
|
24713
|
+
return IkasComponentRenderer;
|
|
24714
|
+
}());
|
|
24715
|
+
|
|
24235
24716
|
var IkasProductListPropValue = /** @class */ (function () {
|
|
24236
24717
|
function IkasProductListPropValue(data) {
|
|
24237
24718
|
this.initialSort = null;
|
|
@@ -24291,8 +24772,8 @@ var IkasCategoryListPropValue = /** @class */ (function () {
|
|
|
24291
24772
|
this.categoryListType = data.categoryListType || exports.IkasCategoryListType.ALL;
|
|
24292
24773
|
this.initialSort = data.initialSort || exports.IkasCategoryListSortType.A_Z;
|
|
24293
24774
|
this.initialLimit = data.initialLimit || 20;
|
|
24294
|
-
this.categoryCount = data.categoryCount;
|
|
24295
|
-
this.categoryIds = data.categoryIds;
|
|
24775
|
+
this.categoryCount = data.categoryCount || null;
|
|
24776
|
+
this.categoryIds = data.categoryIds || null;
|
|
24296
24777
|
mobx.makeAutoObservable(this);
|
|
24297
24778
|
}
|
|
24298
24779
|
return IkasCategoryListPropValue;
|
|
@@ -27585,214 +28066,6 @@ var PolicyModal = mobxReactLite.observer(function (_a) {
|
|
|
27585
28066
|
React.createElement("div", { className: styles$k.ModalContent, dangerouslySetInnerHTML: { __html: modalContent } }))));
|
|
27586
28067
|
});
|
|
27587
28068
|
|
|
27588
|
-
var IkasPageHead = mobxReactLite.observer(function (_a) {
|
|
27589
|
-
var _b;
|
|
27590
|
-
var page = _a.page, pageTitle = _a.pageTitle, description = _a.description, pageSpecificDataStr = _a.pageSpecificDataStr, props = __rest(_a, ["page", "pageTitle", "description", "pageSpecificDataStr"]);
|
|
27591
|
-
var ogpMetas = [];
|
|
27592
|
-
var schemas = [];
|
|
27593
|
-
var isCanonicalLinkAdd = false;
|
|
27594
|
-
var canonicalHref = "";
|
|
27595
|
-
if (props.addOgpMetas) {
|
|
27596
|
-
ogpMetas.push({
|
|
27597
|
-
property: "og:type",
|
|
27598
|
-
content: "website",
|
|
27599
|
-
});
|
|
27600
|
-
if (typeof window !== "undefined") {
|
|
27601
|
-
ogpMetas.push({
|
|
27602
|
-
property: "og:site_name",
|
|
27603
|
-
content: "https://" + window.location.hostname,
|
|
27604
|
-
});
|
|
27605
|
-
}
|
|
27606
|
-
if (pageTitle) {
|
|
27607
|
-
ogpMetas.push({
|
|
27608
|
-
property: "og:title",
|
|
27609
|
-
content: pageTitle,
|
|
27610
|
-
});
|
|
27611
|
-
}
|
|
27612
|
-
if (description) {
|
|
27613
|
-
ogpMetas.push({
|
|
27614
|
-
property: "og:description",
|
|
27615
|
-
content: description,
|
|
27616
|
-
});
|
|
27617
|
-
}
|
|
27618
|
-
if (typeof window !== "undefined") {
|
|
27619
|
-
ogpMetas.push({
|
|
27620
|
-
property: "og:url",
|
|
27621
|
-
content: window.location.href,
|
|
27622
|
-
});
|
|
27623
|
-
}
|
|
27624
|
-
if (props.merchantSettings) {
|
|
27625
|
-
if (pageSpecificDataStr && (page === null || page === void 0 ? void 0 : page.type) === exports.IkasThemePageType.PRODUCT) {
|
|
27626
|
-
var productDetailParsed = JSON.parse(pageSpecificDataStr);
|
|
27627
|
-
var productDetail = new IkasProductDetail(productDetailParsed.product, productDetailParsed.selectedVariantValues);
|
|
27628
|
-
if (productDetail.selectedVariant.mainImage) {
|
|
27629
|
-
ogpMetas.push({
|
|
27630
|
-
property: "og:image",
|
|
27631
|
-
content: (_b = productDetail.selectedVariant.mainImage) === null || _b === void 0 ? void 0 : _b.src,
|
|
27632
|
-
});
|
|
27633
|
-
}
|
|
27634
|
-
}
|
|
27635
|
-
else {
|
|
27636
|
-
var merchantSettings = new IkasMerchantSettings(JSON.parse(props.merchantSettings));
|
|
27637
|
-
ogpMetas.push({
|
|
27638
|
-
property: "og:image",
|
|
27639
|
-
content: merchantSettings.logo.src,
|
|
27640
|
-
});
|
|
27641
|
-
}
|
|
27642
|
-
}
|
|
27643
|
-
}
|
|
27644
|
-
if (props.merchantSettings) {
|
|
27645
|
-
// for schema.org
|
|
27646
|
-
var merchantSettings = new IkasMerchantSettings(JSON.parse(props.merchantSettings));
|
|
27647
|
-
var websiteSchema = createWebsiteSchema();
|
|
27648
|
-
var storeSchema = createStoreSchema(merchantSettings);
|
|
27649
|
-
schemas.push(websiteSchema);
|
|
27650
|
-
schemas.push(storeSchema);
|
|
27651
|
-
}
|
|
27652
|
-
if (pageSpecificDataStr && (page === null || page === void 0 ? void 0 : page.type) === exports.IkasThemePageType.PRODUCT) {
|
|
27653
|
-
var productDetailParsed = JSON.parse(pageSpecificDataStr);
|
|
27654
|
-
var productDetail = new IkasProductDetail(productDetailParsed.product, productDetailParsed.selectedVariantValues);
|
|
27655
|
-
if (typeof window !== "undefined" && productDetail.product.hasVariant) {
|
|
27656
|
-
isCanonicalLinkAdd =
|
|
27657
|
-
window.location.pathname !== productDetail.product.href;
|
|
27658
|
-
canonicalHref =
|
|
27659
|
-
"https://" + window.location.hostname + productDetail.product.href;
|
|
27660
|
-
}
|
|
27661
|
-
var schema = createProductSchema(productDetail);
|
|
27662
|
-
if (schema)
|
|
27663
|
-
schemas.push(schema);
|
|
27664
|
-
}
|
|
27665
|
-
if (pageSpecificDataStr && (page === null || page === void 0 ? void 0 : page.type) === exports.IkasThemePageType.CATEGORY) {
|
|
27666
|
-
var categorySchema = createCategorySchema(pageSpecificDataStr);
|
|
27667
|
-
if (categorySchema)
|
|
27668
|
-
schemas.push(categorySchema);
|
|
27669
|
-
var categoryBreadcrumbSchema = createCategoryBreadcrumbSchema(pageSpecificDataStr);
|
|
27670
|
-
if (categoryBreadcrumbSchema)
|
|
27671
|
-
schemas.push(categoryBreadcrumbSchema);
|
|
27672
|
-
}
|
|
27673
|
-
return (React.createElement(Head__default['default'], null,
|
|
27674
|
-
React.createElement("title", null, pageTitle || ""),
|
|
27675
|
-
React.createElement("meta", { name: "description", content: description || "" }),
|
|
27676
|
-
isCanonicalLinkAdd && React.createElement("link", { rel: "canonical", href: canonicalHref }),
|
|
27677
|
-
!!props.addOgpMetas &&
|
|
27678
|
-
ogpMetas.map(function (ogpMeta, index) { return (React.createElement("meta", { key: ogpMeta.content + "-" + index, property: ogpMeta.property, content: ogpMeta.content })); }),
|
|
27679
|
-
!!schemas.length &&
|
|
27680
|
-
schemas.map(function (schema, index) { return (React.createElement("script", { key: index, type: "application/ld+json", dangerouslySetInnerHTML: {
|
|
27681
|
-
__html: JSON.stringify(schema),
|
|
27682
|
-
} })); })));
|
|
27683
|
-
});
|
|
27684
|
-
function createWebsiteSchema() {
|
|
27685
|
-
var _a;
|
|
27686
|
-
var hostname = "";
|
|
27687
|
-
if (typeof window !== "undefined") {
|
|
27688
|
-
hostname = (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.hostname;
|
|
27689
|
-
}
|
|
27690
|
-
return {
|
|
27691
|
-
"@context": "https://schema.org",
|
|
27692
|
-
"@type": "Website",
|
|
27693
|
-
url: "https://" + hostname,
|
|
27694
|
-
};
|
|
27695
|
-
}
|
|
27696
|
-
function createStoreSchema(merchantSettings) {
|
|
27697
|
-
var _a, _b;
|
|
27698
|
-
var hostname = "";
|
|
27699
|
-
if (typeof window !== "undefined") {
|
|
27700
|
-
hostname = (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.hostname;
|
|
27701
|
-
}
|
|
27702
|
-
return {
|
|
27703
|
-
"@context": "https://schema.org",
|
|
27704
|
-
"@type": "Store",
|
|
27705
|
-
name: merchantSettings === null || merchantSettings === void 0 ? void 0 : merchantSettings.merchantName,
|
|
27706
|
-
logo: (_b = merchantSettings === null || merchantSettings === void 0 ? void 0 : merchantSettings.logo) === null || _b === void 0 ? void 0 : _b.src,
|
|
27707
|
-
url: "https://" + hostname,
|
|
27708
|
-
};
|
|
27709
|
-
}
|
|
27710
|
-
function createProductSchema(productDetail) {
|
|
27711
|
-
var _a, _b;
|
|
27712
|
-
try {
|
|
27713
|
-
var isBrowser = typeof window !== "undefined";
|
|
27714
|
-
if (isBrowser) {
|
|
27715
|
-
var urlParams = new URLSearchParams(window.location.search);
|
|
27716
|
-
var vid_1 = urlParams.get("vid");
|
|
27717
|
-
if (vid_1) {
|
|
27718
|
-
var variant = productDetail.product.variants.find(function (v) { return v.id === vid_1; });
|
|
27719
|
-
if (variant) {
|
|
27720
|
-
productDetail.selectedVariantValues = variant.variantValues;
|
|
27721
|
-
}
|
|
27722
|
-
}
|
|
27723
|
-
}
|
|
27724
|
-
var productUrl = isBrowser
|
|
27725
|
-
? "https://" + window.location.hostname + productDetail.href
|
|
27726
|
-
: "";
|
|
27727
|
-
return {
|
|
27728
|
-
"@context": "https://schema.org/",
|
|
27729
|
-
"@type": "Product",
|
|
27730
|
-
name: productDetail.product.name,
|
|
27731
|
-
description: (_a = productDetail.product.metaData) === null || _a === void 0 ? void 0 : _a.description,
|
|
27732
|
-
image: productDetail.selectedVariant.images.map(function (i) { return i.src; }),
|
|
27733
|
-
productId: productDetail.selectedVariant.id,
|
|
27734
|
-
sku: productDetail.selectedVariant.sku,
|
|
27735
|
-
mpn: productDetail.selectedVariant.barcodeList.length
|
|
27736
|
-
? productDetail.selectedVariant.barcodeList[0]
|
|
27737
|
-
: "",
|
|
27738
|
-
brand: {
|
|
27739
|
-
"@type": "Brand",
|
|
27740
|
-
name: (_b = productDetail.product.brand) === null || _b === void 0 ? void 0 : _b.name,
|
|
27741
|
-
},
|
|
27742
|
-
offers: {
|
|
27743
|
-
"@type": "Offer",
|
|
27744
|
-
url: productUrl,
|
|
27745
|
-
priceCurrency: productDetail.selectedVariant.price.currency || "TRY",
|
|
27746
|
-
price: productDetail.selectedVariant.price.finalPrice,
|
|
27747
|
-
priceValidUntil: "",
|
|
27748
|
-
itemCondition: "https://schema.org/NewCondition",
|
|
27749
|
-
availability: productDetail.selectedVariant.stock > 0
|
|
27750
|
-
? "https://schema.org/InStock"
|
|
27751
|
-
: "https://schema.org/OutOfStock",
|
|
27752
|
-
},
|
|
27753
|
-
};
|
|
27754
|
-
}
|
|
27755
|
-
catch (err) { }
|
|
27756
|
-
}
|
|
27757
|
-
function createCategorySchema(pageSpecificDataStr) {
|
|
27758
|
-
var _a, _b, _c;
|
|
27759
|
-
try {
|
|
27760
|
-
var categoryParsed = JSON.parse(pageSpecificDataStr);
|
|
27761
|
-
var category = new IkasCategory(categoryParsed);
|
|
27762
|
-
var categoryUrl = typeof window !== undefined
|
|
27763
|
-
? "https://" + window.location.hostname + category.href
|
|
27764
|
-
: "";
|
|
27765
|
-
return {
|
|
27766
|
-
"@context": "http://schema.org",
|
|
27767
|
-
"@type": "CollectionPage",
|
|
27768
|
-
url: categoryUrl,
|
|
27769
|
-
name: (_a = category.metaData) === null || _a === void 0 ? void 0 : _a.pageTitle,
|
|
27770
|
-
description: (_b = category.metaData) === null || _b === void 0 ? void 0 : _b.description,
|
|
27771
|
-
image: (_c = category.image) === null || _c === void 0 ? void 0 : _c.src,
|
|
27772
|
-
};
|
|
27773
|
-
}
|
|
27774
|
-
catch (_d) { }
|
|
27775
|
-
}
|
|
27776
|
-
function createCategoryBreadcrumbSchema(pageSpecificDataStr) {
|
|
27777
|
-
try {
|
|
27778
|
-
var categoryParsed = JSON.parse(pageSpecificDataStr);
|
|
27779
|
-
var category = new IkasCategory(categoryParsed);
|
|
27780
|
-
return {
|
|
27781
|
-
"@context": "http://schema.org",
|
|
27782
|
-
"@type": "BreadcrumbList",
|
|
27783
|
-
itemListElement: category.path.map(function (categoryPath, index) { return ({
|
|
27784
|
-
"@type": "ListItem",
|
|
27785
|
-
position: index + 1,
|
|
27786
|
-
name: categoryPath.name,
|
|
27787
|
-
item: typeof window !== undefined
|
|
27788
|
-
? "https://" + window.location.hostname + categoryPath.href
|
|
27789
|
-
: "",
|
|
27790
|
-
}); }),
|
|
27791
|
-
};
|
|
27792
|
-
}
|
|
27793
|
-
catch (_a) { }
|
|
27794
|
-
}
|
|
27795
|
-
|
|
27796
28069
|
var CustomerLoginRequiredError = mobxReactLite.observer(function (_a) {
|
|
27797
28070
|
var onClose = _a.onClose;
|
|
27798
28071
|
return (React.createElement(ErrorContainer, { onClose: onClose },
|
|
@@ -27924,67 +28197,6 @@ var style = {
|
|
|
27924
28197
|
backgroundColor: "rgba(255, 0, 0, 0.5)",
|
|
27925
28198
|
};
|
|
27926
28199
|
|
|
27927
|
-
var ThemeComponent = mobxReactLite.observer(function (_a) {
|
|
27928
|
-
var pageComponentPropValue = _a.pageComponentPropValue, pageComponent = _a.pageComponent, index = _a.index, settingsStr = _a.settingsStr;
|
|
27929
|
-
var store = IkasStorefrontConfig.store, components = IkasStorefrontConfig.components;
|
|
27930
|
-
var settings = new IkasThemeSettings(JSON.parse(settingsStr));
|
|
27931
|
-
React.useEffect(function () {
|
|
27932
|
-
settings.colors.map(function (sc) {
|
|
27933
|
-
return document.documentElement.style.setProperty(sc.key, sc.color);
|
|
27934
|
-
});
|
|
27935
|
-
}, [settings]);
|
|
27936
|
-
var propValues = pageComponentPropValue.propValues;
|
|
27937
|
-
var hasNullValue = mobx.computed(function () {
|
|
27938
|
-
return Object.entries(propValues || {}).some(function (_a) {
|
|
27939
|
-
var _b;
|
|
27940
|
-
var propName = _a[0], propValue = _a[1];
|
|
27941
|
-
return (propValue === null || propValue === undefined) && ((_b = pageComponentPropValue.component.props.find(function (p) { return p.name === propName; })) === null || _b === void 0 ? void 0 : _b.isRequired);
|
|
27942
|
-
});
|
|
27943
|
-
});
|
|
27944
|
-
var Component = components[pageComponent.componentId];
|
|
27945
|
-
return (React.createElement("div", { id: index + "" }, hasNullValue.get() ? (React.createElement(ErrorComponent, null)) : (React.createElement(Component, __assign({ key: pageComponent.id }, propValues, { settings: settings, store: store })))));
|
|
27946
|
-
});
|
|
27947
|
-
|
|
27948
|
-
var IkasPage = mobxReactLite.observer(function (_a) {
|
|
27949
|
-
var _b, _c;
|
|
27950
|
-
var propValues = _a.propValues, page = _a.page, pageSpecificDataStr = _a.pageSpecificDataStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings, addOgpMetas = _a.addOgpMetas;
|
|
27951
|
-
var store = IkasStorefrontConfig.store;
|
|
27952
|
-
if (page) {
|
|
27953
|
-
store.currentPageType = page.type;
|
|
27954
|
-
}
|
|
27955
|
-
React.useEffect(function () {
|
|
27956
|
-
store.checkLocalization();
|
|
27957
|
-
//@ts-ignore
|
|
27958
|
-
store.cartStore.getCart();
|
|
27959
|
-
}, []);
|
|
27960
|
-
var renderComponent = function (pageComponent, index) {
|
|
27961
|
-
var pageComponentPropValue = propValues.find(function (pv) { return pv.pageComponent.id === pageComponent.id; });
|
|
27962
|
-
return (React.createElement(ThemeComponent, { key: pageComponent.id, index: index, pageComponentPropValue: pageComponentPropValue, pageComponent: pageComponent, settingsStr: settingsStr }));
|
|
27963
|
-
};
|
|
27964
|
-
var headerComponent = (_b = propValues.find(function (pv) { return pv.component.isHeader; })) === null || _b === void 0 ? void 0 : _b.pageComponent;
|
|
27965
|
-
var footerComponent = (_c = propValues.find(function (pv) { return pv.component.isFooter; })) === null || _c === void 0 ? void 0 : _c.pageComponent;
|
|
27966
|
-
var others = propValues
|
|
27967
|
-
.filter(function (pv) { return !pv.component.isHeader && !pv.component.isFooter; })
|
|
27968
|
-
.map(function (pv) { return pv.pageComponent; }) || [];
|
|
27969
|
-
if (!page)
|
|
27970
|
-
return null;
|
|
27971
|
-
return (React.createElement(React.Fragment, null,
|
|
27972
|
-
React.createElement(IkasPageHead, { page: page, pageTitle: page.pageTitle, description: page.description, pageSpecificDataStr: pageSpecificDataStr, merchantSettings: merchantSettings, addOgpMetas: addOgpMetas }),
|
|
27973
|
-
React.createElement("div", { style: pageStyle },
|
|
27974
|
-
React.createElement("div", null,
|
|
27975
|
-
headerComponent && renderComponent(headerComponent, -1),
|
|
27976
|
-
others.map(renderComponent)),
|
|
27977
|
-
footerComponent && renderComponent(footerComponent, -1))));
|
|
27978
|
-
});
|
|
27979
|
-
var pageStyle = {
|
|
27980
|
-
position: "relative",
|
|
27981
|
-
minHeight: "100vh",
|
|
27982
|
-
width: "100vw",
|
|
27983
|
-
display: "flex",
|
|
27984
|
-
flexDirection: "column",
|
|
27985
|
-
justifyContent: "space-between",
|
|
27986
|
-
};
|
|
27987
|
-
|
|
27988
28200
|
var PageViewModel = /** @class */ (function () {
|
|
27989
28201
|
function PageViewModel(router) {
|
|
27990
28202
|
var _this = this;
|
|
@@ -28096,18 +28308,6 @@ var PageViewModel = /** @class */ (function () {
|
|
|
28096
28308
|
data: data,
|
|
28097
28309
|
}, "*");
|
|
28098
28310
|
};
|
|
28099
|
-
this.getComponentPropValues = function (pageComponent) {
|
|
28100
|
-
var _a;
|
|
28101
|
-
var json = {};
|
|
28102
|
-
var component = (_a = _this.theme) === null || _a === void 0 ? void 0 : _a.components.find(function (c) { return c.id === pageComponent.componentId; });
|
|
28103
|
-
component === null || component === void 0 ? void 0 : component.props.forEach(function (prop) {
|
|
28104
|
-
// TODO get prop values
|
|
28105
|
-
if (prop.type === exports.IkasThemeComponentPropType.TEXT) {
|
|
28106
|
-
json[prop.name] = pageComponent.propValues[prop.name];
|
|
28107
|
-
}
|
|
28108
|
-
});
|
|
28109
|
-
return json;
|
|
28110
|
-
};
|
|
28111
28311
|
this.getPagePropValues = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
28112
28312
|
var pageDataProvider;
|
|
28113
28313
|
var _this = this;
|
|
@@ -28120,7 +28320,7 @@ var PageViewModel = /** @class */ (function () {
|
|
|
28120
28320
|
return [4 /*yield*/, pageDataProvider.getPageData()];
|
|
28121
28321
|
case 1:
|
|
28122
28322
|
_b.sent();
|
|
28123
|
-
pageDataProvider.pageComponentPropValues = IkasPageDataProvider.initPropValues(JSON.stringify(pageDataProvider.pageComponentPropValues), this.router);
|
|
28323
|
+
pageDataProvider.pageComponentPropValues = IkasPageDataProvider.initPropValues(JSON.stringify(pageDataProvider.pageComponentPropValues), this.router, JSON.stringify(this.theme.settings));
|
|
28124
28324
|
mobx.runInAction(function () {
|
|
28125
28325
|
_this.pageDataProvider = pageDataProvider;
|
|
28126
28326
|
_this.isLoading = false;
|
|
@@ -28184,7 +28384,13 @@ var PageViewModel = /** @class */ (function () {
|
|
|
28184
28384
|
if (pageComponentPropValues) {
|
|
28185
28385
|
pageComponentPropValues.propValues[propName] = propValue;
|
|
28186
28386
|
if (prop.type === exports.IkasThemeComponentPropType.CUSTOM) {
|
|
28187
|
-
IkasPageDataProvider.initCustomDataPropValue(prop, propValue, pageComponentPropValues, _this.router, true);
|
|
28387
|
+
IkasPageDataProvider.initCustomDataPropValue(prop, propValue, pageComponentPropValues, _this.router, _this.theme.settings, true);
|
|
28388
|
+
}
|
|
28389
|
+
else if (prop.type === exports.IkasThemeComponentPropType.COMPONENT) {
|
|
28390
|
+
IkasPageDataProvider.initComponentPropValue(prop, propValue, pageComponentPropValues, _this.router, _this.theme.settings, true);
|
|
28391
|
+
}
|
|
28392
|
+
else if (prop.type === exports.IkasThemeComponentPropType.COMPONENT_LIST) {
|
|
28393
|
+
IkasPageDataProvider.initComponentListPropValue(prop, propValue, pageComponentPropValues, _this.router, _this.theme.settings, true);
|
|
28188
28394
|
}
|
|
28189
28395
|
}
|
|
28190
28396
|
});
|
|
@@ -28253,7 +28459,7 @@ var PageViewModel = /** @class */ (function () {
|
|
|
28253
28459
|
mobx.runInAction(function () {
|
|
28254
28460
|
var customDataProps = pageComponentPropValues.component.props.filter(function (p) { return p.type === exports.IkasThemeComponentPropType.CUSTOM; });
|
|
28255
28461
|
customDataProps.forEach(function (customDataProp) {
|
|
28256
|
-
IkasPageDataProvider.initCustomDataPropValue(customDataProp, pageComponentPropValues.propValues[customDataProp.name], pageComponentPropValues, _this.router, true);
|
|
28462
|
+
IkasPageDataProvider.initCustomDataPropValue(customDataProp, pageComponentPropValues.propValues[customDataProp.name], pageComponentPropValues, _this.router, _this.theme.settings, true);
|
|
28257
28463
|
});
|
|
28258
28464
|
_this.pageDataProvider.pageComponentPropValues.push(pageComponentPropValues);
|
|
28259
28465
|
_this.pageComponents.push(pageComponent);
|
|
@@ -28838,7 +29044,9 @@ var Page = function (_a) {
|
|
|
28838
29044
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings, configJson = _a.configJson;
|
|
28839
29045
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
28840
29046
|
var router$1 = router.useRouter();
|
|
28841
|
-
var propValues = React.useMemo(function () {
|
|
29047
|
+
var propValues = React.useMemo(function () {
|
|
29048
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router$1, settingsStr);
|
|
29049
|
+
}, [propValuesStr]);
|
|
28842
29050
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
|
|
28843
29051
|
};
|
|
28844
29052
|
var getStaticProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -28861,14 +29069,16 @@ var Page$1 = function (_a) {
|
|
|
28861
29069
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
28862
29070
|
var router$1 = router.useRouter();
|
|
28863
29071
|
var _b = React.useState(false), isBrowser = _b[0], setIsBrowser = _b[1];
|
|
28864
|
-
var initialPropValues = React.useMemo(function () {
|
|
29072
|
+
var initialPropValues = React.useMemo(function () {
|
|
29073
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router$1, settingsStr);
|
|
29074
|
+
}, [propValuesStr]);
|
|
28865
29075
|
var _c = React.useState(initialPropValues), propValues = _c[0], setPropValues = _c[1];
|
|
28866
29076
|
React.useEffect(function () {
|
|
28867
29077
|
setIsBrowser(typeof window !== "undefined");
|
|
28868
29078
|
handleAnalytics(page, pageSpecificDataStr);
|
|
28869
29079
|
}, []);
|
|
28870
29080
|
React.useEffect(function () {
|
|
28871
|
-
setPropValues(IkasPageDataProvider.initPropValues(propValuesStr, router$1, isBrowser));
|
|
29081
|
+
setPropValues(IkasPageDataProvider.initPropValues(propValuesStr, router$1, settingsStr, isBrowser));
|
|
28872
29082
|
}, [isBrowser, propValuesStr]);
|
|
28873
29083
|
return (React.createElement(IkasPage, { page: page, propValues: propValues, pageSpecificDataStr: pageSpecificDataStr, settingsStr: settingsStr, merchantSettings: merchantSettings, addOgpMetas: true }));
|
|
28874
29084
|
};
|
|
@@ -28961,7 +29171,7 @@ function handleAnalytics(page, pageSpecificDataStr) {
|
|
|
28961
29171
|
else {
|
|
28962
29172
|
categoryPath = category.name;
|
|
28963
29173
|
}
|
|
28964
|
-
Analytics.viewCategory(categoryPath);
|
|
29174
|
+
Analytics.viewCategory(categoryPath, category);
|
|
28965
29175
|
}
|
|
28966
29176
|
}
|
|
28967
29177
|
catch (err) {
|
|
@@ -28981,7 +29191,9 @@ var Page$2 = function (_a) {
|
|
|
28981
29191
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, configJson = _a.configJson;
|
|
28982
29192
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
28983
29193
|
var router$1 = router.useRouter();
|
|
28984
|
-
var propValues = React.useMemo(function () {
|
|
29194
|
+
var propValues = React.useMemo(function () {
|
|
29195
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router$1, settingsStr);
|
|
29196
|
+
}, [propValuesStr]);
|
|
28985
29197
|
return (React.createElement(IkasPage, { page: page, settingsStr: settingsStr, propValues: propValues }));
|
|
28986
29198
|
};
|
|
28987
29199
|
var getStaticPaths$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29130,7 +29342,9 @@ var Page$3 = function (_a) {
|
|
|
29130
29342
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, configJson = _a.configJson;
|
|
29131
29343
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29132
29344
|
var router$1 = router.useRouter();
|
|
29133
|
-
var propValues = React.useMemo(function () {
|
|
29345
|
+
var propValues = React.useMemo(function () {
|
|
29346
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router$1, settingsStr);
|
|
29347
|
+
}, [propValuesStr]);
|
|
29134
29348
|
return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29135
29349
|
};
|
|
29136
29350
|
var getStaticProps$3 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29152,7 +29366,9 @@ var Page$4 = function (_a) {
|
|
|
29152
29366
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, configJson = _a.configJson;
|
|
29153
29367
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29154
29368
|
var router$1 = router.useRouter();
|
|
29155
|
-
var propValues = React.useMemo(function () {
|
|
29369
|
+
var propValues = React.useMemo(function () {
|
|
29370
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router$1, settingsStr);
|
|
29371
|
+
}, [propValuesStr]);
|
|
29156
29372
|
return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29157
29373
|
};
|
|
29158
29374
|
var getStaticProps$4 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29174,7 +29390,9 @@ var Page$5 = function (_a) {
|
|
|
29174
29390
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, configJson = _a.configJson;
|
|
29175
29391
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29176
29392
|
var router$1 = router.useRouter();
|
|
29177
|
-
var propValues = React.useMemo(function () {
|
|
29393
|
+
var propValues = React.useMemo(function () {
|
|
29394
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router$1, settingsStr);
|
|
29395
|
+
}, [propValuesStr]);
|
|
29178
29396
|
return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29179
29397
|
};
|
|
29180
29398
|
var getStaticProps$5 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29196,7 +29414,9 @@ var Page$6 = function (_a) {
|
|
|
29196
29414
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, configJson = _a.configJson;
|
|
29197
29415
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29198
29416
|
var router$1 = router.useRouter();
|
|
29199
|
-
var propValues = React.useMemo(function () {
|
|
29417
|
+
var propValues = React.useMemo(function () {
|
|
29418
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router$1, settingsStr);
|
|
29419
|
+
}, [propValuesStr]);
|
|
29200
29420
|
return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29201
29421
|
};
|
|
29202
29422
|
var getServerSideProps$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29218,7 +29438,9 @@ var Page$7 = function (_a) {
|
|
|
29218
29438
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings, configJson = _a.configJson;
|
|
29219
29439
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29220
29440
|
var router$1 = router.useRouter();
|
|
29221
|
-
var propValues = React.useMemo(function () {
|
|
29441
|
+
var propValues = React.useMemo(function () {
|
|
29442
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router$1, settingsStr);
|
|
29443
|
+
}, [propValuesStr]);
|
|
29222
29444
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29223
29445
|
};
|
|
29224
29446
|
var getStaticProps$6 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29240,7 +29462,9 @@ var Page$8 = function (_a) {
|
|
|
29240
29462
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings, configJson = _a.configJson;
|
|
29241
29463
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29242
29464
|
var router$1 = router.useRouter();
|
|
29243
|
-
var propValues = React.useMemo(function () {
|
|
29465
|
+
var propValues = React.useMemo(function () {
|
|
29466
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router$1, settingsStr);
|
|
29467
|
+
}, [propValuesStr]);
|
|
29244
29468
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29245
29469
|
};
|
|
29246
29470
|
var getStaticProps$7 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29262,7 +29486,9 @@ var Page$9 = function (_a) {
|
|
|
29262
29486
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings, configJson = _a.configJson;
|
|
29263
29487
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29264
29488
|
var router$1 = router.useRouter();
|
|
29265
|
-
var propValues = React.useMemo(function () {
|
|
29489
|
+
var propValues = React.useMemo(function () {
|
|
29490
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router$1, settingsStr);
|
|
29491
|
+
}, [propValuesStr]);
|
|
29266
29492
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29267
29493
|
};
|
|
29268
29494
|
var getStaticProps$8 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29284,7 +29510,9 @@ var Page$a = function (_a) {
|
|
|
29284
29510
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings, configJson = _a.configJson;
|
|
29285
29511
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29286
29512
|
var router$1 = router.useRouter();
|
|
29287
|
-
var propValues = React.useMemo(function () {
|
|
29513
|
+
var propValues = React.useMemo(function () {
|
|
29514
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router$1, settingsStr);
|
|
29515
|
+
}, [propValuesStr]);
|
|
29288
29516
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29289
29517
|
};
|
|
29290
29518
|
var getStaticProps$9 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29306,7 +29534,9 @@ var Page$b = function (_a) {
|
|
|
29306
29534
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, configJson = _a.configJson;
|
|
29307
29535
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29308
29536
|
var router$1 = router.useRouter();
|
|
29309
|
-
var propValues = React.useMemo(function () {
|
|
29537
|
+
var propValues = React.useMemo(function () {
|
|
29538
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router$1, settingsStr);
|
|
29539
|
+
}, [propValuesStr]);
|
|
29310
29540
|
var store = IkasStorefrontConfig.store;
|
|
29311
29541
|
React.useEffect(function () {
|
|
29312
29542
|
Analytics.viewCart(store.cartStore.cart);
|
|
@@ -29343,7 +29573,9 @@ var Page$d = function (_a) {
|
|
|
29343
29573
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, configJson = _a.configJson;
|
|
29344
29574
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29345
29575
|
var router$1 = router.useRouter();
|
|
29346
|
-
var propValues = React.useMemo(function () {
|
|
29576
|
+
var propValues = React.useMemo(function () {
|
|
29577
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router$1, settingsStr);
|
|
29578
|
+
}, [propValuesStr]);
|
|
29347
29579
|
return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29348
29580
|
};
|
|
29349
29581
|
var getStaticProps$b = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29366,13 +29598,15 @@ var Page$e = function (_a) {
|
|
|
29366
29598
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29367
29599
|
var router$1 = router.useRouter();
|
|
29368
29600
|
var _b = React.useState(false), isBrowser = _b[0], setIsBrowser = _b[1];
|
|
29369
|
-
var initialPropValues = React.useMemo(function () {
|
|
29601
|
+
var initialPropValues = React.useMemo(function () {
|
|
29602
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router$1, settingsStr);
|
|
29603
|
+
}, [propValuesStr]);
|
|
29370
29604
|
var _c = React.useState(initialPropValues), propValues = _c[0], setPropValues = _c[1];
|
|
29371
29605
|
React.useEffect(function () {
|
|
29372
29606
|
setIsBrowser(typeof window !== "undefined");
|
|
29373
29607
|
}, []);
|
|
29374
29608
|
React.useEffect(function () {
|
|
29375
|
-
setPropValues(IkasPageDataProvider.initPropValues(propValuesStr, router$1, isBrowser));
|
|
29609
|
+
setPropValues(IkasPageDataProvider.initPropValues(propValuesStr, router$1, settingsStr, isBrowser));
|
|
29376
29610
|
}, [isBrowser, propValuesStr]);
|
|
29377
29611
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
|
|
29378
29612
|
};
|
|
@@ -29397,7 +29631,9 @@ var Page$f = function (_a) {
|
|
|
29397
29631
|
return React.createElement(Error__default['default'], { statusCode: 404 });
|
|
29398
29632
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29399
29633
|
var router$1 = router.useRouter();
|
|
29400
|
-
var propValues = React.useMemo(function () {
|
|
29634
|
+
var propValues = React.useMemo(function () {
|
|
29635
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router$1, settingsStr);
|
|
29636
|
+
}, [propValuesStr]);
|
|
29401
29637
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29402
29638
|
};
|
|
29403
29639
|
var getStaticProps$d = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29455,6 +29691,7 @@ var IkasBaseStore = /** @class */ (function () {
|
|
|
29455
29691
|
this.localeOptions = [];
|
|
29456
29692
|
this.showLocaleOptions = false;
|
|
29457
29693
|
this.localeChecked = false;
|
|
29694
|
+
this.settingsSet = false;
|
|
29458
29695
|
this.customerStore = new IkasCustomerStore(this);
|
|
29459
29696
|
this.cartStore = new IkasCartStore(this);
|
|
29460
29697
|
mobx.makeObservable(this, {
|
|
@@ -29543,6 +29780,14 @@ var IkasBaseStore = /** @class */ (function () {
|
|
|
29543
29780
|
(localeOption.routing.path ? "/" + localeOption.routing.path : ""));
|
|
29544
29781
|
}
|
|
29545
29782
|
};
|
|
29783
|
+
IkasBaseStore.prototype.setSettings = function (settingsStr) {
|
|
29784
|
+
if (this.settingsSet)
|
|
29785
|
+
return;
|
|
29786
|
+
var settings = new IkasThemeSettings(JSON.parse(settingsStr));
|
|
29787
|
+
settings.colors.map(function (sc) {
|
|
29788
|
+
return document.documentElement.style.setProperty(sc.key, sc.color);
|
|
29789
|
+
});
|
|
29790
|
+
};
|
|
29546
29791
|
return IkasBaseStore;
|
|
29547
29792
|
}());
|
|
29548
29793
|
|
|
@@ -29580,6 +29825,7 @@ exports.IkasCheckout = IkasCheckout;
|
|
|
29580
29825
|
exports.IkasCheckoutAPI = IkasCheckoutAPI;
|
|
29581
29826
|
exports.IkasCheckoutPage = IkasCheckoutPage;
|
|
29582
29827
|
exports.IkasCityAPI = IkasCityAPI;
|
|
29828
|
+
exports.IkasComponentRenderer = IkasComponentRenderer;
|
|
29583
29829
|
exports.IkasContactForm = IkasContactForm;
|
|
29584
29830
|
exports.IkasContactFormAPI = IkasContactFormAPI;
|
|
29585
29831
|
exports.IkasCountryAPI = IkasCountryAPI;
|