@ikas/storefront 0.0.121 → 0.0.123
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 +726 -486
- package/build/index.js +723 -482
- 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.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { makeAutoObservable, toJS, runInAction, reaction, makeObservable,
|
|
2
|
-
import React, { createElement,
|
|
1
|
+
import { makeAutoObservable, computed, toJS, runInAction, reaction, makeObservable, observable, action, configure } from 'mobx';
|
|
2
|
+
import React, { createElement, useState, useEffect, Fragment, useCallback, useRef, useMemo } from 'react';
|
|
3
3
|
import { observer } from 'mobx-react-lite';
|
|
4
|
+
import Head from 'next/head';
|
|
4
5
|
import { useRouter } from 'next/router';
|
|
5
6
|
import Image$1 from 'next/image';
|
|
6
7
|
import Link from 'next/link';
|
|
7
|
-
import Head from 'next/head';
|
|
8
8
|
import fs from 'fs';
|
|
9
9
|
import getConfig from 'next/config';
|
|
10
10
|
import dynamic from 'next/dynamic';
|
|
@@ -11037,6 +11037,7 @@ var IkasProductDetailPropValueProvider = /** @class */ (function () {
|
|
|
11037
11037
|
return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
11038
11038
|
productIdList: [this.productDetailPropValue.productId],
|
|
11039
11039
|
priceListId: IkasStorefrontConfig.priceListId,
|
|
11040
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
11040
11041
|
})];
|
|
11041
11042
|
case 1:
|
|
11042
11043
|
productSearchResponse = _b.sent();
|
|
@@ -11385,12 +11386,27 @@ var IkasCategoryListPropValueProvider = /** @class */ (function () {
|
|
|
11385
11386
|
return IkasCategoryListPropValueProvider;
|
|
11386
11387
|
}());
|
|
11387
11388
|
|
|
11389
|
+
var IkasRichTextPropValueProvider = /** @class */ (function () {
|
|
11390
|
+
function IkasRichTextPropValueProvider(textPropValue) {
|
|
11391
|
+
this.text = textPropValue;
|
|
11392
|
+
}
|
|
11393
|
+
IkasRichTextPropValueProvider.prototype.getValue = function () {
|
|
11394
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11395
|
+
return __generator(this, function (_a) {
|
|
11396
|
+
return [2 /*return*/, this.text];
|
|
11397
|
+
});
|
|
11398
|
+
});
|
|
11399
|
+
};
|
|
11400
|
+
return IkasRichTextPropValueProvider;
|
|
11401
|
+
}());
|
|
11402
|
+
|
|
11388
11403
|
var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
11389
|
-
function IkasCustomPropValueProvider(value, customData, theme, pageType, pageSpecificData, pageParams) {
|
|
11404
|
+
function IkasCustomPropValueProvider(value, customData, theme, pageType, pageDataProvider, pageSpecificData, pageParams) {
|
|
11390
11405
|
this.value = value;
|
|
11391
11406
|
this.customData = customData;
|
|
11392
11407
|
this.theme = theme;
|
|
11393
11408
|
this.pageType = pageType;
|
|
11409
|
+
this.pageDataProvider = pageDataProvider;
|
|
11394
11410
|
this.pageSpecificData = pageSpecificData;
|
|
11395
11411
|
this.pageParams = pageParams;
|
|
11396
11412
|
}
|
|
@@ -11404,89 +11420,100 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
11404
11420
|
return [2 /*return*/];
|
|
11405
11421
|
_b.label = 1;
|
|
11406
11422
|
case 1:
|
|
11407
|
-
_b.trys.push([1,
|
|
11423
|
+
_b.trys.push([1, 36, , 37]);
|
|
11408
11424
|
_a = this.customData.type;
|
|
11409
11425
|
switch (_a) {
|
|
11410
11426
|
case IkasThemeCustomDataType.TEXT: return [3 /*break*/, 2];
|
|
11411
|
-
case IkasThemeCustomDataType.
|
|
11412
|
-
case IkasThemeCustomDataType.
|
|
11413
|
-
case IkasThemeCustomDataType.
|
|
11414
|
-
case IkasThemeCustomDataType.
|
|
11415
|
-
case IkasThemeCustomDataType.
|
|
11416
|
-
case IkasThemeCustomDataType.
|
|
11417
|
-
case IkasThemeCustomDataType.
|
|
11418
|
-
case IkasThemeCustomDataType.
|
|
11419
|
-
case IkasThemeCustomDataType.
|
|
11420
|
-
case IkasThemeCustomDataType.
|
|
11421
|
-
case IkasThemeCustomDataType.
|
|
11422
|
-
case IkasThemeCustomDataType.
|
|
11423
|
-
case IkasThemeCustomDataType.
|
|
11424
|
-
case IkasThemeCustomDataType.
|
|
11425
|
-
case IkasThemeCustomDataType.
|
|
11427
|
+
case IkasThemeCustomDataType.RICH_TEXT: return [3 /*break*/, 4];
|
|
11428
|
+
case IkasThemeCustomDataType.BOOLEAN: return [3 /*break*/, 6];
|
|
11429
|
+
case IkasThemeCustomDataType.BRAND_LIST: return [3 /*break*/, 8];
|
|
11430
|
+
case IkasThemeCustomDataType.BRAND: return [3 /*break*/, 10];
|
|
11431
|
+
case IkasThemeCustomDataType.CATEGORY_LIST: return [3 /*break*/, 12];
|
|
11432
|
+
case IkasThemeCustomDataType.CATEGORY: return [3 /*break*/, 14];
|
|
11433
|
+
case IkasThemeCustomDataType.COLOR: return [3 /*break*/, 16];
|
|
11434
|
+
case IkasThemeCustomDataType.IMAGE_LIST: return [3 /*break*/, 18];
|
|
11435
|
+
case IkasThemeCustomDataType.IMAGE: return [3 /*break*/, 20];
|
|
11436
|
+
case IkasThemeCustomDataType.LINK: return [3 /*break*/, 22];
|
|
11437
|
+
case IkasThemeCustomDataType.LIST_OF_LINK: return [3 /*break*/, 22];
|
|
11438
|
+
case IkasThemeCustomDataType.PRODUCT_DETAIL: return [3 /*break*/, 24];
|
|
11439
|
+
case IkasThemeCustomDataType.PRODUCT_LIST: return [3 /*break*/, 26];
|
|
11440
|
+
case IkasThemeCustomDataType.OBJECT: return [3 /*break*/, 28];
|
|
11441
|
+
case IkasThemeCustomDataType.DYNAMIC_LIST: return [3 /*break*/, 30];
|
|
11442
|
+
case IkasThemeCustomDataType.STATIC_LIST: return [3 /*break*/, 30];
|
|
11443
|
+
case IkasThemeCustomDataType.COMPONENT: return [3 /*break*/, 32];
|
|
11444
|
+
case IkasThemeCustomDataType.COMPONENT_LIST: return [3 /*break*/, 32];
|
|
11426
11445
|
}
|
|
11427
|
-
return [3 /*break*/,
|
|
11446
|
+
return [3 /*break*/, 34];
|
|
11428
11447
|
case 2: return [4 /*yield*/, this.getTextValue()];
|
|
11429
11448
|
case 3:
|
|
11430
11449
|
customDataValue = _b.sent();
|
|
11431
|
-
return [3 /*break*/,
|
|
11432
|
-
case 4: return [4 /*yield*/, this.
|
|
11450
|
+
return [3 /*break*/, 35];
|
|
11451
|
+
case 4: return [4 /*yield*/, this.getRichTextPropValue()];
|
|
11433
11452
|
case 5:
|
|
11434
11453
|
customDataValue = _b.sent();
|
|
11435
|
-
return [3 /*break*/,
|
|
11436
|
-
case 6: return [4 /*yield*/, this.
|
|
11454
|
+
return [3 /*break*/, 35];
|
|
11455
|
+
case 6: return [4 /*yield*/, this.getBooleanValue()];
|
|
11437
11456
|
case 7:
|
|
11438
11457
|
customDataValue = _b.sent();
|
|
11439
|
-
return [3 /*break*/,
|
|
11440
|
-
case 8: return [4 /*yield*/, this.
|
|
11458
|
+
return [3 /*break*/, 35];
|
|
11459
|
+
case 8: return [4 /*yield*/, this.getBrandListPropValue()];
|
|
11441
11460
|
case 9:
|
|
11442
11461
|
customDataValue = _b.sent();
|
|
11443
|
-
return [3 /*break*/,
|
|
11444
|
-
case 10: return [4 /*yield*/, this.
|
|
11462
|
+
return [3 /*break*/, 35];
|
|
11463
|
+
case 10: return [4 /*yield*/, this.getBrandPropValue()];
|
|
11445
11464
|
case 11:
|
|
11446
11465
|
customDataValue = _b.sent();
|
|
11447
|
-
return [3 /*break*/,
|
|
11448
|
-
case 12: return [4 /*yield*/, this.
|
|
11466
|
+
return [3 /*break*/, 35];
|
|
11467
|
+
case 12: return [4 /*yield*/, this.getCategoryListPropValue()];
|
|
11449
11468
|
case 13:
|
|
11450
11469
|
customDataValue = _b.sent();
|
|
11451
|
-
return [3 /*break*/,
|
|
11452
|
-
case 14: return [4 /*yield*/, this.
|
|
11470
|
+
return [3 /*break*/, 35];
|
|
11471
|
+
case 14: return [4 /*yield*/, this.getCategoryPropValue()];
|
|
11453
11472
|
case 15:
|
|
11454
11473
|
customDataValue = _b.sent();
|
|
11455
|
-
return [3 /*break*/,
|
|
11456
|
-
case 16: return [4 /*yield*/, this.
|
|
11474
|
+
return [3 /*break*/, 35];
|
|
11475
|
+
case 16: return [4 /*yield*/, this.getColorPropValue()];
|
|
11457
11476
|
case 17:
|
|
11458
11477
|
customDataValue = _b.sent();
|
|
11459
|
-
return [3 /*break*/,
|
|
11460
|
-
case 18: return [4 /*yield*/, this.
|
|
11478
|
+
return [3 /*break*/, 35];
|
|
11479
|
+
case 18: return [4 /*yield*/, this.getImageListPropValue()];
|
|
11461
11480
|
case 19:
|
|
11462
11481
|
customDataValue = _b.sent();
|
|
11463
|
-
return [3 /*break*/,
|
|
11464
|
-
case 20: return [4 /*yield*/, this.
|
|
11482
|
+
return [3 /*break*/, 35];
|
|
11483
|
+
case 20: return [4 /*yield*/, this.getImagePropValue()];
|
|
11465
11484
|
case 21:
|
|
11466
11485
|
customDataValue = _b.sent();
|
|
11467
|
-
return [3 /*break*/,
|
|
11468
|
-
case 22: return [4 /*yield*/, this.
|
|
11486
|
+
return [3 /*break*/, 35];
|
|
11487
|
+
case 22: return [4 /*yield*/, this.getLinkPropValue()];
|
|
11469
11488
|
case 23:
|
|
11470
11489
|
customDataValue = _b.sent();
|
|
11471
|
-
return [3 /*break*/,
|
|
11472
|
-
case 24: return [4 /*yield*/, this.
|
|
11490
|
+
return [3 /*break*/, 35];
|
|
11491
|
+
case 24: return [4 /*yield*/, this.getProductDetailPropValue()];
|
|
11473
11492
|
case 25:
|
|
11474
11493
|
customDataValue = _b.sent();
|
|
11475
|
-
return [3 /*break*/,
|
|
11476
|
-
case 26: return [4 /*yield*/, this.
|
|
11494
|
+
return [3 /*break*/, 35];
|
|
11495
|
+
case 26: return [4 /*yield*/, this.getProductListPropValue()];
|
|
11477
11496
|
case 27:
|
|
11478
11497
|
customDataValue = _b.sent();
|
|
11479
|
-
return [3 /*break*/,
|
|
11480
|
-
case 28: return [4 /*yield*/, this.
|
|
11498
|
+
return [3 /*break*/, 35];
|
|
11499
|
+
case 28: return [4 /*yield*/, this.getObjectValue()];
|
|
11481
11500
|
case 29:
|
|
11482
11501
|
customDataValue = _b.sent();
|
|
11483
|
-
return [3 /*break*/,
|
|
11484
|
-
case 30: return [
|
|
11485
|
-
case 31:
|
|
11486
|
-
|
|
11502
|
+
return [3 /*break*/, 35];
|
|
11503
|
+
case 30: return [4 /*yield*/, this.getArrayValue()];
|
|
11504
|
+
case 31:
|
|
11505
|
+
customDataValue = _b.sent();
|
|
11506
|
+
return [3 /*break*/, 35];
|
|
11507
|
+
case 32: return [4 /*yield*/, this.getComponentListValue()];
|
|
11508
|
+
case 33:
|
|
11509
|
+
customDataValue = _b.sent();
|
|
11510
|
+
return [3 /*break*/, 35];
|
|
11511
|
+
case 34: return [3 /*break*/, 35];
|
|
11512
|
+
case 35: return [3 /*break*/, 37];
|
|
11513
|
+
case 36:
|
|
11487
11514
|
_b.sent();
|
|
11488
11515
|
return [2 /*return*/];
|
|
11489
|
-
case
|
|
11516
|
+
case 37: return [2 /*return*/, JSON.parse(JSON.stringify(customDataValue))];
|
|
11490
11517
|
}
|
|
11491
11518
|
});
|
|
11492
11519
|
});
|
|
@@ -11599,6 +11626,24 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
11599
11626
|
});
|
|
11600
11627
|
});
|
|
11601
11628
|
};
|
|
11629
|
+
IkasCustomPropValueProvider.prototype.getRichTextPropValue = function () {
|
|
11630
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11631
|
+
var provider, value;
|
|
11632
|
+
return __generator(this, function (_a) {
|
|
11633
|
+
switch (_a.label) {
|
|
11634
|
+
case 0:
|
|
11635
|
+
provider = new IkasRichTextPropValueProvider(this.value);
|
|
11636
|
+
return [4 /*yield*/, provider.getValue()];
|
|
11637
|
+
case 1:
|
|
11638
|
+
value = _a.sent();
|
|
11639
|
+
return [2 /*return*/, {
|
|
11640
|
+
value: value,
|
|
11641
|
+
customData: this.customData,
|
|
11642
|
+
}];
|
|
11643
|
+
}
|
|
11644
|
+
});
|
|
11645
|
+
});
|
|
11646
|
+
};
|
|
11602
11647
|
IkasCustomPropValueProvider.prototype.getImageListPropValue = function () {
|
|
11603
11648
|
return __awaiter(this, void 0, void 0, function () {
|
|
11604
11649
|
var provider, value;
|
|
@@ -11725,7 +11770,7 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
11725
11770
|
if (nestedData.isRequired &&
|
|
11726
11771
|
(nestedValue === undefined || nestedValue === null))
|
|
11727
11772
|
throw new Error("Required data is missing");
|
|
11728
|
-
nestedProvider = new IkasCustomPropValueProvider(nestedValue, nestedData, this.theme, this.pageSpecificData);
|
|
11773
|
+
nestedProvider = new IkasCustomPropValueProvider(nestedValue, nestedData, this.theme, this.pageType, this.pageDataProvider, this.pageSpecificData);
|
|
11729
11774
|
return [4 /*yield*/, nestedProvider.getValue()];
|
|
11730
11775
|
case 2:
|
|
11731
11776
|
_itemValue = _b.sent();
|
|
@@ -11763,7 +11808,7 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
11763
11808
|
if (nestedData.isRequired &&
|
|
11764
11809
|
(itemValue === undefined || itemValue === null))
|
|
11765
11810
|
throw new Error("Required data is missing");
|
|
11766
|
-
provider = new IkasCustomPropValueProvider(itemValue, nestedData, this.theme, this.pageSpecificData);
|
|
11811
|
+
provider = new IkasCustomPropValueProvider(itemValue, nestedData, this.theme, this.pageType, this.pageDataProvider, this.pageSpecificData);
|
|
11767
11812
|
return [4 /*yield*/, provider.getValue()];
|
|
11768
11813
|
case 2:
|
|
11769
11814
|
_itemValue = _b.sent();
|
|
@@ -11785,6 +11830,28 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
11785
11830
|
});
|
|
11786
11831
|
});
|
|
11787
11832
|
};
|
|
11833
|
+
IkasCustomPropValueProvider.prototype.getComponentListValue = function () {
|
|
11834
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11835
|
+
var pageComponents;
|
|
11836
|
+
var _a;
|
|
11837
|
+
var _this = this;
|
|
11838
|
+
return __generator(this, function (_b) {
|
|
11839
|
+
switch (_b.label) {
|
|
11840
|
+
case 0:
|
|
11841
|
+
pageComponents = this.value
|
|
11842
|
+
? this.value.map(function (v) { return new IkasThemePageComponent(v); })
|
|
11843
|
+
: [];
|
|
11844
|
+
_a = {};
|
|
11845
|
+
return [4 /*yield*/, Promise.all(pageComponents.map(function (tp) {
|
|
11846
|
+
return _this.pageDataProvider.getPageComponentPropValues(tp);
|
|
11847
|
+
}))];
|
|
11848
|
+
case 1: return [2 /*return*/, (_a.value = _b.sent(),
|
|
11849
|
+
_a.customData = this.customData,
|
|
11850
|
+
_a)];
|
|
11851
|
+
}
|
|
11852
|
+
});
|
|
11853
|
+
});
|
|
11854
|
+
};
|
|
11788
11855
|
return IkasCustomPropValueProvider;
|
|
11789
11856
|
}());
|
|
11790
11857
|
|
|
@@ -11816,80 +11883,347 @@ var decodeBase64 = function (base64) {
|
|
|
11816
11883
|
return buffer.toString("ascii");
|
|
11817
11884
|
};
|
|
11818
11885
|
|
|
11819
|
-
var
|
|
11820
|
-
|
|
11821
|
-
|
|
11822
|
-
|
|
11823
|
-
|
|
11824
|
-
|
|
11825
|
-
|
|
11826
|
-
|
|
11827
|
-
|
|
11828
|
-
|
|
11829
|
-
|
|
11830
|
-
}
|
|
11831
|
-
Object.defineProperty(IkasPageDataProvider.prototype, "page", {
|
|
11832
|
-
get: function () {
|
|
11833
|
-
var _this = this;
|
|
11834
|
-
if (this.pageType === IkasThemePageType.CUSTOM) {
|
|
11835
|
-
var slug_1 = this.pageParams.slug;
|
|
11836
|
-
return this.theme.pages.find(function (page) { return page.type === IkasThemePageType.CUSTOM && page.slug === slug_1; });
|
|
11837
|
-
}
|
|
11838
|
-
return this.theme.pages.find(function (page) { return page.type === _this.pageType; });
|
|
11839
|
-
},
|
|
11840
|
-
enumerable: false,
|
|
11841
|
-
configurable: true
|
|
11842
|
-
});
|
|
11843
|
-
Object.defineProperty(IkasPageDataProvider.prototype, "nextPageData", {
|
|
11844
|
-
get: function () {
|
|
11845
|
-
return {
|
|
11846
|
-
props: {
|
|
11847
|
-
propValuesStr: JSON.stringify(this.pageComponentPropValues),
|
|
11848
|
-
pageSpecificDataStr: this.pageSpecificData
|
|
11849
|
-
? JSON.stringify(this.pageSpecificData || {})
|
|
11850
|
-
: "",
|
|
11851
|
-
page: toJS(this.page) || null,
|
|
11852
|
-
settingsStr: JSON.stringify(this.theme.settings || {}),
|
|
11853
|
-
merchantSettings: this.merchantSettings
|
|
11854
|
-
? JSON.stringify(this.merchantSettings)
|
|
11855
|
-
: null,
|
|
11856
|
-
configJson: IkasStorefrontConfig.getJson(),
|
|
11857
|
-
},
|
|
11858
|
-
};
|
|
11859
|
-
},
|
|
11860
|
-
enumerable: false,
|
|
11861
|
-
configurable: true
|
|
11886
|
+
var ThemeComponent = observer(function (_a) {
|
|
11887
|
+
var pageComponentPropValue = _a.pageComponentPropValue, index = _a.index, settings = _a.settings;
|
|
11888
|
+
var store = IkasStorefrontConfig.store, components = IkasStorefrontConfig.components;
|
|
11889
|
+
var pageComponent = pageComponentPropValue.pageComponent;
|
|
11890
|
+
var propValues = pageComponentPropValue.propValues;
|
|
11891
|
+
var hasNullValue = computed(function () {
|
|
11892
|
+
return Object.entries(propValues || {}).some(function (_a) {
|
|
11893
|
+
var _b;
|
|
11894
|
+
var propName = _a[0], propValue = _a[1];
|
|
11895
|
+
return (propValue === null || propValue === undefined) && ((_b = pageComponentPropValue.component.props.find(function (p) { return p.name === propName; })) === null || _b === void 0 ? void 0 : _b.isRequired);
|
|
11896
|
+
});
|
|
11862
11897
|
});
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
|
|
11868
|
-
|
|
11869
|
-
|
|
11870
|
-
|
|
11898
|
+
var Component = components[pageComponent.componentId];
|
|
11899
|
+
return (createElement("div", { id: index + "" }, hasNullValue.get() ? null : (createElement(Component, __assign({ key: pageComponent.id }, propValues, { settings: settings, store: store })))));
|
|
11900
|
+
});
|
|
11901
|
+
|
|
11902
|
+
var IkasPageHead = observer(function (_a) {
|
|
11903
|
+
var _b;
|
|
11904
|
+
var page = _a.page, pageTitle = _a.pageTitle, description = _a.description, pageSpecificDataStr = _a.pageSpecificDataStr, props = __rest(_a, ["page", "pageTitle", "description", "pageSpecificDataStr"]);
|
|
11905
|
+
var ogpMetas = [];
|
|
11906
|
+
var schemas = [];
|
|
11907
|
+
var isCanonicalLinkAdd = false;
|
|
11908
|
+
var canonicalHref = "";
|
|
11909
|
+
if (props.addOgpMetas) {
|
|
11910
|
+
ogpMetas.push({
|
|
11911
|
+
property: "og:type",
|
|
11912
|
+
content: "website",
|
|
11913
|
+
});
|
|
11914
|
+
if (typeof window !== "undefined") {
|
|
11915
|
+
ogpMetas.push({
|
|
11916
|
+
property: "og:site_name",
|
|
11917
|
+
content: "https://" + window.location.hostname,
|
|
11918
|
+
});
|
|
11919
|
+
}
|
|
11920
|
+
if (pageTitle) {
|
|
11921
|
+
ogpMetas.push({
|
|
11922
|
+
property: "og:title",
|
|
11923
|
+
content: pageTitle,
|
|
11924
|
+
});
|
|
11925
|
+
}
|
|
11926
|
+
if (description) {
|
|
11927
|
+
ogpMetas.push({
|
|
11928
|
+
property: "og:description",
|
|
11929
|
+
content: description,
|
|
11930
|
+
});
|
|
11931
|
+
}
|
|
11932
|
+
if (typeof window !== "undefined") {
|
|
11933
|
+
ogpMetas.push({
|
|
11934
|
+
property: "og:url",
|
|
11935
|
+
content: window.location.href,
|
|
11936
|
+
});
|
|
11937
|
+
}
|
|
11938
|
+
if (props.merchantSettings) {
|
|
11939
|
+
if (pageSpecificDataStr && (page === null || page === void 0 ? void 0 : page.type) === IkasThemePageType.PRODUCT) {
|
|
11940
|
+
var productDetailParsed = JSON.parse(pageSpecificDataStr);
|
|
11941
|
+
var productDetail = new IkasProductDetail(productDetailParsed.product, productDetailParsed.selectedVariantValues);
|
|
11942
|
+
if (productDetail.selectedVariant.mainImage) {
|
|
11943
|
+
ogpMetas.push({
|
|
11944
|
+
property: "og:image",
|
|
11945
|
+
content: (_b = productDetail.selectedVariant.mainImage) === null || _b === void 0 ? void 0 : _b.src,
|
|
11946
|
+
});
|
|
11947
|
+
}
|
|
11871
11948
|
}
|
|
11872
|
-
|
|
11873
|
-
|
|
11949
|
+
else {
|
|
11950
|
+
var merchantSettings = new IkasMerchantSettings(JSON.parse(props.merchantSettings));
|
|
11951
|
+
ogpMetas.push({
|
|
11952
|
+
property: "og:image",
|
|
11953
|
+
content: merchantSettings.logo.src,
|
|
11954
|
+
});
|
|
11874
11955
|
}
|
|
11875
|
-
|
|
11876
|
-
|
|
11956
|
+
}
|
|
11957
|
+
}
|
|
11958
|
+
if (props.merchantSettings) {
|
|
11959
|
+
// for schema.org
|
|
11960
|
+
var merchantSettings = new IkasMerchantSettings(JSON.parse(props.merchantSettings));
|
|
11961
|
+
var websiteSchema = createWebsiteSchema();
|
|
11962
|
+
var storeSchema = createStoreSchema(merchantSettings);
|
|
11963
|
+
schemas.push(websiteSchema);
|
|
11964
|
+
schemas.push(storeSchema);
|
|
11965
|
+
}
|
|
11966
|
+
if (pageSpecificDataStr && (page === null || page === void 0 ? void 0 : page.type) === IkasThemePageType.PRODUCT) {
|
|
11967
|
+
var productDetailParsed = JSON.parse(pageSpecificDataStr);
|
|
11968
|
+
var productDetail = new IkasProductDetail(productDetailParsed.product, productDetailParsed.selectedVariantValues);
|
|
11969
|
+
if (typeof window !== "undefined" && productDetail.product.hasVariant) {
|
|
11970
|
+
isCanonicalLinkAdd =
|
|
11971
|
+
window.location.pathname !== productDetail.product.href;
|
|
11972
|
+
canonicalHref =
|
|
11973
|
+
"https://" + window.location.hostname + productDetail.product.href;
|
|
11974
|
+
}
|
|
11975
|
+
var schema = createProductSchema(productDetail);
|
|
11976
|
+
if (schema)
|
|
11977
|
+
schemas.push(schema);
|
|
11978
|
+
}
|
|
11979
|
+
if (pageSpecificDataStr && (page === null || page === void 0 ? void 0 : page.type) === IkasThemePageType.CATEGORY) {
|
|
11980
|
+
var categorySchema = createCategorySchema(pageSpecificDataStr);
|
|
11981
|
+
if (categorySchema)
|
|
11982
|
+
schemas.push(categorySchema);
|
|
11983
|
+
var categoryBreadcrumbSchema = createCategoryBreadcrumbSchema(pageSpecificDataStr);
|
|
11984
|
+
if (categoryBreadcrumbSchema)
|
|
11985
|
+
schemas.push(categoryBreadcrumbSchema);
|
|
11986
|
+
}
|
|
11987
|
+
return (createElement(Head, null,
|
|
11988
|
+
createElement("title", null, pageTitle || ""),
|
|
11989
|
+
createElement("meta", { name: "description", content: description || "" }),
|
|
11990
|
+
isCanonicalLinkAdd && createElement("link", { rel: "canonical", href: canonicalHref }),
|
|
11991
|
+
!!props.addOgpMetas &&
|
|
11992
|
+
ogpMetas.map(function (ogpMeta, index) { return (createElement("meta", { key: ogpMeta.content + "-" + index, property: ogpMeta.property, content: ogpMeta.content })); }),
|
|
11993
|
+
!!schemas.length &&
|
|
11994
|
+
schemas.map(function (schema, index) { return (createElement("script", { key: index, type: "application/ld+json", dangerouslySetInnerHTML: {
|
|
11995
|
+
__html: JSON.stringify(schema),
|
|
11996
|
+
} })); })));
|
|
11997
|
+
});
|
|
11998
|
+
function createWebsiteSchema() {
|
|
11999
|
+
var _a;
|
|
12000
|
+
var hostname = "";
|
|
12001
|
+
if (typeof window !== "undefined") {
|
|
12002
|
+
hostname = (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.hostname;
|
|
12003
|
+
}
|
|
12004
|
+
return {
|
|
12005
|
+
"@context": "https://schema.org",
|
|
12006
|
+
"@type": "Website",
|
|
12007
|
+
url: "https://" + hostname,
|
|
12008
|
+
};
|
|
12009
|
+
}
|
|
12010
|
+
function createStoreSchema(merchantSettings) {
|
|
12011
|
+
var _a, _b;
|
|
12012
|
+
var hostname = "";
|
|
12013
|
+
if (typeof window !== "undefined") {
|
|
12014
|
+
hostname = (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.hostname;
|
|
12015
|
+
}
|
|
12016
|
+
return {
|
|
12017
|
+
"@context": "https://schema.org",
|
|
12018
|
+
"@type": "Store",
|
|
12019
|
+
name: merchantSettings === null || merchantSettings === void 0 ? void 0 : merchantSettings.merchantName,
|
|
12020
|
+
logo: (_b = merchantSettings === null || merchantSettings === void 0 ? void 0 : merchantSettings.logo) === null || _b === void 0 ? void 0 : _b.src,
|
|
12021
|
+
url: "https://" + hostname,
|
|
12022
|
+
};
|
|
12023
|
+
}
|
|
12024
|
+
function createProductSchema(productDetail) {
|
|
12025
|
+
var _a, _b;
|
|
12026
|
+
try {
|
|
12027
|
+
var isBrowser = typeof window !== "undefined";
|
|
12028
|
+
if (isBrowser) {
|
|
12029
|
+
var urlParams = new URLSearchParams(window.location.search);
|
|
12030
|
+
var vid_1 = urlParams.get("vid");
|
|
12031
|
+
if (vid_1) {
|
|
12032
|
+
var variant = productDetail.product.variants.find(function (v) { return v.id === vid_1; });
|
|
12033
|
+
if (variant) {
|
|
12034
|
+
productDetail.selectedVariantValues = variant.variantValues;
|
|
12035
|
+
}
|
|
11877
12036
|
}
|
|
11878
|
-
|
|
11879
|
-
|
|
11880
|
-
|
|
11881
|
-
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
|
|
11888
|
-
|
|
11889
|
-
|
|
11890
|
-
|
|
11891
|
-
|
|
11892
|
-
|
|
12037
|
+
}
|
|
12038
|
+
var productUrl = isBrowser
|
|
12039
|
+
? "https://" + window.location.hostname + productDetail.href
|
|
12040
|
+
: "";
|
|
12041
|
+
return {
|
|
12042
|
+
"@context": "https://schema.org/",
|
|
12043
|
+
"@type": "Product",
|
|
12044
|
+
name: productDetail.product.name,
|
|
12045
|
+
description: (_a = productDetail.product.metaData) === null || _a === void 0 ? void 0 : _a.description,
|
|
12046
|
+
image: productDetail.selectedVariant.images.map(function (i) { return i.src; }),
|
|
12047
|
+
productId: productDetail.selectedVariant.id,
|
|
12048
|
+
sku: productDetail.selectedVariant.sku,
|
|
12049
|
+
mpn: productDetail.selectedVariant.barcodeList.length
|
|
12050
|
+
? productDetail.selectedVariant.barcodeList[0]
|
|
12051
|
+
: "",
|
|
12052
|
+
brand: {
|
|
12053
|
+
"@type": "Brand",
|
|
12054
|
+
name: (_b = productDetail.product.brand) === null || _b === void 0 ? void 0 : _b.name,
|
|
12055
|
+
},
|
|
12056
|
+
offers: {
|
|
12057
|
+
"@type": "Offer",
|
|
12058
|
+
url: productUrl,
|
|
12059
|
+
priceCurrency: productDetail.selectedVariant.price.currency || "TRY",
|
|
12060
|
+
price: productDetail.selectedVariant.price.finalPrice,
|
|
12061
|
+
priceValidUntil: "",
|
|
12062
|
+
itemCondition: "https://schema.org/NewCondition",
|
|
12063
|
+
availability: productDetail.selectedVariant.stock > 0
|
|
12064
|
+
? "https://schema.org/InStock"
|
|
12065
|
+
: "https://schema.org/OutOfStock",
|
|
12066
|
+
},
|
|
12067
|
+
};
|
|
12068
|
+
}
|
|
12069
|
+
catch (err) { }
|
|
12070
|
+
}
|
|
12071
|
+
function createCategorySchema(pageSpecificDataStr) {
|
|
12072
|
+
var _a, _b, _c;
|
|
12073
|
+
try {
|
|
12074
|
+
var categoryParsed = JSON.parse(pageSpecificDataStr);
|
|
12075
|
+
var category = new IkasCategory(categoryParsed);
|
|
12076
|
+
var categoryUrl = typeof window !== undefined
|
|
12077
|
+
? "https://" + window.location.hostname + category.href
|
|
12078
|
+
: "";
|
|
12079
|
+
return {
|
|
12080
|
+
"@context": "http://schema.org",
|
|
12081
|
+
"@type": "CollectionPage",
|
|
12082
|
+
url: categoryUrl,
|
|
12083
|
+
name: (_a = category.metaData) === null || _a === void 0 ? void 0 : _a.pageTitle,
|
|
12084
|
+
description: (_b = category.metaData) === null || _b === void 0 ? void 0 : _b.description,
|
|
12085
|
+
image: (_c = category.image) === null || _c === void 0 ? void 0 : _c.src,
|
|
12086
|
+
};
|
|
12087
|
+
}
|
|
12088
|
+
catch (_d) { }
|
|
12089
|
+
}
|
|
12090
|
+
function createCategoryBreadcrumbSchema(pageSpecificDataStr) {
|
|
12091
|
+
try {
|
|
12092
|
+
var categoryParsed = JSON.parse(pageSpecificDataStr);
|
|
12093
|
+
var category = new IkasCategory(categoryParsed);
|
|
12094
|
+
return {
|
|
12095
|
+
"@context": "http://schema.org",
|
|
12096
|
+
"@type": "BreadcrumbList",
|
|
12097
|
+
itemListElement: category.path.map(function (categoryPath, index) { return ({
|
|
12098
|
+
"@type": "ListItem",
|
|
12099
|
+
position: index + 1,
|
|
12100
|
+
name: categoryPath.name,
|
|
12101
|
+
item: typeof window !== undefined
|
|
12102
|
+
? "https://" + window.location.hostname + categoryPath.href
|
|
12103
|
+
: "",
|
|
12104
|
+
}); }),
|
|
12105
|
+
};
|
|
12106
|
+
}
|
|
12107
|
+
catch (_a) { }
|
|
12108
|
+
}
|
|
12109
|
+
|
|
12110
|
+
var IkasPage = observer(function (_a) {
|
|
12111
|
+
var propValues = _a.propValues, page = _a.page, pageSpecificDataStr = _a.pageSpecificDataStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings, addOgpMetas = _a.addOgpMetas;
|
|
12112
|
+
var store = IkasStorefrontConfig.store;
|
|
12113
|
+
var settings = useState(new IkasThemeSettings(JSON.parse(settingsStr)))[0];
|
|
12114
|
+
if (page) {
|
|
12115
|
+
store.currentPageType = page.type;
|
|
12116
|
+
}
|
|
12117
|
+
useEffect(function () {
|
|
12118
|
+
//@ts-ignore
|
|
12119
|
+
store.setSettings(settingsStr);
|
|
12120
|
+
//@ts-ignore
|
|
12121
|
+
store.cartStore.getCart();
|
|
12122
|
+
store.checkLocalization();
|
|
12123
|
+
}, []);
|
|
12124
|
+
var headerComponentPropValue = propValues.find(function (pv) { return pv.component.isHeader; });
|
|
12125
|
+
var footerComponentPropValue = propValues.find(function (pv) { return pv.component.isFooter; });
|
|
12126
|
+
var others = propValues.filter(function (pv) { return !pv.component.isHeader && !pv.component.isFooter; }) || [];
|
|
12127
|
+
if (!page)
|
|
12128
|
+
return null;
|
|
12129
|
+
return (createElement(Fragment, null,
|
|
12130
|
+
createElement(IkasPageHead, { page: page, pageTitle: page.pageTitle, description: page.description, pageSpecificDataStr: pageSpecificDataStr, merchantSettings: merchantSettings, addOgpMetas: addOgpMetas }),
|
|
12131
|
+
createElement("div", { style: pageStyle },
|
|
12132
|
+
createElement("div", null,
|
|
12133
|
+
headerComponentPropValue &&
|
|
12134
|
+
renderComponent(headerComponentPropValue, settings, -1),
|
|
12135
|
+
others.map(function (pageComponentPropValue, index) {
|
|
12136
|
+
return renderComponent(pageComponentPropValue, settings, index);
|
|
12137
|
+
})),
|
|
12138
|
+
footerComponentPropValue &&
|
|
12139
|
+
renderComponent(footerComponentPropValue, settings, -1))));
|
|
12140
|
+
});
|
|
12141
|
+
var renderComponent = function (pageComponentPropValue, settings, index) {
|
|
12142
|
+
return (createElement(ThemeComponent, { key: pageComponentPropValue.pageComponent.id, index: index, pageComponentPropValue: pageComponentPropValue, settings: settings }));
|
|
12143
|
+
};
|
|
12144
|
+
var pageStyle = {
|
|
12145
|
+
position: "relative",
|
|
12146
|
+
minHeight: "100vh",
|
|
12147
|
+
width: "100vw",
|
|
12148
|
+
display: "flex",
|
|
12149
|
+
flexDirection: "column",
|
|
12150
|
+
justifyContent: "space-between",
|
|
12151
|
+
};
|
|
12152
|
+
|
|
12153
|
+
var IkasPageDataProvider = /** @class */ (function () {
|
|
12154
|
+
function IkasPageDataProvider(theme, pageParams, pageType) {
|
|
12155
|
+
this.pageType = null;
|
|
12156
|
+
this.pageParams = {};
|
|
12157
|
+
this.pageComponentPropValues = [];
|
|
12158
|
+
this.pageSpecificData = null;
|
|
12159
|
+
this.merchantSettings = null;
|
|
12160
|
+
this.theme = new IkasTheme(theme);
|
|
12161
|
+
this.pageParams = pageParams || {};
|
|
12162
|
+
this.pageType = pageType;
|
|
12163
|
+
makeAutoObservable(this);
|
|
12164
|
+
}
|
|
12165
|
+
Object.defineProperty(IkasPageDataProvider.prototype, "page", {
|
|
12166
|
+
get: function () {
|
|
12167
|
+
var _this = this;
|
|
12168
|
+
if (this.pageType === IkasThemePageType.CUSTOM) {
|
|
12169
|
+
var slug_1 = this.pageParams.slug;
|
|
12170
|
+
return this.theme.pages.find(function (page) { return page.type === IkasThemePageType.CUSTOM && page.slug === slug_1; });
|
|
12171
|
+
}
|
|
12172
|
+
return this.theme.pages.find(function (page) { return page.type === _this.pageType; });
|
|
12173
|
+
},
|
|
12174
|
+
enumerable: false,
|
|
12175
|
+
configurable: true
|
|
12176
|
+
});
|
|
12177
|
+
Object.defineProperty(IkasPageDataProvider.prototype, "nextPageData", {
|
|
12178
|
+
get: function () {
|
|
12179
|
+
return {
|
|
12180
|
+
props: {
|
|
12181
|
+
propValuesStr: JSON.stringify(this.pageComponentPropValues),
|
|
12182
|
+
pageSpecificDataStr: this.pageSpecificData
|
|
12183
|
+
? JSON.stringify(this.pageSpecificData || {})
|
|
12184
|
+
: "",
|
|
12185
|
+
page: toJS(this.page) || null,
|
|
12186
|
+
settingsStr: JSON.stringify(this.theme.settings || {}),
|
|
12187
|
+
merchantSettings: this.merchantSettings
|
|
12188
|
+
? JSON.stringify(this.merchantSettings)
|
|
12189
|
+
: null,
|
|
12190
|
+
configJson: IkasStorefrontConfig.getJson(),
|
|
12191
|
+
},
|
|
12192
|
+
};
|
|
12193
|
+
},
|
|
12194
|
+
enumerable: false,
|
|
12195
|
+
configurable: true
|
|
12196
|
+
});
|
|
12197
|
+
Object.defineProperty(IkasPageDataProvider.prototype, "specification", {
|
|
12198
|
+
get: function () {
|
|
12199
|
+
var _this = this;
|
|
12200
|
+
var _a, _b, _c;
|
|
12201
|
+
var selectedPage = this.page;
|
|
12202
|
+
var specification;
|
|
12203
|
+
if ((selectedPage === null || selectedPage === void 0 ? void 0 : selectedPage.type) === IkasThemePageType.PRODUCT) {
|
|
12204
|
+
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); });
|
|
12205
|
+
}
|
|
12206
|
+
if ((selectedPage === null || selectedPage === void 0 ? void 0 : selectedPage.type) === IkasThemePageType.CATEGORY) {
|
|
12207
|
+
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); });
|
|
12208
|
+
}
|
|
12209
|
+
if ((selectedPage === null || selectedPage === void 0 ? void 0 : selectedPage.type) === IkasThemePageType.BRAND) {
|
|
12210
|
+
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); });
|
|
12211
|
+
}
|
|
12212
|
+
return specification;
|
|
12213
|
+
},
|
|
12214
|
+
enumerable: false,
|
|
12215
|
+
configurable: true
|
|
12216
|
+
});
|
|
12217
|
+
Object.defineProperty(IkasPageDataProvider.prototype, "pageComponents", {
|
|
12218
|
+
get: function () {
|
|
12219
|
+
var _a;
|
|
12220
|
+
if (this.specification)
|
|
12221
|
+
return this.specification.components;
|
|
12222
|
+
return ((_a = this.page) === null || _a === void 0 ? void 0 : _a.components) || [];
|
|
12223
|
+
},
|
|
12224
|
+
enumerable: false,
|
|
12225
|
+
configurable: true
|
|
12226
|
+
});
|
|
11893
12227
|
Object.defineProperty(IkasPageDataProvider.prototype, "isStaticPage", {
|
|
11894
12228
|
get: function () {
|
|
11895
12229
|
var staticPageTypes = [
|
|
@@ -12071,6 +12405,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12071
12405
|
return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
12072
12406
|
productIdList: [metaDataResponse.metaData.targetId],
|
|
12073
12407
|
priceListId: IkasStorefrontConfig.priceListId,
|
|
12408
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
12074
12409
|
})];
|
|
12075
12410
|
case 2:
|
|
12076
12411
|
productsResponse = _b.sent();
|
|
@@ -12138,60 +12473,87 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12138
12473
|
};
|
|
12139
12474
|
IkasPageDataProvider.prototype.getPageComponentPropValue = function (pageComponent, prop) {
|
|
12140
12475
|
return __awaiter(this, void 0, void 0, function () {
|
|
12141
|
-
var propValueProvider, propValue, customData;
|
|
12142
|
-
|
|
12143
|
-
|
|
12476
|
+
var propValueProvider, propValue, _a, customData, pageComponents;
|
|
12477
|
+
var _this = this;
|
|
12478
|
+
return __generator(this, function (_b) {
|
|
12479
|
+
switch (_b.label) {
|
|
12144
12480
|
case 0:
|
|
12145
12481
|
propValue = pageComponent.propValues[prop.name];
|
|
12146
12482
|
if (propValue === null || propValue === undefined)
|
|
12147
12483
|
return [2 /*return*/, null];
|
|
12148
|
-
|
|
12149
|
-
|
|
12150
|
-
|
|
12151
|
-
|
|
12152
|
-
case IkasThemeComponentPropType.BOOLEAN:
|
|
12153
|
-
|
|
12154
|
-
|
|
12155
|
-
case IkasThemeComponentPropType.
|
|
12156
|
-
|
|
12157
|
-
|
|
12158
|
-
case IkasThemeComponentPropType.
|
|
12159
|
-
|
|
12160
|
-
|
|
12161
|
-
case IkasThemeComponentPropType.
|
|
12162
|
-
|
|
12163
|
-
|
|
12164
|
-
case IkasThemeComponentPropType.
|
|
12165
|
-
|
|
12166
|
-
|
|
12167
|
-
case IkasThemeComponentPropType.PRODUCT_LIST:
|
|
12168
|
-
propValueProvider = new IkasProductListPropValueProvider(this.pageType, propValue, this.pageParams, this.pageSpecificData);
|
|
12169
|
-
break;
|
|
12170
|
-
case IkasThemeComponentPropType.PRODUCT_DETAIL:
|
|
12171
|
-
propValueProvider = new IkasProductDetailPropValueProvider(propValue, this.pageSpecificData);
|
|
12172
|
-
break;
|
|
12173
|
-
case IkasThemeComponentPropType.CATEGORY:
|
|
12174
|
-
propValueProvider = new IkasCategoryPropValueProvider(propValue, this.pageSpecificData);
|
|
12175
|
-
break;
|
|
12176
|
-
case IkasThemeComponentPropType.CATEGORY_LIST:
|
|
12177
|
-
propValueProvider = new IkasCategoryListPropValueProvider(propValue);
|
|
12178
|
-
break;
|
|
12179
|
-
case IkasThemeComponentPropType.LINK:
|
|
12180
|
-
case IkasThemeComponentPropType.LIST_OF_LINK:
|
|
12181
|
-
propValueProvider = new IkasLinkPropValueProvider(propValue, this.theme);
|
|
12182
|
-
break;
|
|
12183
|
-
case IkasThemeComponentPropType.COLOR:
|
|
12184
|
-
propValueProvider = new IkasColorPropValueProvider(propValue);
|
|
12185
|
-
break;
|
|
12186
|
-
case IkasThemeComponentPropType.CUSTOM:
|
|
12187
|
-
customData = this.theme.customData.find(function (cd) { return cd.id === prop.customDataId; });
|
|
12188
|
-
if (!customData)
|
|
12189
|
-
return [2 /*return*/];
|
|
12190
|
-
propValueProvider = new IkasCustomPropValueProvider(propValue, customData, this.theme, this.pageType, this.pageSpecificData, this.pageParams);
|
|
12191
|
-
break;
|
|
12484
|
+
_a = prop.type;
|
|
12485
|
+
switch (_a) {
|
|
12486
|
+
case IkasThemeComponentPropType.TEXT: return [3 /*break*/, 1];
|
|
12487
|
+
case IkasThemeComponentPropType.RICH_TEXT: return [3 /*break*/, 2];
|
|
12488
|
+
case IkasThemeComponentPropType.BOOLEAN: return [3 /*break*/, 3];
|
|
12489
|
+
case IkasThemeComponentPropType.IMAGE: return [3 /*break*/, 4];
|
|
12490
|
+
case IkasThemeComponentPropType.IMAGE_LIST: return [3 /*break*/, 5];
|
|
12491
|
+
case IkasThemeComponentPropType.BRAND: return [3 /*break*/, 6];
|
|
12492
|
+
case IkasThemeComponentPropType.BRAND_LIST: return [3 /*break*/, 7];
|
|
12493
|
+
case IkasThemeComponentPropType.PRODUCT_LIST: return [3 /*break*/, 8];
|
|
12494
|
+
case IkasThemeComponentPropType.PRODUCT_DETAIL: return [3 /*break*/, 9];
|
|
12495
|
+
case IkasThemeComponentPropType.CATEGORY: return [3 /*break*/, 10];
|
|
12496
|
+
case IkasThemeComponentPropType.CATEGORY_LIST: return [3 /*break*/, 11];
|
|
12497
|
+
case IkasThemeComponentPropType.LINK: return [3 /*break*/, 12];
|
|
12498
|
+
case IkasThemeComponentPropType.LIST_OF_LINK: return [3 /*break*/, 12];
|
|
12499
|
+
case IkasThemeComponentPropType.COLOR: return [3 /*break*/, 13];
|
|
12500
|
+
case IkasThemeComponentPropType.CUSTOM: return [3 /*break*/, 14];
|
|
12501
|
+
case IkasThemeComponentPropType.COMPONENT: return [3 /*break*/, 15];
|
|
12502
|
+
case IkasThemeComponentPropType.COMPONENT_LIST: return [3 /*break*/, 15];
|
|
12192
12503
|
}
|
|
12193
|
-
return [
|
|
12194
|
-
case 1:
|
|
12504
|
+
return [3 /*break*/, 17];
|
|
12505
|
+
case 1:
|
|
12506
|
+
propValueProvider = new IkasTextPropValueProvider(propValue);
|
|
12507
|
+
return [3 /*break*/, 18];
|
|
12508
|
+
case 2:
|
|
12509
|
+
propValueProvider = new IkasRichTextPropValueProvider(propValue);
|
|
12510
|
+
return [3 /*break*/, 18];
|
|
12511
|
+
case 3:
|
|
12512
|
+
propValueProvider = new IkasBooleanPropValueProvider(propValue);
|
|
12513
|
+
return [3 /*break*/, 18];
|
|
12514
|
+
case 4:
|
|
12515
|
+
propValueProvider = new IkasImagePropValueProvider(propValue);
|
|
12516
|
+
return [3 /*break*/, 18];
|
|
12517
|
+
case 5:
|
|
12518
|
+
propValueProvider = new IkasImageListPropValueProvider(propValue);
|
|
12519
|
+
return [3 /*break*/, 18];
|
|
12520
|
+
case 6:
|
|
12521
|
+
propValueProvider = new IkasBrandPropValueProvider(propValue, this.pageSpecificData);
|
|
12522
|
+
return [3 /*break*/, 18];
|
|
12523
|
+
case 7:
|
|
12524
|
+
propValueProvider = new IkasBrandListPropValueProvider(propValue);
|
|
12525
|
+
return [3 /*break*/, 18];
|
|
12526
|
+
case 8:
|
|
12527
|
+
propValueProvider = new IkasProductListPropValueProvider(this.pageType, propValue, this.pageParams, this.pageSpecificData);
|
|
12528
|
+
return [3 /*break*/, 18];
|
|
12529
|
+
case 9:
|
|
12530
|
+
propValueProvider = new IkasProductDetailPropValueProvider(propValue, this.pageSpecificData);
|
|
12531
|
+
return [3 /*break*/, 18];
|
|
12532
|
+
case 10:
|
|
12533
|
+
propValueProvider = new IkasCategoryPropValueProvider(propValue, this.pageSpecificData);
|
|
12534
|
+
return [3 /*break*/, 18];
|
|
12535
|
+
case 11:
|
|
12536
|
+
propValueProvider = new IkasCategoryListPropValueProvider(propValue);
|
|
12537
|
+
return [3 /*break*/, 18];
|
|
12538
|
+
case 12:
|
|
12539
|
+
propValueProvider = new IkasLinkPropValueProvider(propValue, this.theme);
|
|
12540
|
+
return [3 /*break*/, 18];
|
|
12541
|
+
case 13:
|
|
12542
|
+
propValueProvider = new IkasColorPropValueProvider(propValue);
|
|
12543
|
+
return [3 /*break*/, 18];
|
|
12544
|
+
case 14:
|
|
12545
|
+
customData = this.theme.customData.find(function (cd) { return cd.id === prop.customDataId; });
|
|
12546
|
+
if (!customData)
|
|
12547
|
+
return [2 /*return*/];
|
|
12548
|
+
propValueProvider = new IkasCustomPropValueProvider(propValue, customData, this.theme, this.pageType, this, this.pageSpecificData, this.pageParams);
|
|
12549
|
+
return [3 /*break*/, 18];
|
|
12550
|
+
case 15:
|
|
12551
|
+
pageComponents = propValue;
|
|
12552
|
+
return [4 /*yield*/, Promise.all(pageComponents.map(function (tp) { return _this.getPageComponentPropValues(tp); }))];
|
|
12553
|
+
case 16: return [2 /*return*/, _b.sent()];
|
|
12554
|
+
case 17: return [3 /*break*/, 18];
|
|
12555
|
+
case 18: return [4 /*yield*/, (propValueProvider === null || propValueProvider === void 0 ? void 0 : propValueProvider.getValue())];
|
|
12556
|
+
case 19: return [2 /*return*/, _b.sent()];
|
|
12195
12557
|
}
|
|
12196
12558
|
});
|
|
12197
12559
|
});
|
|
@@ -12205,7 +12567,8 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12205
12567
|
IkasPageDataProvider.isServer = function () {
|
|
12206
12568
|
return typeof window === "undefined";
|
|
12207
12569
|
};
|
|
12208
|
-
IkasPageDataProvider.initPropValues = function (propValuesStr, router, isBrowser) {
|
|
12570
|
+
IkasPageDataProvider.initPropValues = function (propValuesStr, router, settingsStr, isBrowser) {
|
|
12571
|
+
var settings = new IkasThemeSettings(JSON.parse(settingsStr));
|
|
12209
12572
|
var pageComponentPropValues = JSON.parse(propValuesStr).map(function (v) { return ({
|
|
12210
12573
|
pageComponent: new IkasThemePageComponent(v.pageComponent),
|
|
12211
12574
|
component: new IkasThemeComponent(v.component),
|
|
@@ -12246,8 +12609,14 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12246
12609
|
case IkasThemeComponentPropType.LIST_OF_LINK:
|
|
12247
12610
|
IkasPageDataProvider.initLinkPropValue(prop, propValue, pageComponentPropValue);
|
|
12248
12611
|
break;
|
|
12612
|
+
case IkasThemeComponentPropType.COMPONENT:
|
|
12613
|
+
IkasPageDataProvider.initComponentPropValue(prop, propValue, pageComponentPropValue, router, settings, isBrowser);
|
|
12614
|
+
break;
|
|
12615
|
+
case IkasThemeComponentPropType.COMPONENT_LIST:
|
|
12616
|
+
IkasPageDataProvider.initComponentListPropValue(prop, propValue, pageComponentPropValue, router, settings, isBrowser);
|
|
12617
|
+
break;
|
|
12249
12618
|
case IkasThemeComponentPropType.CUSTOM:
|
|
12250
|
-
IkasPageDataProvider.initCustomDataPropValue(prop, propValue, pageComponentPropValue, router, isBrowser);
|
|
12619
|
+
IkasPageDataProvider.initCustomDataPropValue(prop, propValue, pageComponentPropValue, router, settings, isBrowser);
|
|
12251
12620
|
break;
|
|
12252
12621
|
}
|
|
12253
12622
|
});
|
|
@@ -12329,14 +12698,14 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12329
12698
|
IkasPageDataProvider._initImageListPropValue = function (propValue) {
|
|
12330
12699
|
return propValue.map(function (i) { return new IkasImage(i.id); });
|
|
12331
12700
|
};
|
|
12332
|
-
IkasPageDataProvider.initCustomDataPropValue = function (prop, customDataValue, pageComponentPropValue, router, isBrowser) {
|
|
12701
|
+
IkasPageDataProvider.initCustomDataPropValue = function (prop, customDataValue, pageComponentPropValue, router, settings, isBrowser) {
|
|
12333
12702
|
if (!customDataValue ||
|
|
12334
12703
|
!customDataValue.value ||
|
|
12335
12704
|
!customDataValue.customData)
|
|
12336
12705
|
return;
|
|
12337
|
-
pageComponentPropValue.propValues[prop.name] = this._initCustomDataPropValue(customDataValue, customDataValue.customData, router, isBrowser);
|
|
12706
|
+
pageComponentPropValue.propValues[prop.name] = this._initCustomDataPropValue(customDataValue, customDataValue.customData, router, settings, isBrowser);
|
|
12338
12707
|
};
|
|
12339
|
-
IkasPageDataProvider._initCustomDataPropValue = function (customDataValue, customData, router, isBrowser) {
|
|
12708
|
+
IkasPageDataProvider._initCustomDataPropValue = function (customDataValue, customData, router, settings, isBrowser) {
|
|
12340
12709
|
var _this = this;
|
|
12341
12710
|
if (!customDataValue)
|
|
12342
12711
|
return null;
|
|
@@ -12367,7 +12736,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12367
12736
|
for (var _i = 0, _a = customData.nestedData || []; _i < _a.length; _i++) {
|
|
12368
12737
|
var nestedCustomData = _a[_i];
|
|
12369
12738
|
var value = propValue[nestedCustomData.key];
|
|
12370
|
-
objectValue[nestedCustomData.key] = this._initCustomDataPropValue(value, nestedCustomData, router, isBrowser);
|
|
12739
|
+
objectValue[nestedCustomData.key] = this._initCustomDataPropValue(value, nestedCustomData, router, settings, isBrowser);
|
|
12371
12740
|
}
|
|
12372
12741
|
return objectValue;
|
|
12373
12742
|
case IkasThemeCustomDataType.DYNAMIC_LIST:
|
|
@@ -12378,17 +12747,51 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12378
12747
|
var listValue_1 = [];
|
|
12379
12748
|
var nestedCustomData_1 = customData.nestedData[0];
|
|
12380
12749
|
propValue.forEach(function (itemValue) {
|
|
12381
|
-
listValue_1.push(_this._initCustomDataPropValue(itemValue, nestedCustomData_1, router, isBrowser));
|
|
12750
|
+
listValue_1.push(_this._initCustomDataPropValue(itemValue, nestedCustomData_1, router, settings, isBrowser));
|
|
12382
12751
|
});
|
|
12383
12752
|
return listValue_1;
|
|
12384
12753
|
}
|
|
12385
12754
|
catch (err) {
|
|
12386
12755
|
return [];
|
|
12387
12756
|
}
|
|
12757
|
+
case IkasThemeCustomDataType.COMPONENT:
|
|
12758
|
+
return this._initComponentPropValue(propValue, router, settings, isBrowser);
|
|
12759
|
+
case IkasThemeCustomDataType.COMPONENT_LIST:
|
|
12760
|
+
return this._initComponentListPropValue(propValue, router, settings, isBrowser);
|
|
12388
12761
|
default:
|
|
12389
12762
|
return propValue;
|
|
12390
12763
|
}
|
|
12391
12764
|
};
|
|
12765
|
+
IkasPageDataProvider.initComponentPropValue = function (prop, propValue, pageComponentPropValue, router, settings, isBrowser) {
|
|
12766
|
+
pageComponentPropValue.propValues[prop.name] = this._initComponentPropValue(propValue, router, settings, isBrowser);
|
|
12767
|
+
};
|
|
12768
|
+
IkasPageDataProvider._initComponentPropValue = function (propValue, router, settings, isBrowser) {
|
|
12769
|
+
var pValue = propValue.length ? propValue[0] : undefined;
|
|
12770
|
+
if (!pValue)
|
|
12771
|
+
return;
|
|
12772
|
+
var pageComponentPropValue = new IkasPageComponentPropValue(pValue);
|
|
12773
|
+
var initializedPageComponentPropValues = this.initPropValues(JSON.stringify([pageComponentPropValue]), router, JSON.stringify(settings), isBrowser);
|
|
12774
|
+
if (!initializedPageComponentPropValues.length)
|
|
12775
|
+
return;
|
|
12776
|
+
return new IkasComponentRenderer(function () {
|
|
12777
|
+
return renderComponent(initializedPageComponentPropValues[0], settings, -10);
|
|
12778
|
+
});
|
|
12779
|
+
};
|
|
12780
|
+
IkasPageDataProvider.initComponentListPropValue = function (prop, propValue, pageComponentPropValue, router, settings, isBrowser) {
|
|
12781
|
+
pageComponentPropValue.propValues[prop.name] = this._initComponentListPropValue(propValue, router, settings, isBrowser);
|
|
12782
|
+
};
|
|
12783
|
+
IkasPageDataProvider._initComponentListPropValue = function (propValue, router, settings, isBrowser) {
|
|
12784
|
+
var _this = this;
|
|
12785
|
+
if (propValue && propValue.length)
|
|
12786
|
+
return propValue.map(function (p) {
|
|
12787
|
+
var pageComponentPropValue = new IkasPageComponentPropValue(p);
|
|
12788
|
+
var initializedPageComponentPropValues = _this.initPropValues(JSON.stringify([pageComponentPropValue]), router, JSON.stringify(settings), isBrowser);
|
|
12789
|
+
return new IkasComponentRenderer(function () {
|
|
12790
|
+
return renderComponent(initializedPageComponentPropValues[0], settings, -1);
|
|
12791
|
+
});
|
|
12792
|
+
});
|
|
12793
|
+
return [];
|
|
12794
|
+
};
|
|
12392
12795
|
return IkasPageDataProvider;
|
|
12393
12796
|
}());
|
|
12394
12797
|
var IkasPageComponentPropValue = /** @class */ (function () {
|
|
@@ -18572,6 +18975,58 @@ var GoogleTagManager = /** @class */ (function () {
|
|
|
18572
18975
|
console.error(err);
|
|
18573
18976
|
}
|
|
18574
18977
|
};
|
|
18978
|
+
GoogleTagManager.completeRegistration = function () {
|
|
18979
|
+
try {
|
|
18980
|
+
var event_8 = {
|
|
18981
|
+
event: "customer_register",
|
|
18982
|
+
};
|
|
18983
|
+
//@ts-ignore
|
|
18984
|
+
!isServer$2 && window.dataLayer && window.dataLayer.push(event_8);
|
|
18985
|
+
return event_8;
|
|
18986
|
+
}
|
|
18987
|
+
catch (err) {
|
|
18988
|
+
console.error(err);
|
|
18989
|
+
}
|
|
18990
|
+
};
|
|
18991
|
+
GoogleTagManager.search = function (searchKeyword) {
|
|
18992
|
+
try {
|
|
18993
|
+
var event_9 = {
|
|
18994
|
+
event: "search",
|
|
18995
|
+
search_string: searchKeyword,
|
|
18996
|
+
};
|
|
18997
|
+
//@ts-ignore
|
|
18998
|
+
!isServer$2 && window.dataLayer && window.dataLayer.push(event_9);
|
|
18999
|
+
return event_9;
|
|
19000
|
+
}
|
|
19001
|
+
catch (err) {
|
|
19002
|
+
console.error(err);
|
|
19003
|
+
}
|
|
19004
|
+
};
|
|
19005
|
+
GoogleTagManager.viewCategory = function (category, categoryPath) {
|
|
19006
|
+
try {
|
|
19007
|
+
var event_10 = {
|
|
19008
|
+
event: "view_category",
|
|
19009
|
+
ecommerce: {
|
|
19010
|
+
category: [
|
|
19011
|
+
{
|
|
19012
|
+
id: category.id,
|
|
19013
|
+
name: category.name,
|
|
19014
|
+
metaData: category.metaData,
|
|
19015
|
+
href: category.href,
|
|
19016
|
+
image: category.image,
|
|
19017
|
+
path: categoryPath,
|
|
19018
|
+
},
|
|
19019
|
+
],
|
|
19020
|
+
},
|
|
19021
|
+
};
|
|
19022
|
+
//@ts-ignore
|
|
19023
|
+
!isServer$2 && window.dataLayer && window.dataLayer.push(event_10);
|
|
19024
|
+
return event_10;
|
|
19025
|
+
}
|
|
19026
|
+
catch (err) {
|
|
19027
|
+
console.error(err);
|
|
19028
|
+
}
|
|
19029
|
+
};
|
|
18575
19030
|
return GoogleTagManager;
|
|
18576
19031
|
}());
|
|
18577
19032
|
function productToGTMItem(productDetail, quantity) {
|
|
@@ -18713,6 +19168,7 @@ var Analytics = /** @class */ (function () {
|
|
|
18713
19168
|
Analytics.search = function (searchKeyword) {
|
|
18714
19169
|
try {
|
|
18715
19170
|
FacebookPixel.search(searchKeyword);
|
|
19171
|
+
GoogleTagManager.search(searchKeyword);
|
|
18716
19172
|
}
|
|
18717
19173
|
catch (err) {
|
|
18718
19174
|
console.error(err);
|
|
@@ -18721,6 +19177,7 @@ var Analytics = /** @class */ (function () {
|
|
|
18721
19177
|
Analytics.completeRegistration = function () {
|
|
18722
19178
|
try {
|
|
18723
19179
|
FacebookPixel.completeRegistration();
|
|
19180
|
+
GoogleTagManager.completeRegistration();
|
|
18724
19181
|
}
|
|
18725
19182
|
catch (err) {
|
|
18726
19183
|
console.error(err);
|
|
@@ -18736,9 +19193,10 @@ var Analytics = /** @class */ (function () {
|
|
|
18736
19193
|
console.error(err);
|
|
18737
19194
|
}
|
|
18738
19195
|
};
|
|
18739
|
-
Analytics.viewCategory = function (categoryPath) {
|
|
19196
|
+
Analytics.viewCategory = function (categoryPath, category) {
|
|
18740
19197
|
try {
|
|
18741
19198
|
FacebookPixel.viewCategory(categoryPath);
|
|
19199
|
+
GoogleTagManager.viewCategory(category, categoryPath);
|
|
18742
19200
|
}
|
|
18743
19201
|
catch (err) {
|
|
18744
19202
|
console.error(err);
|
|
@@ -18954,6 +19412,7 @@ var IkasCustomerStore = /** @class */ (function () {
|
|
|
18954
19412
|
return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
18955
19413
|
productIdList: favoriteProductsResult.map(function (fP) { return fP.productId; }),
|
|
18956
19414
|
priceListId: IkasStorefrontConfig.priceListId,
|
|
19415
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
18957
19416
|
})];
|
|
18958
19417
|
case 2:
|
|
18959
19418
|
productsResult = _b.sent();
|
|
@@ -20080,6 +20539,7 @@ var IkasThemeComponentProp = /** @class */ (function () {
|
|
|
20080
20539
|
var IkasThemeComponentPropType;
|
|
20081
20540
|
(function (IkasThemeComponentPropType) {
|
|
20082
20541
|
IkasThemeComponentPropType["TEXT"] = "TEXT";
|
|
20542
|
+
IkasThemeComponentPropType["RICH_TEXT"] = "RICH_TEXT";
|
|
20083
20543
|
IkasThemeComponentPropType["BOOLEAN"] = "BOOLEAN";
|
|
20084
20544
|
IkasThemeComponentPropType["IMAGE"] = "IMAGE";
|
|
20085
20545
|
IkasThemeComponentPropType["IMAGE_LIST"] = "IMAGE_LIST";
|
|
@@ -20093,8 +20553,8 @@ var IkasThemeComponentPropType;
|
|
|
20093
20553
|
IkasThemeComponentPropType["CATEGORY_LIST"] = "CATEGORY_LIST";
|
|
20094
20554
|
IkasThemeComponentPropType["COLOR"] = "COLOR";
|
|
20095
20555
|
IkasThemeComponentPropType["CUSTOM"] = "CUSTOM";
|
|
20096
|
-
|
|
20097
|
-
|
|
20556
|
+
IkasThemeComponentPropType["COMPONENT"] = "COMPONENT";
|
|
20557
|
+
IkasThemeComponentPropType["COMPONENT_LIST"] = "COMPONENT_LIST";
|
|
20098
20558
|
})(IkasThemeComponentPropType || (IkasThemeComponentPropType = {}));
|
|
20099
20559
|
|
|
20100
20560
|
var IkasThemeComponent = /** @class */ (function () {
|
|
@@ -20143,6 +20603,7 @@ var IkasThemeCustomData = /** @class */ (function () {
|
|
|
20143
20603
|
var IkasThemeCustomDataType;
|
|
20144
20604
|
(function (IkasThemeCustomDataType) {
|
|
20145
20605
|
IkasThemeCustomDataType["TEXT"] = "TEXT";
|
|
20606
|
+
IkasThemeCustomDataType["RICH_TEXT"] = "RICH_TEXT";
|
|
20146
20607
|
IkasThemeCustomDataType["NUMBER"] = "NUMBER";
|
|
20147
20608
|
IkasThemeCustomDataType["BOOLEAN"] = "BOOLEAN";
|
|
20148
20609
|
IkasThemeCustomDataType["IMAGE"] = "IMAGE";
|
|
@@ -20156,6 +20617,8 @@ var IkasThemeCustomDataType;
|
|
|
20156
20617
|
IkasThemeCustomDataType["CATEGORY"] = "CATEGORY";
|
|
20157
20618
|
IkasThemeCustomDataType["CATEGORY_LIST"] = "CATEGORY_LIST";
|
|
20158
20619
|
IkasThemeCustomDataType["COLOR"] = "COLOR";
|
|
20620
|
+
IkasThemeCustomDataType["COMPONENT"] = "COMPONENT";
|
|
20621
|
+
IkasThemeCustomDataType["COMPONENT_LIST"] = "COMPONENT_LIST";
|
|
20159
20622
|
IkasThemeCustomDataType["OBJECT"] = "OBJECT";
|
|
20160
20623
|
IkasThemeCustomDataType["STATIC_LIST"] = "STATIC_LIST";
|
|
20161
20624
|
IkasThemeCustomDataType["DYNAMIC_LIST"] = "DYNAMIC_LIST";
|
|
@@ -22180,10 +22643,15 @@ var IkasProductList = /** @class */ (function () {
|
|
|
22180
22643
|
productIdList: this.isStatic
|
|
22181
22644
|
? (_b = this._productListPropValue.productIds) === null || _b === void 0 ? void 0 : _b.map(function (p) { return p.productId; }) : undefined,
|
|
22182
22645
|
filterList: filterList,
|
|
22646
|
+
brandId: this._pageType === IkasThemePageType.BRAND &&
|
|
22647
|
+
this._type !== IkasProductListType.SEARCH
|
|
22648
|
+
? this._filterBrandId
|
|
22649
|
+
: undefined,
|
|
22183
22650
|
categoryIdList: this._filterCategoryId
|
|
22184
22651
|
? [this._filterCategoryId]
|
|
22185
22652
|
: undefined,
|
|
22186
22653
|
priceListId: IkasStorefrontConfig.priceListId,
|
|
22654
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
22187
22655
|
query: this._searchKeyword,
|
|
22188
22656
|
})];
|
|
22189
22657
|
case 1: return [2 /*return*/, _c.sent()];
|
|
@@ -24244,6 +24712,13 @@ var AccountInfoForm = /** @class */ (function () {
|
|
|
24244
24712
|
return AccountInfoForm;
|
|
24245
24713
|
}());
|
|
24246
24714
|
|
|
24715
|
+
var IkasComponentRenderer = /** @class */ (function () {
|
|
24716
|
+
function IkasComponentRenderer(render) {
|
|
24717
|
+
this.render = render;
|
|
24718
|
+
}
|
|
24719
|
+
return IkasComponentRenderer;
|
|
24720
|
+
}());
|
|
24721
|
+
|
|
24247
24722
|
var IkasProductListPropValue = /** @class */ (function () {
|
|
24248
24723
|
function IkasProductListPropValue(data) {
|
|
24249
24724
|
this.initialSort = null;
|
|
@@ -27597,214 +28072,6 @@ var PolicyModal = observer(function (_a) {
|
|
|
27597
28072
|
createElement("div", { className: styles$k.ModalContent, dangerouslySetInnerHTML: { __html: modalContent } }))));
|
|
27598
28073
|
});
|
|
27599
28074
|
|
|
27600
|
-
var IkasPageHead = observer(function (_a) {
|
|
27601
|
-
var _b;
|
|
27602
|
-
var page = _a.page, pageTitle = _a.pageTitle, description = _a.description, pageSpecificDataStr = _a.pageSpecificDataStr, props = __rest(_a, ["page", "pageTitle", "description", "pageSpecificDataStr"]);
|
|
27603
|
-
var ogpMetas = [];
|
|
27604
|
-
var schemas = [];
|
|
27605
|
-
var isCanonicalLinkAdd = false;
|
|
27606
|
-
var canonicalHref = "";
|
|
27607
|
-
if (props.addOgpMetas) {
|
|
27608
|
-
ogpMetas.push({
|
|
27609
|
-
property: "og:type",
|
|
27610
|
-
content: "website",
|
|
27611
|
-
});
|
|
27612
|
-
if (typeof window !== "undefined") {
|
|
27613
|
-
ogpMetas.push({
|
|
27614
|
-
property: "og:site_name",
|
|
27615
|
-
content: "https://" + window.location.hostname,
|
|
27616
|
-
});
|
|
27617
|
-
}
|
|
27618
|
-
if (pageTitle) {
|
|
27619
|
-
ogpMetas.push({
|
|
27620
|
-
property: "og:title",
|
|
27621
|
-
content: pageTitle,
|
|
27622
|
-
});
|
|
27623
|
-
}
|
|
27624
|
-
if (description) {
|
|
27625
|
-
ogpMetas.push({
|
|
27626
|
-
property: "og:description",
|
|
27627
|
-
content: description,
|
|
27628
|
-
});
|
|
27629
|
-
}
|
|
27630
|
-
if (typeof window !== "undefined") {
|
|
27631
|
-
ogpMetas.push({
|
|
27632
|
-
property: "og:url",
|
|
27633
|
-
content: window.location.href,
|
|
27634
|
-
});
|
|
27635
|
-
}
|
|
27636
|
-
if (props.merchantSettings) {
|
|
27637
|
-
if (pageSpecificDataStr && (page === null || page === void 0 ? void 0 : page.type) === IkasThemePageType.PRODUCT) {
|
|
27638
|
-
var productDetailParsed = JSON.parse(pageSpecificDataStr);
|
|
27639
|
-
var productDetail = new IkasProductDetail(productDetailParsed.product, productDetailParsed.selectedVariantValues);
|
|
27640
|
-
if (productDetail.selectedVariant.mainImage) {
|
|
27641
|
-
ogpMetas.push({
|
|
27642
|
-
property: "og:image",
|
|
27643
|
-
content: (_b = productDetail.selectedVariant.mainImage) === null || _b === void 0 ? void 0 : _b.src,
|
|
27644
|
-
});
|
|
27645
|
-
}
|
|
27646
|
-
}
|
|
27647
|
-
else {
|
|
27648
|
-
var merchantSettings = new IkasMerchantSettings(JSON.parse(props.merchantSettings));
|
|
27649
|
-
ogpMetas.push({
|
|
27650
|
-
property: "og:image",
|
|
27651
|
-
content: merchantSettings.logo.src,
|
|
27652
|
-
});
|
|
27653
|
-
}
|
|
27654
|
-
}
|
|
27655
|
-
}
|
|
27656
|
-
if (props.merchantSettings) {
|
|
27657
|
-
// for schema.org
|
|
27658
|
-
var merchantSettings = new IkasMerchantSettings(JSON.parse(props.merchantSettings));
|
|
27659
|
-
var websiteSchema = createWebsiteSchema();
|
|
27660
|
-
var storeSchema = createStoreSchema(merchantSettings);
|
|
27661
|
-
schemas.push(websiteSchema);
|
|
27662
|
-
schemas.push(storeSchema);
|
|
27663
|
-
}
|
|
27664
|
-
if (pageSpecificDataStr && (page === null || page === void 0 ? void 0 : page.type) === IkasThemePageType.PRODUCT) {
|
|
27665
|
-
var productDetailParsed = JSON.parse(pageSpecificDataStr);
|
|
27666
|
-
var productDetail = new IkasProductDetail(productDetailParsed.product, productDetailParsed.selectedVariantValues);
|
|
27667
|
-
if (typeof window !== "undefined" && productDetail.product.hasVariant) {
|
|
27668
|
-
isCanonicalLinkAdd =
|
|
27669
|
-
window.location.pathname !== productDetail.product.href;
|
|
27670
|
-
canonicalHref =
|
|
27671
|
-
"https://" + window.location.hostname + productDetail.product.href;
|
|
27672
|
-
}
|
|
27673
|
-
var schema = createProductSchema(productDetail);
|
|
27674
|
-
if (schema)
|
|
27675
|
-
schemas.push(schema);
|
|
27676
|
-
}
|
|
27677
|
-
if (pageSpecificDataStr && (page === null || page === void 0 ? void 0 : page.type) === IkasThemePageType.CATEGORY) {
|
|
27678
|
-
var categorySchema = createCategorySchema(pageSpecificDataStr);
|
|
27679
|
-
if (categorySchema)
|
|
27680
|
-
schemas.push(categorySchema);
|
|
27681
|
-
var categoryBreadcrumbSchema = createCategoryBreadcrumbSchema(pageSpecificDataStr);
|
|
27682
|
-
if (categoryBreadcrumbSchema)
|
|
27683
|
-
schemas.push(categoryBreadcrumbSchema);
|
|
27684
|
-
}
|
|
27685
|
-
return (createElement(Head, null,
|
|
27686
|
-
createElement("title", null, pageTitle || ""),
|
|
27687
|
-
createElement("meta", { name: "description", content: description || "" }),
|
|
27688
|
-
isCanonicalLinkAdd && createElement("link", { rel: "canonical", href: canonicalHref }),
|
|
27689
|
-
!!props.addOgpMetas &&
|
|
27690
|
-
ogpMetas.map(function (ogpMeta, index) { return (createElement("meta", { key: ogpMeta.content + "-" + index, property: ogpMeta.property, content: ogpMeta.content })); }),
|
|
27691
|
-
!!schemas.length &&
|
|
27692
|
-
schemas.map(function (schema, index) { return (createElement("script", { key: index, type: "application/ld+json", dangerouslySetInnerHTML: {
|
|
27693
|
-
__html: JSON.stringify(schema),
|
|
27694
|
-
} })); })));
|
|
27695
|
-
});
|
|
27696
|
-
function createWebsiteSchema() {
|
|
27697
|
-
var _a;
|
|
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": "Website",
|
|
27705
|
-
url: "https://" + hostname,
|
|
27706
|
-
};
|
|
27707
|
-
}
|
|
27708
|
-
function createStoreSchema(merchantSettings) {
|
|
27709
|
-
var _a, _b;
|
|
27710
|
-
var hostname = "";
|
|
27711
|
-
if (typeof window !== "undefined") {
|
|
27712
|
-
hostname = (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.hostname;
|
|
27713
|
-
}
|
|
27714
|
-
return {
|
|
27715
|
-
"@context": "https://schema.org",
|
|
27716
|
-
"@type": "Store",
|
|
27717
|
-
name: merchantSettings === null || merchantSettings === void 0 ? void 0 : merchantSettings.merchantName,
|
|
27718
|
-
logo: (_b = merchantSettings === null || merchantSettings === void 0 ? void 0 : merchantSettings.logo) === null || _b === void 0 ? void 0 : _b.src,
|
|
27719
|
-
url: "https://" + hostname,
|
|
27720
|
-
};
|
|
27721
|
-
}
|
|
27722
|
-
function createProductSchema(productDetail) {
|
|
27723
|
-
var _a, _b;
|
|
27724
|
-
try {
|
|
27725
|
-
var isBrowser = typeof window !== "undefined";
|
|
27726
|
-
if (isBrowser) {
|
|
27727
|
-
var urlParams = new URLSearchParams(window.location.search);
|
|
27728
|
-
var vid_1 = urlParams.get("vid");
|
|
27729
|
-
if (vid_1) {
|
|
27730
|
-
var variant = productDetail.product.variants.find(function (v) { return v.id === vid_1; });
|
|
27731
|
-
if (variant) {
|
|
27732
|
-
productDetail.selectedVariantValues = variant.variantValues;
|
|
27733
|
-
}
|
|
27734
|
-
}
|
|
27735
|
-
}
|
|
27736
|
-
var productUrl = isBrowser
|
|
27737
|
-
? "https://" + window.location.hostname + productDetail.href
|
|
27738
|
-
: "";
|
|
27739
|
-
return {
|
|
27740
|
-
"@context": "https://schema.org/",
|
|
27741
|
-
"@type": "Product",
|
|
27742
|
-
name: productDetail.product.name,
|
|
27743
|
-
description: (_a = productDetail.product.metaData) === null || _a === void 0 ? void 0 : _a.description,
|
|
27744
|
-
image: productDetail.selectedVariant.images.map(function (i) { return i.src; }),
|
|
27745
|
-
productId: productDetail.selectedVariant.id,
|
|
27746
|
-
sku: productDetail.selectedVariant.sku,
|
|
27747
|
-
mpn: productDetail.selectedVariant.barcodeList.length
|
|
27748
|
-
? productDetail.selectedVariant.barcodeList[0]
|
|
27749
|
-
: "",
|
|
27750
|
-
brand: {
|
|
27751
|
-
"@type": "Brand",
|
|
27752
|
-
name: (_b = productDetail.product.brand) === null || _b === void 0 ? void 0 : _b.name,
|
|
27753
|
-
},
|
|
27754
|
-
offers: {
|
|
27755
|
-
"@type": "Offer",
|
|
27756
|
-
url: productUrl,
|
|
27757
|
-
priceCurrency: productDetail.selectedVariant.price.currency || "TRY",
|
|
27758
|
-
price: productDetail.selectedVariant.price.finalPrice,
|
|
27759
|
-
priceValidUntil: "",
|
|
27760
|
-
itemCondition: "https://schema.org/NewCondition",
|
|
27761
|
-
availability: productDetail.selectedVariant.stock > 0
|
|
27762
|
-
? "https://schema.org/InStock"
|
|
27763
|
-
: "https://schema.org/OutOfStock",
|
|
27764
|
-
},
|
|
27765
|
-
};
|
|
27766
|
-
}
|
|
27767
|
-
catch (err) { }
|
|
27768
|
-
}
|
|
27769
|
-
function createCategorySchema(pageSpecificDataStr) {
|
|
27770
|
-
var _a, _b, _c;
|
|
27771
|
-
try {
|
|
27772
|
-
var categoryParsed = JSON.parse(pageSpecificDataStr);
|
|
27773
|
-
var category = new IkasCategory(categoryParsed);
|
|
27774
|
-
var categoryUrl = typeof window !== undefined
|
|
27775
|
-
? "https://" + window.location.hostname + category.href
|
|
27776
|
-
: "";
|
|
27777
|
-
return {
|
|
27778
|
-
"@context": "http://schema.org",
|
|
27779
|
-
"@type": "CollectionPage",
|
|
27780
|
-
url: categoryUrl,
|
|
27781
|
-
name: (_a = category.metaData) === null || _a === void 0 ? void 0 : _a.pageTitle,
|
|
27782
|
-
description: (_b = category.metaData) === null || _b === void 0 ? void 0 : _b.description,
|
|
27783
|
-
image: (_c = category.image) === null || _c === void 0 ? void 0 : _c.src,
|
|
27784
|
-
};
|
|
27785
|
-
}
|
|
27786
|
-
catch (_d) { }
|
|
27787
|
-
}
|
|
27788
|
-
function createCategoryBreadcrumbSchema(pageSpecificDataStr) {
|
|
27789
|
-
try {
|
|
27790
|
-
var categoryParsed = JSON.parse(pageSpecificDataStr);
|
|
27791
|
-
var category = new IkasCategory(categoryParsed);
|
|
27792
|
-
return {
|
|
27793
|
-
"@context": "http://schema.org",
|
|
27794
|
-
"@type": "BreadcrumbList",
|
|
27795
|
-
itemListElement: category.path.map(function (categoryPath, index) { return ({
|
|
27796
|
-
"@type": "ListItem",
|
|
27797
|
-
position: index + 1,
|
|
27798
|
-
name: categoryPath.name,
|
|
27799
|
-
item: typeof window !== undefined
|
|
27800
|
-
? "https://" + window.location.hostname + categoryPath.href
|
|
27801
|
-
: "",
|
|
27802
|
-
}); }),
|
|
27803
|
-
};
|
|
27804
|
-
}
|
|
27805
|
-
catch (_a) { }
|
|
27806
|
-
}
|
|
27807
|
-
|
|
27808
28075
|
var CustomerLoginRequiredError = observer(function (_a) {
|
|
27809
28076
|
var onClose = _a.onClose;
|
|
27810
28077
|
return (createElement(ErrorContainer, { onClose: onClose },
|
|
@@ -27936,67 +28203,6 @@ var style = {
|
|
|
27936
28203
|
backgroundColor: "rgba(255, 0, 0, 0.5)",
|
|
27937
28204
|
};
|
|
27938
28205
|
|
|
27939
|
-
var ThemeComponent = observer(function (_a) {
|
|
27940
|
-
var pageComponentPropValue = _a.pageComponentPropValue, pageComponent = _a.pageComponent, index = _a.index, settingsStr = _a.settingsStr;
|
|
27941
|
-
var store = IkasStorefrontConfig.store, components = IkasStorefrontConfig.components;
|
|
27942
|
-
var settings = new IkasThemeSettings(JSON.parse(settingsStr));
|
|
27943
|
-
useEffect(function () {
|
|
27944
|
-
settings.colors.map(function (sc) {
|
|
27945
|
-
return document.documentElement.style.setProperty(sc.key, sc.color);
|
|
27946
|
-
});
|
|
27947
|
-
}, [settings]);
|
|
27948
|
-
var propValues = pageComponentPropValue.propValues;
|
|
27949
|
-
var hasNullValue = computed(function () {
|
|
27950
|
-
return Object.entries(propValues || {}).some(function (_a) {
|
|
27951
|
-
var _b;
|
|
27952
|
-
var propName = _a[0], propValue = _a[1];
|
|
27953
|
-
return (propValue === null || propValue === undefined) && ((_b = pageComponentPropValue.component.props.find(function (p) { return p.name === propName; })) === null || _b === void 0 ? void 0 : _b.isRequired);
|
|
27954
|
-
});
|
|
27955
|
-
});
|
|
27956
|
-
var Component = components[pageComponent.componentId];
|
|
27957
|
-
return (createElement("div", { id: index + "" }, hasNullValue.get() ? (createElement(ErrorComponent, null)) : (createElement(Component, __assign({ key: pageComponent.id }, propValues, { settings: settings, store: store })))));
|
|
27958
|
-
});
|
|
27959
|
-
|
|
27960
|
-
var IkasPage = observer(function (_a) {
|
|
27961
|
-
var _b, _c;
|
|
27962
|
-
var propValues = _a.propValues, page = _a.page, pageSpecificDataStr = _a.pageSpecificDataStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings, addOgpMetas = _a.addOgpMetas;
|
|
27963
|
-
var store = IkasStorefrontConfig.store;
|
|
27964
|
-
if (page) {
|
|
27965
|
-
store.currentPageType = page.type;
|
|
27966
|
-
}
|
|
27967
|
-
useEffect(function () {
|
|
27968
|
-
store.checkLocalization();
|
|
27969
|
-
//@ts-ignore
|
|
27970
|
-
store.cartStore.getCart();
|
|
27971
|
-
}, []);
|
|
27972
|
-
var renderComponent = function (pageComponent, index) {
|
|
27973
|
-
var pageComponentPropValue = propValues.find(function (pv) { return pv.pageComponent.id === pageComponent.id; });
|
|
27974
|
-
return (createElement(ThemeComponent, { key: pageComponent.id, index: index, pageComponentPropValue: pageComponentPropValue, pageComponent: pageComponent, settingsStr: settingsStr }));
|
|
27975
|
-
};
|
|
27976
|
-
var headerComponent = (_b = propValues.find(function (pv) { return pv.component.isHeader; })) === null || _b === void 0 ? void 0 : _b.pageComponent;
|
|
27977
|
-
var footerComponent = (_c = propValues.find(function (pv) { return pv.component.isFooter; })) === null || _c === void 0 ? void 0 : _c.pageComponent;
|
|
27978
|
-
var others = propValues
|
|
27979
|
-
.filter(function (pv) { return !pv.component.isHeader && !pv.component.isFooter; })
|
|
27980
|
-
.map(function (pv) { return pv.pageComponent; }) || [];
|
|
27981
|
-
if (!page)
|
|
27982
|
-
return null;
|
|
27983
|
-
return (createElement(Fragment, null,
|
|
27984
|
-
createElement(IkasPageHead, { page: page, pageTitle: page.pageTitle, description: page.description, pageSpecificDataStr: pageSpecificDataStr, merchantSettings: merchantSettings, addOgpMetas: addOgpMetas }),
|
|
27985
|
-
createElement("div", { style: pageStyle },
|
|
27986
|
-
createElement("div", null,
|
|
27987
|
-
headerComponent && renderComponent(headerComponent, -1),
|
|
27988
|
-
others.map(renderComponent)),
|
|
27989
|
-
footerComponent && renderComponent(footerComponent, -1))));
|
|
27990
|
-
});
|
|
27991
|
-
var pageStyle = {
|
|
27992
|
-
position: "relative",
|
|
27993
|
-
minHeight: "100vh",
|
|
27994
|
-
width: "100vw",
|
|
27995
|
-
display: "flex",
|
|
27996
|
-
flexDirection: "column",
|
|
27997
|
-
justifyContent: "space-between",
|
|
27998
|
-
};
|
|
27999
|
-
|
|
28000
28206
|
var PageViewModel = /** @class */ (function () {
|
|
28001
28207
|
function PageViewModel(router) {
|
|
28002
28208
|
var _this = this;
|
|
@@ -28108,18 +28314,6 @@ var PageViewModel = /** @class */ (function () {
|
|
|
28108
28314
|
data: data,
|
|
28109
28315
|
}, "*");
|
|
28110
28316
|
};
|
|
28111
|
-
this.getComponentPropValues = function (pageComponent) {
|
|
28112
|
-
var _a;
|
|
28113
|
-
var json = {};
|
|
28114
|
-
var component = (_a = _this.theme) === null || _a === void 0 ? void 0 : _a.components.find(function (c) { return c.id === pageComponent.componentId; });
|
|
28115
|
-
component === null || component === void 0 ? void 0 : component.props.forEach(function (prop) {
|
|
28116
|
-
// TODO get prop values
|
|
28117
|
-
if (prop.type === IkasThemeComponentPropType.TEXT) {
|
|
28118
|
-
json[prop.name] = pageComponent.propValues[prop.name];
|
|
28119
|
-
}
|
|
28120
|
-
});
|
|
28121
|
-
return json;
|
|
28122
|
-
};
|
|
28123
28317
|
this.getPagePropValues = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
28124
28318
|
var pageDataProvider;
|
|
28125
28319
|
var _this = this;
|
|
@@ -28132,7 +28326,7 @@ var PageViewModel = /** @class */ (function () {
|
|
|
28132
28326
|
return [4 /*yield*/, pageDataProvider.getPageData()];
|
|
28133
28327
|
case 1:
|
|
28134
28328
|
_b.sent();
|
|
28135
|
-
pageDataProvider.pageComponentPropValues = IkasPageDataProvider.initPropValues(JSON.stringify(pageDataProvider.pageComponentPropValues), this.router);
|
|
28329
|
+
pageDataProvider.pageComponentPropValues = IkasPageDataProvider.initPropValues(JSON.stringify(pageDataProvider.pageComponentPropValues), this.router, JSON.stringify(this.theme.settings));
|
|
28136
28330
|
runInAction(function () {
|
|
28137
28331
|
_this.pageDataProvider = pageDataProvider;
|
|
28138
28332
|
_this.isLoading = false;
|
|
@@ -28196,7 +28390,13 @@ var PageViewModel = /** @class */ (function () {
|
|
|
28196
28390
|
if (pageComponentPropValues) {
|
|
28197
28391
|
pageComponentPropValues.propValues[propName] = propValue;
|
|
28198
28392
|
if (prop.type === IkasThemeComponentPropType.CUSTOM) {
|
|
28199
|
-
IkasPageDataProvider.initCustomDataPropValue(prop, propValue, pageComponentPropValues, _this.router, true);
|
|
28393
|
+
IkasPageDataProvider.initCustomDataPropValue(prop, propValue, pageComponentPropValues, _this.router, _this.theme.settings, true);
|
|
28394
|
+
}
|
|
28395
|
+
else if (prop.type === IkasThemeComponentPropType.COMPONENT) {
|
|
28396
|
+
IkasPageDataProvider.initComponentPropValue(prop, propValue, pageComponentPropValues, _this.router, _this.theme.settings, true);
|
|
28397
|
+
}
|
|
28398
|
+
else if (prop.type === IkasThemeComponentPropType.COMPONENT_LIST) {
|
|
28399
|
+
IkasPageDataProvider.initComponentListPropValue(prop, propValue, pageComponentPropValues, _this.router, _this.theme.settings, true);
|
|
28200
28400
|
}
|
|
28201
28401
|
}
|
|
28202
28402
|
});
|
|
@@ -28265,7 +28465,7 @@ var PageViewModel = /** @class */ (function () {
|
|
|
28265
28465
|
runInAction(function () {
|
|
28266
28466
|
var customDataProps = pageComponentPropValues.component.props.filter(function (p) { return p.type === IkasThemeComponentPropType.CUSTOM; });
|
|
28267
28467
|
customDataProps.forEach(function (customDataProp) {
|
|
28268
|
-
IkasPageDataProvider.initCustomDataPropValue(customDataProp, pageComponentPropValues.propValues[customDataProp.name], pageComponentPropValues, _this.router, true);
|
|
28468
|
+
IkasPageDataProvider.initCustomDataPropValue(customDataProp, pageComponentPropValues.propValues[customDataProp.name], pageComponentPropValues, _this.router, _this.theme.settings, true);
|
|
28269
28469
|
});
|
|
28270
28470
|
_this.pageDataProvider.pageComponentPropValues.push(pageComponentPropValues);
|
|
28271
28471
|
_this.pageComponents.push(pageComponent);
|
|
@@ -28850,7 +29050,9 @@ var Page = function (_a) {
|
|
|
28850
29050
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings, configJson = _a.configJson;
|
|
28851
29051
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
28852
29052
|
var router = useRouter();
|
|
28853
|
-
var propValues = useMemo(function () {
|
|
29053
|
+
var propValues = useMemo(function () {
|
|
29054
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router, settingsStr);
|
|
29055
|
+
}, [propValuesStr]);
|
|
28854
29056
|
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
|
|
28855
29057
|
};
|
|
28856
29058
|
var getStaticProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -28873,14 +29075,16 @@ var Page$1 = function (_a) {
|
|
|
28873
29075
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
28874
29076
|
var router = useRouter();
|
|
28875
29077
|
var _b = useState(false), isBrowser = _b[0], setIsBrowser = _b[1];
|
|
28876
|
-
var initialPropValues = useMemo(function () {
|
|
29078
|
+
var initialPropValues = useMemo(function () {
|
|
29079
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router, settingsStr);
|
|
29080
|
+
}, [propValuesStr]);
|
|
28877
29081
|
var _c = useState(initialPropValues), propValues = _c[0], setPropValues = _c[1];
|
|
28878
29082
|
useEffect(function () {
|
|
28879
29083
|
setIsBrowser(typeof window !== "undefined");
|
|
28880
29084
|
handleAnalytics(page, pageSpecificDataStr);
|
|
28881
29085
|
}, []);
|
|
28882
29086
|
useEffect(function () {
|
|
28883
|
-
setPropValues(IkasPageDataProvider.initPropValues(propValuesStr, router, isBrowser));
|
|
29087
|
+
setPropValues(IkasPageDataProvider.initPropValues(propValuesStr, router, settingsStr, isBrowser));
|
|
28884
29088
|
}, [isBrowser, propValuesStr]);
|
|
28885
29089
|
return (createElement(IkasPage, { page: page, propValues: propValues, pageSpecificDataStr: pageSpecificDataStr, settingsStr: settingsStr, merchantSettings: merchantSettings, addOgpMetas: true }));
|
|
28886
29090
|
};
|
|
@@ -28901,6 +29105,7 @@ var getStaticPaths = function (context) { return __awaiter(void 0, void 0, void
|
|
|
28901
29105
|
return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
28902
29106
|
productIdList: productMetaData.map(function (p) { return p.targetId; }),
|
|
28903
29107
|
priceListId: IkasStorefrontConfig.priceListId,
|
|
29108
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
28904
29109
|
})];
|
|
28905
29110
|
case 2:
|
|
28906
29111
|
productsResponse = _b.sent();
|
|
@@ -28972,7 +29177,7 @@ function handleAnalytics(page, pageSpecificDataStr) {
|
|
|
28972
29177
|
else {
|
|
28973
29178
|
categoryPath = category.name;
|
|
28974
29179
|
}
|
|
28975
|
-
Analytics.viewCategory(categoryPath);
|
|
29180
|
+
Analytics.viewCategory(categoryPath, category);
|
|
28976
29181
|
}
|
|
28977
29182
|
}
|
|
28978
29183
|
catch (err) {
|
|
@@ -28992,7 +29197,9 @@ var Page$2 = function (_a) {
|
|
|
28992
29197
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, configJson = _a.configJson;
|
|
28993
29198
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
28994
29199
|
var router = useRouter();
|
|
28995
|
-
var propValues = useMemo(function () {
|
|
29200
|
+
var propValues = useMemo(function () {
|
|
29201
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router, settingsStr);
|
|
29202
|
+
}, [propValuesStr]);
|
|
28996
29203
|
return (createElement(IkasPage, { page: page, settingsStr: settingsStr, propValues: propValues }));
|
|
28997
29204
|
};
|
|
28998
29205
|
var getStaticPaths$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29141,7 +29348,9 @@ var Page$3 = function (_a) {
|
|
|
29141
29348
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, configJson = _a.configJson;
|
|
29142
29349
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29143
29350
|
var router = useRouter();
|
|
29144
|
-
var propValues = useMemo(function () {
|
|
29351
|
+
var propValues = useMemo(function () {
|
|
29352
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router, settingsStr);
|
|
29353
|
+
}, [propValuesStr]);
|
|
29145
29354
|
return (createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29146
29355
|
};
|
|
29147
29356
|
var getStaticProps$3 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29163,7 +29372,9 @@ var Page$4 = function (_a) {
|
|
|
29163
29372
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, configJson = _a.configJson;
|
|
29164
29373
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29165
29374
|
var router = useRouter();
|
|
29166
|
-
var propValues = useMemo(function () {
|
|
29375
|
+
var propValues = useMemo(function () {
|
|
29376
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router, settingsStr);
|
|
29377
|
+
}, [propValuesStr]);
|
|
29167
29378
|
return (createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29168
29379
|
};
|
|
29169
29380
|
var getStaticProps$4 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29185,7 +29396,9 @@ var Page$5 = function (_a) {
|
|
|
29185
29396
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, configJson = _a.configJson;
|
|
29186
29397
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29187
29398
|
var router = useRouter();
|
|
29188
|
-
var propValues = useMemo(function () {
|
|
29399
|
+
var propValues = useMemo(function () {
|
|
29400
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router, settingsStr);
|
|
29401
|
+
}, [propValuesStr]);
|
|
29189
29402
|
return (createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29190
29403
|
};
|
|
29191
29404
|
var getStaticProps$5 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29207,7 +29420,9 @@ var Page$6 = function (_a) {
|
|
|
29207
29420
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, configJson = _a.configJson;
|
|
29208
29421
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29209
29422
|
var router = useRouter();
|
|
29210
|
-
var propValues = useMemo(function () {
|
|
29423
|
+
var propValues = useMemo(function () {
|
|
29424
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router, settingsStr);
|
|
29425
|
+
}, [propValuesStr]);
|
|
29211
29426
|
return (createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29212
29427
|
};
|
|
29213
29428
|
var getServerSideProps$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29229,7 +29444,9 @@ var Page$7 = function (_a) {
|
|
|
29229
29444
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings, configJson = _a.configJson;
|
|
29230
29445
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29231
29446
|
var router = useRouter();
|
|
29232
|
-
var propValues = useMemo(function () {
|
|
29447
|
+
var propValues = useMemo(function () {
|
|
29448
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router, settingsStr);
|
|
29449
|
+
}, [propValuesStr]);
|
|
29233
29450
|
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29234
29451
|
};
|
|
29235
29452
|
var getStaticProps$6 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29251,7 +29468,9 @@ var Page$8 = function (_a) {
|
|
|
29251
29468
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings, configJson = _a.configJson;
|
|
29252
29469
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29253
29470
|
var router = useRouter();
|
|
29254
|
-
var propValues = useMemo(function () {
|
|
29471
|
+
var propValues = useMemo(function () {
|
|
29472
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router, settingsStr);
|
|
29473
|
+
}, [propValuesStr]);
|
|
29255
29474
|
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29256
29475
|
};
|
|
29257
29476
|
var getStaticProps$7 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29273,7 +29492,9 @@ var Page$9 = function (_a) {
|
|
|
29273
29492
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings, configJson = _a.configJson;
|
|
29274
29493
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29275
29494
|
var router = useRouter();
|
|
29276
|
-
var propValues = useMemo(function () {
|
|
29495
|
+
var propValues = useMemo(function () {
|
|
29496
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router, settingsStr);
|
|
29497
|
+
}, [propValuesStr]);
|
|
29277
29498
|
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29278
29499
|
};
|
|
29279
29500
|
var getStaticProps$8 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29295,7 +29516,9 @@ var Page$a = function (_a) {
|
|
|
29295
29516
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings, configJson = _a.configJson;
|
|
29296
29517
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29297
29518
|
var router = useRouter();
|
|
29298
|
-
var propValues = useMemo(function () {
|
|
29519
|
+
var propValues = useMemo(function () {
|
|
29520
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router, settingsStr);
|
|
29521
|
+
}, [propValuesStr]);
|
|
29299
29522
|
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29300
29523
|
};
|
|
29301
29524
|
var getStaticProps$9 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29317,7 +29540,9 @@ var Page$b = function (_a) {
|
|
|
29317
29540
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, configJson = _a.configJson;
|
|
29318
29541
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29319
29542
|
var router = useRouter();
|
|
29320
|
-
var propValues = useMemo(function () {
|
|
29543
|
+
var propValues = useMemo(function () {
|
|
29544
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router, settingsStr);
|
|
29545
|
+
}, [propValuesStr]);
|
|
29321
29546
|
var store = IkasStorefrontConfig.store;
|
|
29322
29547
|
useEffect(function () {
|
|
29323
29548
|
Analytics.viewCart(store.cartStore.cart);
|
|
@@ -29354,7 +29579,9 @@ var Page$d = function (_a) {
|
|
|
29354
29579
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, configJson = _a.configJson;
|
|
29355
29580
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29356
29581
|
var router = useRouter();
|
|
29357
|
-
var propValues = useMemo(function () {
|
|
29582
|
+
var propValues = useMemo(function () {
|
|
29583
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router, settingsStr);
|
|
29584
|
+
}, [propValuesStr]);
|
|
29358
29585
|
return (createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29359
29586
|
};
|
|
29360
29587
|
var getStaticProps$b = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29377,13 +29604,15 @@ var Page$e = function (_a) {
|
|
|
29377
29604
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29378
29605
|
var router = useRouter();
|
|
29379
29606
|
var _b = useState(false), isBrowser = _b[0], setIsBrowser = _b[1];
|
|
29380
|
-
var initialPropValues = useMemo(function () {
|
|
29607
|
+
var initialPropValues = useMemo(function () {
|
|
29608
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router, settingsStr);
|
|
29609
|
+
}, [propValuesStr]);
|
|
29381
29610
|
var _c = useState(initialPropValues), propValues = _c[0], setPropValues = _c[1];
|
|
29382
29611
|
useEffect(function () {
|
|
29383
29612
|
setIsBrowser(typeof window !== "undefined");
|
|
29384
29613
|
}, []);
|
|
29385
29614
|
useEffect(function () {
|
|
29386
|
-
setPropValues(IkasPageDataProvider.initPropValues(propValuesStr, router, isBrowser));
|
|
29615
|
+
setPropValues(IkasPageDataProvider.initPropValues(propValuesStr, router, settingsStr, isBrowser));
|
|
29387
29616
|
}, [isBrowser, propValuesStr]);
|
|
29388
29617
|
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
|
|
29389
29618
|
};
|
|
@@ -29408,7 +29637,9 @@ var Page$f = function (_a) {
|
|
|
29408
29637
|
return createElement(Error$1, { statusCode: 404 });
|
|
29409
29638
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
29410
29639
|
var router = useRouter();
|
|
29411
|
-
var propValues = useMemo(function () {
|
|
29640
|
+
var propValues = useMemo(function () {
|
|
29641
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router, settingsStr);
|
|
29642
|
+
}, [propValuesStr]);
|
|
29412
29643
|
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
29413
29644
|
};
|
|
29414
29645
|
var getStaticProps$d = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -29466,6 +29697,7 @@ var IkasBaseStore = /** @class */ (function () {
|
|
|
29466
29697
|
this.localeOptions = [];
|
|
29467
29698
|
this.showLocaleOptions = false;
|
|
29468
29699
|
this.localeChecked = false;
|
|
29700
|
+
this.settingsSet = false;
|
|
29469
29701
|
this.customerStore = new IkasCustomerStore(this);
|
|
29470
29702
|
this.cartStore = new IkasCartStore(this);
|
|
29471
29703
|
makeObservable(this, {
|
|
@@ -29554,7 +29786,15 @@ var IkasBaseStore = /** @class */ (function () {
|
|
|
29554
29786
|
(localeOption.routing.path ? "/" + localeOption.routing.path : ""));
|
|
29555
29787
|
}
|
|
29556
29788
|
};
|
|
29789
|
+
IkasBaseStore.prototype.setSettings = function (settingsStr) {
|
|
29790
|
+
if (this.settingsSet)
|
|
29791
|
+
return;
|
|
29792
|
+
var settings = new IkasThemeSettings(JSON.parse(settingsStr));
|
|
29793
|
+
settings.colors.map(function (sc) {
|
|
29794
|
+
return document.documentElement.style.setProperty(sc.key, sc.color);
|
|
29795
|
+
});
|
|
29796
|
+
};
|
|
29557
29797
|
return IkasBaseStore;
|
|
29558
29798
|
}());
|
|
29559
29799
|
|
|
29560
|
-
export { AccountInfoForm, index$3 as AccountPage, AddressForm, addresses as AddressesPage, Analytics, AnalyticsBody, AnalyticsHead, cart as CartPage, _id_$1 as CheckoutPage, ContactForm, _slug_ as CustomPage, editor$1 as EditorPage, EmailRule, EqualsRule, favoriteProducts as FavoriteProductsPage, ForgotPasswordForm, forgotPassword as ForgotPasswordPage, IkasAmountTypeEnum$1 as IkasAmountTypeEnum, IkasApplicableProductFilterValue, IkasBaseStore, IkasBrand, IkasBrandAPI, IkasBrandList, IkasBrandListPropValue, IkasBrandListSortType, IkasBrandListType, IkasBrandPropValue, IkasCardAssociation, IkasCardType, IkasCartAPI, IkasCategory, IkasCategoryAPI, IkasCategoryList, IkasCategoryListPropValue, IkasCategoryListSortType, IkasCategoryListType, IkasCategoryPropValue, IkasCheckout, IkasCheckoutAPI, IkasCheckoutPage, IkasCheckoutRecoveryEmailStatus, IkasCheckoutRecoveryStatus, IkasCheckoutStatus, IkasCityAPI, IkasContactForm, IkasContactFormAPI, IkasCountryAPI, IkasCustomer, IkasCustomerAPI, IkasCustomerAddress, IkasDistrictAPI, IkasFavoriteProduct, IkasFavoriteProductAPI, IkasHTMLMetaData, IkasHTMLMetaDataAPI, IkasHTMLMetaDataTargetType, IkasImage, IkasLinkPropValue, IkasLinkType, IkasMerchantAPI, IkasMerchantSettings, IkasNavigationLink, IkasOrder, IkasOrderCancelledReason, IkasOrderLineItem, IkasOrderPackageFulfillStatus, IkasOrderPackageStatus, IkasOrderPaymentStatus, IkasOrderShippingMethod, IkasOrderStatus, IkasOrderTransaction, IkasPage, IkasPageComponentPropValue, IkasPageDataProvider, IkasPageEditor, IkasPageHead, IkasPaymentMethod, IkasProduct, IkasProductAttribute, IkasProductAttributeAPI, IkasProductAttributeValue, IkasProductDetail, IkasProductDetailPropValue, IkasProductFilter, IkasProductFilterDisplayType, IkasProductFilterSettings, IkasProductFilterSortType, IkasProductFilterType, IkasProductFilterValue, IkasProductList, IkasProductListPropValue, IkasProductListSortType, IkasProductListType, IkasProductPrice, IkasProductSearchAPI, IkasProductType, IkasProductVariant, IkasProductVariantType, IkasShippingMethod, IkasShippingMethodEnum, IkasStateAPI, IkasStorefrontConfig, IkasTheme, IkasThemeComponent, IkasThemeComponentProp, IkasThemeComponentPropType, IkasThemeCustomData, IkasThemeCustomDataType, IkasThemePage, IkasThemePageComponent, IkasThemePageType, IkasThemeSettings, IkasTransactionStatusEnum, IkasTransactionTypeEnum, IkasVariantSelectionType, IkasVariantType, IkasVariantTypeAPI, IkasVariantValue, Image, home as IndexPage, LessThanRule, LoginForm, login as LoginPage, MaxRule, MinRule, _404 as NotFoundPage, _id_$2 as OrderDetailPage, OrderLineItemStatusEnum$1 as OrderLineItemStatusEnum, index$4 as OrdersPage, PhoneRule, RangeValue, RecoverPasswordForm, recoverPassword as RecoverPasswordPage, RegisterForm, register as RegisterPage, RequiredRule, search as SearchPage, index$2 as SlugPage, ValidationRule, Validator, ValidatorErrorType, apollo, decodeBase64, formatMoney, parseRangeStr, pascalCase, stringToSlug, validatePhoneNumber };
|
|
29800
|
+
export { AccountInfoForm, index$3 as AccountPage, AddressForm, addresses as AddressesPage, Analytics, AnalyticsBody, AnalyticsHead, cart as CartPage, _id_$1 as CheckoutPage, ContactForm, _slug_ as CustomPage, editor$1 as EditorPage, EmailRule, EqualsRule, favoriteProducts as FavoriteProductsPage, ForgotPasswordForm, forgotPassword as ForgotPasswordPage, IkasAmountTypeEnum$1 as IkasAmountTypeEnum, IkasApplicableProductFilterValue, IkasBaseStore, IkasBrand, IkasBrandAPI, IkasBrandList, IkasBrandListPropValue, IkasBrandListSortType, IkasBrandListType, IkasBrandPropValue, IkasCardAssociation, IkasCardType, IkasCartAPI, IkasCategory, IkasCategoryAPI, IkasCategoryList, IkasCategoryListPropValue, IkasCategoryListSortType, IkasCategoryListType, IkasCategoryPropValue, IkasCheckout, IkasCheckoutAPI, IkasCheckoutPage, IkasCheckoutRecoveryEmailStatus, IkasCheckoutRecoveryStatus, IkasCheckoutStatus, IkasCityAPI, IkasComponentRenderer, IkasContactForm, IkasContactFormAPI, IkasCountryAPI, IkasCustomer, IkasCustomerAPI, IkasCustomerAddress, IkasDistrictAPI, IkasFavoriteProduct, IkasFavoriteProductAPI, IkasHTMLMetaData, IkasHTMLMetaDataAPI, IkasHTMLMetaDataTargetType, IkasImage, IkasLinkPropValue, IkasLinkType, IkasMerchantAPI, IkasMerchantSettings, IkasNavigationLink, IkasOrder, IkasOrderCancelledReason, IkasOrderLineItem, IkasOrderPackageFulfillStatus, IkasOrderPackageStatus, IkasOrderPaymentStatus, IkasOrderShippingMethod, IkasOrderStatus, IkasOrderTransaction, IkasPage, IkasPageComponentPropValue, IkasPageDataProvider, IkasPageEditor, IkasPageHead, IkasPaymentMethod, IkasProduct, IkasProductAttribute, IkasProductAttributeAPI, IkasProductAttributeValue, IkasProductDetail, IkasProductDetailPropValue, IkasProductFilter, IkasProductFilterDisplayType, IkasProductFilterSettings, IkasProductFilterSortType, IkasProductFilterType, IkasProductFilterValue, IkasProductList, IkasProductListPropValue, IkasProductListSortType, IkasProductListType, IkasProductPrice, IkasProductSearchAPI, IkasProductType, IkasProductVariant, IkasProductVariantType, IkasShippingMethod, IkasShippingMethodEnum, IkasStateAPI, IkasStorefrontConfig, IkasTheme, IkasThemeComponent, IkasThemeComponentProp, IkasThemeComponentPropType, IkasThemeCustomData, IkasThemeCustomDataType, IkasThemePage, IkasThemePageComponent, IkasThemePageType, IkasThemeSettings, IkasTransactionStatusEnum, IkasTransactionTypeEnum, IkasVariantSelectionType, IkasVariantType, IkasVariantTypeAPI, IkasVariantValue, Image, home as IndexPage, LessThanRule, LoginForm, login as LoginPage, MaxRule, MinRule, _404 as NotFoundPage, _id_$2 as OrderDetailPage, OrderLineItemStatusEnum$1 as OrderLineItemStatusEnum, index$4 as OrdersPage, PhoneRule, RangeValue, RecoverPasswordForm, recoverPassword as RecoverPasswordPage, RegisterForm, register as RegisterPage, RequiredRule, search as SearchPage, index$2 as SlugPage, ValidationRule, Validator, ValidatorErrorType, apollo, decodeBase64, formatMoney, parseRangeStr, pascalCase, stringToSlug, validatePhoneNumber };
|