@ikas/storefront 0.0.47 → 0.0.49
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/index.es.js
CHANGED
|
@@ -11770,6 +11770,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
11770
11770
|
this.pageParams = {};
|
|
11771
11771
|
this.pageComponentPropValues = [];
|
|
11772
11772
|
this.pageSpecificData = null;
|
|
11773
|
+
this.merchantSettings = null;
|
|
11773
11774
|
this.theme = new IkasTheme(theme);
|
|
11774
11775
|
this.pageParams = pageParams || {};
|
|
11775
11776
|
this.pageType = pageType;
|
|
@@ -11794,7 +11795,9 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
11794
11795
|
propValuesStr: JSON.stringify(this.pageComponentPropValues),
|
|
11795
11796
|
page: toJS(this.page) || null,
|
|
11796
11797
|
settingsStr: JSON.stringify(this.theme.settings || {}),
|
|
11797
|
-
merchantSettings:
|
|
11798
|
+
merchantSettings: this.merchantSettings
|
|
11799
|
+
? JSON.stringify(this.merchantSettings)
|
|
11800
|
+
: null,
|
|
11798
11801
|
},
|
|
11799
11802
|
};
|
|
11800
11803
|
},
|
|
@@ -11812,9 +11815,27 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
11812
11815
|
enumerable: false,
|
|
11813
11816
|
configurable: true
|
|
11814
11817
|
});
|
|
11818
|
+
IkasPageDataProvider.prototype.getMerchantSettings = function () {
|
|
11819
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11820
|
+
var merchantId, merchantSettingsResponse;
|
|
11821
|
+
return __generator(this, function (_a) {
|
|
11822
|
+
switch (_a.label) {
|
|
11823
|
+
case 0:
|
|
11824
|
+
merchantId = decodeBase64(IkasStorefrontConfig.config.apiKey || "");
|
|
11825
|
+
return [4 /*yield*/, IkasMerchantAPI.listMerchantSettings(merchantId)];
|
|
11826
|
+
case 1:
|
|
11827
|
+
merchantSettingsResponse = _a.sent();
|
|
11828
|
+
if (merchantSettingsResponse) {
|
|
11829
|
+
this.merchantSettings = merchantSettingsResponse;
|
|
11830
|
+
}
|
|
11831
|
+
return [2 /*return*/];
|
|
11832
|
+
}
|
|
11833
|
+
});
|
|
11834
|
+
});
|
|
11835
|
+
};
|
|
11815
11836
|
IkasPageDataProvider.prototype.getPageData = function () {
|
|
11816
11837
|
return __awaiter(this, void 0, void 0, function () {
|
|
11817
|
-
var
|
|
11838
|
+
var _a;
|
|
11818
11839
|
var _this = this;
|
|
11819
11840
|
return __generator(this, function (_b) {
|
|
11820
11841
|
switch (_b.label) {
|
|
@@ -11827,13 +11848,9 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
11827
11848
|
case 2:
|
|
11828
11849
|
if (!this.page)
|
|
11829
11850
|
return [2 /*return*/];
|
|
11830
|
-
|
|
11831
|
-
return [4 /*yield*/, IkasMerchantAPI.listMerchantSettings(merchantId)];
|
|
11851
|
+
return [4 /*yield*/, this.getMerchantSettings()];
|
|
11832
11852
|
case 3:
|
|
11833
|
-
|
|
11834
|
-
if (merchantSettingsResponse) {
|
|
11835
|
-
this.merchantSettings = merchantSettingsResponse;
|
|
11836
|
-
}
|
|
11853
|
+
_b.sent();
|
|
11837
11854
|
_a = this;
|
|
11838
11855
|
return [4 /*yield*/, Promise.all(this.page.components.map(function (pageComponent) {
|
|
11839
11856
|
return _this.getPageComponentPropValues(pageComponent);
|
|
@@ -24986,9 +25003,61 @@ var PolicyModal = observer(function (_a) {
|
|
|
24986
25003
|
});
|
|
24987
25004
|
|
|
24988
25005
|
var IkasPageHead = observer(function (_a) {
|
|
25006
|
+
var _b;
|
|
24989
25007
|
var page = _a.page, pageTitle = _a.pageTitle, description = _a.description, pageSpecificDataStr = _a.pageSpecificDataStr, props = __rest(_a, ["page", "pageTitle", "description", "pageSpecificDataStr"]);
|
|
25008
|
+
var ogpMetas = [];
|
|
24990
25009
|
var schemas = [];
|
|
25010
|
+
if (props.addOgpMetas) {
|
|
25011
|
+
ogpMetas.push({
|
|
25012
|
+
property: "og:type",
|
|
25013
|
+
content: "website",
|
|
25014
|
+
});
|
|
25015
|
+
if (typeof window !== "undefined") {
|
|
25016
|
+
ogpMetas.push({
|
|
25017
|
+
property: "og:site_name",
|
|
25018
|
+
content: "https://" + window.location.hostname,
|
|
25019
|
+
});
|
|
25020
|
+
}
|
|
25021
|
+
if (pageTitle) {
|
|
25022
|
+
ogpMetas.push({
|
|
25023
|
+
property: "og:title",
|
|
25024
|
+
content: pageTitle,
|
|
25025
|
+
});
|
|
25026
|
+
}
|
|
25027
|
+
if (description) {
|
|
25028
|
+
ogpMetas.push({
|
|
25029
|
+
property: "og:description",
|
|
25030
|
+
content: description,
|
|
25031
|
+
});
|
|
25032
|
+
}
|
|
25033
|
+
if (typeof window !== "undefined") {
|
|
25034
|
+
ogpMetas.push({
|
|
25035
|
+
property: "og:url",
|
|
25036
|
+
content: window.location.href,
|
|
25037
|
+
});
|
|
25038
|
+
}
|
|
25039
|
+
if (props.merchantSettings) {
|
|
25040
|
+
if (pageSpecificDataStr && (page === null || page === void 0 ? void 0 : page.type) === IkasThemePageType.PRODUCT) {
|
|
25041
|
+
var productDetailParsed = JSON.parse(pageSpecificDataStr);
|
|
25042
|
+
var productDetail = new IkasProductDetail(productDetailParsed.product, productDetailParsed.selectedVariantValues);
|
|
25043
|
+
if (productDetail.selectedVariant.mainImage) {
|
|
25044
|
+
ogpMetas.push({
|
|
25045
|
+
property: "og:image",
|
|
25046
|
+
content: (_b = productDetail.selectedVariant.mainImage) === null || _b === void 0 ? void 0 : _b.src,
|
|
25047
|
+
});
|
|
25048
|
+
}
|
|
25049
|
+
}
|
|
25050
|
+
else {
|
|
25051
|
+
var merchantSettings = new IkasMerchantSettings(JSON.parse(props.merchantSettings));
|
|
25052
|
+
ogpMetas.push({
|
|
25053
|
+
property: "og:image",
|
|
25054
|
+
content: merchantSettings.logo.src,
|
|
25055
|
+
});
|
|
25056
|
+
}
|
|
25057
|
+
}
|
|
25058
|
+
}
|
|
24991
25059
|
if (props.merchantSettings) {
|
|
25060
|
+
// for schema.org
|
|
24992
25061
|
var merchantSettings = new IkasMerchantSettings(JSON.parse(props.merchantSettings));
|
|
24993
25062
|
var websiteSchema = createWebsiteSchema();
|
|
24994
25063
|
var storeSchema = createStoreSchema(merchantSettings);
|
|
@@ -25013,12 +25082,14 @@ var IkasPageHead = observer(function (_a) {
|
|
|
25013
25082
|
return (createElement(Head, null,
|
|
25014
25083
|
createElement("title", null, pageTitle || ""),
|
|
25015
25084
|
createElement("meta", { name: "description", content: description || "" }),
|
|
25085
|
+
!!props.addOgpMetas &&
|
|
25086
|
+
ogpMetas.map(function (ogpMeta, index) { return (createElement("meta", { key: ogpMeta.content + "-" + index, property: ogpMeta.property, content: ogpMeta.content })); }),
|
|
25016
25087
|
!!schemas.length &&
|
|
25017
25088
|
schemas.map(function (schema, index) { return (createElement("script", { key: index, type: "application/ld+json", dangerouslySetInnerHTML: {
|
|
25018
25089
|
__html: JSON.stringify(schema),
|
|
25019
25090
|
} })); })));
|
|
25020
25091
|
});
|
|
25021
|
-
function createWebsiteSchema(
|
|
25092
|
+
function createWebsiteSchema() {
|
|
25022
25093
|
var _a;
|
|
25023
25094
|
var hostname = "";
|
|
25024
25095
|
if (typeof window !== "undefined") {
|
|
@@ -25290,7 +25361,7 @@ var ThemeComponent = observer(function (_a) {
|
|
|
25290
25361
|
|
|
25291
25362
|
var IkasPage = observer(function (_a) {
|
|
25292
25363
|
var _b, _c;
|
|
25293
|
-
var propValues = _a.propValues, page = _a.page, pageSpecificDataStr = _a.pageSpecificDataStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings;
|
|
25364
|
+
var propValues = _a.propValues, page = _a.page, pageSpecificDataStr = _a.pageSpecificDataStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings, addOgpMetas = _a.addOgpMetas;
|
|
25294
25365
|
var renderComponent = function (pageComponent, index) {
|
|
25295
25366
|
var pageComponentPropValue = propValues.find(function (pv) { return pv.pageComponent.id === pageComponent.id; });
|
|
25296
25367
|
return (createElement(ThemeComponent, { key: pageComponent.id, index: index, pageComponentPropValue: pageComponentPropValue, pageComponent: pageComponent, settingsStr: settingsStr }));
|
|
@@ -25303,7 +25374,7 @@ var IkasPage = observer(function (_a) {
|
|
|
25303
25374
|
if (!page)
|
|
25304
25375
|
return null;
|
|
25305
25376
|
return (createElement(Fragment, null,
|
|
25306
|
-
createElement(IkasPageHead, { page: page, pageTitle: page.pageTitle, description: page.description, pageSpecificDataStr: pageSpecificDataStr, merchantSettings: merchantSettings }),
|
|
25377
|
+
createElement(IkasPageHead, { page: page, pageTitle: page.pageTitle, description: page.description, pageSpecificDataStr: pageSpecificDataStr, merchantSettings: merchantSettings, addOgpMetas: addOgpMetas }),
|
|
25307
25378
|
createElement("div", { style: pageStyle },
|
|
25308
25379
|
createElement("div", null,
|
|
25309
25380
|
headerComponent && renderComponent(headerComponent, -1),
|
|
@@ -25565,7 +25636,7 @@ var PageViewModel = /** @class */ (function () {
|
|
|
25565
25636
|
_this.theme.components[index] = new IkasThemeComponent(data.component);
|
|
25566
25637
|
};
|
|
25567
25638
|
this.handleAddNewPageComponent = function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
25568
|
-
var pageComponent,
|
|
25639
|
+
var pageComponent, pageComponentPropValues;
|
|
25569
25640
|
var _this = this;
|
|
25570
25641
|
var _a;
|
|
25571
25642
|
return __generator(this, function (_b) {
|
|
@@ -25576,10 +25647,14 @@ var PageViewModel = /** @class */ (function () {
|
|
|
25576
25647
|
return [2 /*return*/];
|
|
25577
25648
|
return [4 /*yield*/, this.pageDataProvider.getPageComponentPropValues(pageComponent)];
|
|
25578
25649
|
case 1:
|
|
25579
|
-
|
|
25650
|
+
pageComponentPropValues = _b.sent();
|
|
25580
25651
|
runInAction(function () {
|
|
25581
25652
|
var _a;
|
|
25582
|
-
|
|
25653
|
+
var customDataProps = pageComponentPropValues.component.props.filter(function (p) { return p.type === IkasThemeComponentPropType.CUSTOM; });
|
|
25654
|
+
customDataProps.forEach(function (customDataProp) {
|
|
25655
|
+
IkasPageDataProvider.initCustomDataPropValue(customDataProp, pageComponentPropValues.propValues[customDataProp.name], pageComponentPropValues, _this.router, true);
|
|
25656
|
+
});
|
|
25657
|
+
_this.pageDataProvider.pageComponentPropValues.push(pageComponentPropValues);
|
|
25583
25658
|
(_a = _this.page) === null || _a === void 0 ? void 0 : _a.components.push(pageComponent);
|
|
25584
25659
|
});
|
|
25585
25660
|
return [2 /*return*/];
|
|
@@ -25792,7 +25867,7 @@ var Page = function (_a) {
|
|
|
25792
25867
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings;
|
|
25793
25868
|
var router = useRouter();
|
|
25794
25869
|
var propValues = IkasPageDataProvider.initPropValues(propValuesStr, router);
|
|
25795
|
-
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
25870
|
+
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
|
|
25796
25871
|
};
|
|
25797
25872
|
var getStaticProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
25798
25873
|
var theme, provider;
|
|
@@ -25828,7 +25903,7 @@ var Page$1 = function (_a) {
|
|
|
25828
25903
|
setPropValues(IkasPageDataProvider.initPropValues(propValuesStr, router, isBrowser));
|
|
25829
25904
|
}, [isBrowser, propValuesStr]);
|
|
25830
25905
|
handleGTM(page, pageSpecificDataStr);
|
|
25831
|
-
return (createElement(IkasPage, { page: page, propValues: propValues, pageSpecificDataStr: pageSpecificDataStr, settingsStr: settingsStr, merchantSettings: merchantSettings }));
|
|
25906
|
+
return (createElement(IkasPage, { page: page, propValues: propValues, pageSpecificDataStr: pageSpecificDataStr, settingsStr: settingsStr, merchantSettings: merchantSettings, addOgpMetas: true }));
|
|
25832
25907
|
};
|
|
25833
25908
|
var index$1 = observer(Page$1);
|
|
25834
25909
|
var getStaticPaths = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
package/build/index.js
CHANGED
|
@@ -11782,6 +11782,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
11782
11782
|
this.pageParams = {};
|
|
11783
11783
|
this.pageComponentPropValues = [];
|
|
11784
11784
|
this.pageSpecificData = null;
|
|
11785
|
+
this.merchantSettings = null;
|
|
11785
11786
|
this.theme = new IkasTheme(theme);
|
|
11786
11787
|
this.pageParams = pageParams || {};
|
|
11787
11788
|
this.pageType = pageType;
|
|
@@ -11806,7 +11807,9 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
11806
11807
|
propValuesStr: JSON.stringify(this.pageComponentPropValues),
|
|
11807
11808
|
page: mobx.toJS(this.page) || null,
|
|
11808
11809
|
settingsStr: JSON.stringify(this.theme.settings || {}),
|
|
11809
|
-
merchantSettings:
|
|
11810
|
+
merchantSettings: this.merchantSettings
|
|
11811
|
+
? JSON.stringify(this.merchantSettings)
|
|
11812
|
+
: null,
|
|
11810
11813
|
},
|
|
11811
11814
|
};
|
|
11812
11815
|
},
|
|
@@ -11824,9 +11827,27 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
11824
11827
|
enumerable: false,
|
|
11825
11828
|
configurable: true
|
|
11826
11829
|
});
|
|
11830
|
+
IkasPageDataProvider.prototype.getMerchantSettings = function () {
|
|
11831
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11832
|
+
var merchantId, merchantSettingsResponse;
|
|
11833
|
+
return __generator(this, function (_a) {
|
|
11834
|
+
switch (_a.label) {
|
|
11835
|
+
case 0:
|
|
11836
|
+
merchantId = decodeBase64(IkasStorefrontConfig.config.apiKey || "");
|
|
11837
|
+
return [4 /*yield*/, IkasMerchantAPI.listMerchantSettings(merchantId)];
|
|
11838
|
+
case 1:
|
|
11839
|
+
merchantSettingsResponse = _a.sent();
|
|
11840
|
+
if (merchantSettingsResponse) {
|
|
11841
|
+
this.merchantSettings = merchantSettingsResponse;
|
|
11842
|
+
}
|
|
11843
|
+
return [2 /*return*/];
|
|
11844
|
+
}
|
|
11845
|
+
});
|
|
11846
|
+
});
|
|
11847
|
+
};
|
|
11827
11848
|
IkasPageDataProvider.prototype.getPageData = function () {
|
|
11828
11849
|
return __awaiter(this, void 0, void 0, function () {
|
|
11829
|
-
var
|
|
11850
|
+
var _a;
|
|
11830
11851
|
var _this = this;
|
|
11831
11852
|
return __generator(this, function (_b) {
|
|
11832
11853
|
switch (_b.label) {
|
|
@@ -11839,13 +11860,9 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
11839
11860
|
case 2:
|
|
11840
11861
|
if (!this.page)
|
|
11841
11862
|
return [2 /*return*/];
|
|
11842
|
-
|
|
11843
|
-
return [4 /*yield*/, IkasMerchantAPI.listMerchantSettings(merchantId)];
|
|
11863
|
+
return [4 /*yield*/, this.getMerchantSettings()];
|
|
11844
11864
|
case 3:
|
|
11845
|
-
|
|
11846
|
-
if (merchantSettingsResponse) {
|
|
11847
|
-
this.merchantSettings = merchantSettingsResponse;
|
|
11848
|
-
}
|
|
11865
|
+
_b.sent();
|
|
11849
11866
|
_a = this;
|
|
11850
11867
|
return [4 /*yield*/, Promise.all(this.page.components.map(function (pageComponent) {
|
|
11851
11868
|
return _this.getPageComponentPropValues(pageComponent);
|
|
@@ -24967,9 +24984,61 @@ var PolicyModal = mobxReactLite.observer(function (_a) {
|
|
|
24967
24984
|
});
|
|
24968
24985
|
|
|
24969
24986
|
var IkasPageHead = mobxReactLite.observer(function (_a) {
|
|
24987
|
+
var _b;
|
|
24970
24988
|
var page = _a.page, pageTitle = _a.pageTitle, description = _a.description, pageSpecificDataStr = _a.pageSpecificDataStr, props = __rest(_a, ["page", "pageTitle", "description", "pageSpecificDataStr"]);
|
|
24989
|
+
var ogpMetas = [];
|
|
24971
24990
|
var schemas = [];
|
|
24991
|
+
if (props.addOgpMetas) {
|
|
24992
|
+
ogpMetas.push({
|
|
24993
|
+
property: "og:type",
|
|
24994
|
+
content: "website",
|
|
24995
|
+
});
|
|
24996
|
+
if (typeof window !== "undefined") {
|
|
24997
|
+
ogpMetas.push({
|
|
24998
|
+
property: "og:site_name",
|
|
24999
|
+
content: "https://" + window.location.hostname,
|
|
25000
|
+
});
|
|
25001
|
+
}
|
|
25002
|
+
if (pageTitle) {
|
|
25003
|
+
ogpMetas.push({
|
|
25004
|
+
property: "og:title",
|
|
25005
|
+
content: pageTitle,
|
|
25006
|
+
});
|
|
25007
|
+
}
|
|
25008
|
+
if (description) {
|
|
25009
|
+
ogpMetas.push({
|
|
25010
|
+
property: "og:description",
|
|
25011
|
+
content: description,
|
|
25012
|
+
});
|
|
25013
|
+
}
|
|
25014
|
+
if (typeof window !== "undefined") {
|
|
25015
|
+
ogpMetas.push({
|
|
25016
|
+
property: "og:url",
|
|
25017
|
+
content: window.location.href,
|
|
25018
|
+
});
|
|
25019
|
+
}
|
|
25020
|
+
if (props.merchantSettings) {
|
|
25021
|
+
if (pageSpecificDataStr && (page === null || page === void 0 ? void 0 : page.type) === exports.IkasThemePageType.PRODUCT) {
|
|
25022
|
+
var productDetailParsed = JSON.parse(pageSpecificDataStr);
|
|
25023
|
+
var productDetail = new IkasProductDetail(productDetailParsed.product, productDetailParsed.selectedVariantValues);
|
|
25024
|
+
if (productDetail.selectedVariant.mainImage) {
|
|
25025
|
+
ogpMetas.push({
|
|
25026
|
+
property: "og:image",
|
|
25027
|
+
content: (_b = productDetail.selectedVariant.mainImage) === null || _b === void 0 ? void 0 : _b.src,
|
|
25028
|
+
});
|
|
25029
|
+
}
|
|
25030
|
+
}
|
|
25031
|
+
else {
|
|
25032
|
+
var merchantSettings = new IkasMerchantSettings(JSON.parse(props.merchantSettings));
|
|
25033
|
+
ogpMetas.push({
|
|
25034
|
+
property: "og:image",
|
|
25035
|
+
content: merchantSettings.logo.src,
|
|
25036
|
+
});
|
|
25037
|
+
}
|
|
25038
|
+
}
|
|
25039
|
+
}
|
|
24972
25040
|
if (props.merchantSettings) {
|
|
25041
|
+
// for schema.org
|
|
24973
25042
|
var merchantSettings = new IkasMerchantSettings(JSON.parse(props.merchantSettings));
|
|
24974
25043
|
var websiteSchema = createWebsiteSchema();
|
|
24975
25044
|
var storeSchema = createStoreSchema(merchantSettings);
|
|
@@ -24994,12 +25063,14 @@ var IkasPageHead = mobxReactLite.observer(function (_a) {
|
|
|
24994
25063
|
return (React.createElement(Head__default['default'], null,
|
|
24995
25064
|
React.createElement("title", null, pageTitle || ""),
|
|
24996
25065
|
React.createElement("meta", { name: "description", content: description || "" }),
|
|
25066
|
+
!!props.addOgpMetas &&
|
|
25067
|
+
ogpMetas.map(function (ogpMeta, index) { return (React.createElement("meta", { key: ogpMeta.content + "-" + index, property: ogpMeta.property, content: ogpMeta.content })); }),
|
|
24997
25068
|
!!schemas.length &&
|
|
24998
25069
|
schemas.map(function (schema, index) { return (React.createElement("script", { key: index, type: "application/ld+json", dangerouslySetInnerHTML: {
|
|
24999
25070
|
__html: JSON.stringify(schema),
|
|
25000
25071
|
} })); })));
|
|
25001
25072
|
});
|
|
25002
|
-
function createWebsiteSchema(
|
|
25073
|
+
function createWebsiteSchema() {
|
|
25003
25074
|
var _a;
|
|
25004
25075
|
var hostname = "";
|
|
25005
25076
|
if (typeof window !== "undefined") {
|
|
@@ -25271,7 +25342,7 @@ var ThemeComponent = mobxReactLite.observer(function (_a) {
|
|
|
25271
25342
|
|
|
25272
25343
|
var IkasPage = mobxReactLite.observer(function (_a) {
|
|
25273
25344
|
var _b, _c;
|
|
25274
|
-
var propValues = _a.propValues, page = _a.page, pageSpecificDataStr = _a.pageSpecificDataStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings;
|
|
25345
|
+
var propValues = _a.propValues, page = _a.page, pageSpecificDataStr = _a.pageSpecificDataStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings, addOgpMetas = _a.addOgpMetas;
|
|
25275
25346
|
var renderComponent = function (pageComponent, index) {
|
|
25276
25347
|
var pageComponentPropValue = propValues.find(function (pv) { return pv.pageComponent.id === pageComponent.id; });
|
|
25277
25348
|
return (React.createElement(ThemeComponent, { key: pageComponent.id, index: index, pageComponentPropValue: pageComponentPropValue, pageComponent: pageComponent, settingsStr: settingsStr }));
|
|
@@ -25284,7 +25355,7 @@ var IkasPage = mobxReactLite.observer(function (_a) {
|
|
|
25284
25355
|
if (!page)
|
|
25285
25356
|
return null;
|
|
25286
25357
|
return (React.createElement(React.Fragment, null,
|
|
25287
|
-
React.createElement(IkasPageHead, { page: page, pageTitle: page.pageTitle, description: page.description, pageSpecificDataStr: pageSpecificDataStr, merchantSettings: merchantSettings }),
|
|
25358
|
+
React.createElement(IkasPageHead, { page: page, pageTitle: page.pageTitle, description: page.description, pageSpecificDataStr: pageSpecificDataStr, merchantSettings: merchantSettings, addOgpMetas: addOgpMetas }),
|
|
25288
25359
|
React.createElement("div", { style: pageStyle },
|
|
25289
25360
|
React.createElement("div", null,
|
|
25290
25361
|
headerComponent && renderComponent(headerComponent, -1),
|
|
@@ -25546,7 +25617,7 @@ var PageViewModel = /** @class */ (function () {
|
|
|
25546
25617
|
_this.theme.components[index] = new IkasThemeComponent(data.component);
|
|
25547
25618
|
};
|
|
25548
25619
|
this.handleAddNewPageComponent = function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
25549
|
-
var pageComponent,
|
|
25620
|
+
var pageComponent, pageComponentPropValues;
|
|
25550
25621
|
var _this = this;
|
|
25551
25622
|
var _a;
|
|
25552
25623
|
return __generator(this, function (_b) {
|
|
@@ -25557,10 +25628,14 @@ var PageViewModel = /** @class */ (function () {
|
|
|
25557
25628
|
return [2 /*return*/];
|
|
25558
25629
|
return [4 /*yield*/, this.pageDataProvider.getPageComponentPropValues(pageComponent)];
|
|
25559
25630
|
case 1:
|
|
25560
|
-
|
|
25631
|
+
pageComponentPropValues = _b.sent();
|
|
25561
25632
|
mobx.runInAction(function () {
|
|
25562
25633
|
var _a;
|
|
25563
|
-
|
|
25634
|
+
var customDataProps = pageComponentPropValues.component.props.filter(function (p) { return p.type === exports.IkasThemeComponentPropType.CUSTOM; });
|
|
25635
|
+
customDataProps.forEach(function (customDataProp) {
|
|
25636
|
+
IkasPageDataProvider.initCustomDataPropValue(customDataProp, pageComponentPropValues.propValues[customDataProp.name], pageComponentPropValues, _this.router, true);
|
|
25637
|
+
});
|
|
25638
|
+
_this.pageDataProvider.pageComponentPropValues.push(pageComponentPropValues);
|
|
25564
25639
|
(_a = _this.page) === null || _a === void 0 ? void 0 : _a.components.push(pageComponent);
|
|
25565
25640
|
});
|
|
25566
25641
|
return [2 /*return*/];
|
|
@@ -25773,7 +25848,7 @@ var Page = function (_a) {
|
|
|
25773
25848
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings;
|
|
25774
25849
|
var router$1 = router.useRouter();
|
|
25775
25850
|
var propValues = IkasPageDataProvider.initPropValues(propValuesStr, router$1);
|
|
25776
|
-
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
25851
|
+
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
|
|
25777
25852
|
};
|
|
25778
25853
|
var getStaticProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
25779
25854
|
var theme, provider;
|
|
@@ -25809,7 +25884,7 @@ var Page$1 = function (_a) {
|
|
|
25809
25884
|
setPropValues(IkasPageDataProvider.initPropValues(propValuesStr, router$1, isBrowser));
|
|
25810
25885
|
}, [isBrowser, propValuesStr]);
|
|
25811
25886
|
handleGTM(page, pageSpecificDataStr);
|
|
25812
|
-
return (React.createElement(IkasPage, { page: page, propValues: propValues, pageSpecificDataStr: pageSpecificDataStr, settingsStr: settingsStr, merchantSettings: merchantSettings }));
|
|
25887
|
+
return (React.createElement(IkasPage, { page: page, propValues: propValues, pageSpecificDataStr: pageSpecificDataStr, settingsStr: settingsStr, merchantSettings: merchantSettings, addOgpMetas: true }));
|
|
25813
25888
|
};
|
|
25814
25889
|
var index$1 = mobxReactLite.observer(Page$1);
|
|
25815
25890
|
var getStaticPaths = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -10,7 +10,7 @@ export declare class IkasPageDataProvider {
|
|
|
10
10
|
pageParams: Record<string, any>;
|
|
11
11
|
pageComponentPropValues: IkasPageComponentPropValue[];
|
|
12
12
|
pageSpecificData?: any | null;
|
|
13
|
-
merchantSettings?: IkasMerchantSettings;
|
|
13
|
+
merchantSettings?: IkasMerchantSettings | null;
|
|
14
14
|
constructor(theme: IkasTheme, pageParams?: Record<string, any>, pageType?: IkasThemePageType);
|
|
15
15
|
get page(): IkasThemePage | undefined;
|
|
16
16
|
get nextPageData(): {
|
|
@@ -18,10 +18,11 @@ export declare class IkasPageDataProvider {
|
|
|
18
18
|
propValuesStr: string;
|
|
19
19
|
page: IkasThemePage | null;
|
|
20
20
|
settingsStr: string;
|
|
21
|
-
merchantSettings: string;
|
|
21
|
+
merchantSettings: string | null;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
get isStaticPage(): boolean | null | undefined;
|
|
25
|
+
getMerchantSettings(): Promise<void>;
|
|
25
26
|
getPageData(): Promise<void>;
|
|
26
27
|
getPageSpecificData(): Promise<void>;
|
|
27
28
|
getPageSpecificProduct(): Promise<void>;
|