@ikas/storefront 0.0.160-alpha.4 → 0.0.160-alpha.5

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
@@ -1,5 +1,5 @@
1
1
  import { makeAutoObservable, runInAction, reaction, makeObservable, computed, observable, action, toJS, configure } from 'mobx';
2
- import React, { createElement, Fragment, useState, useEffect, useCallback, useRef, useMemo } from 'react';
2
+ import React, { createElement, Fragment, useEffect, useState, useCallback, useRef, useMemo } from 'react';
3
3
  import { observer } from 'mobx-react-lite';
4
4
  import Head from 'next/head';
5
5
  import { useRouter } from 'next/router';
@@ -25231,7 +25231,7 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
25231
25231
  switch (_b.label) {
25232
25232
  case 0:
25233
25233
  if (this.value === undefined || this.value === null)
25234
- return [2 /*return*/];
25234
+ return [2 /*return*/, { value: null, customData: this.customData }];
25235
25235
  _b.label = 1;
25236
25236
  case 1:
25237
25237
  _b.trys.push([1, 48, , 49]);
@@ -25737,6 +25737,8 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
25737
25737
  value: null,
25738
25738
  customData: this.customData,
25739
25739
  }];
25740
+ selectedCustomData = new IkasThemeCustomData(cloneDeep_1(selectedCustomData));
25741
+ selectedCustomData.isRequired = this.customData.isRequired;
25740
25742
  nestedProvider = new IkasCustomPropValueProvider(this.value, selectedCustomData, this.theme, this.pageType, this.pageDataProvider, this.pageSpecificData);
25741
25743
  return [4 /*yield*/, nestedProvider.getValue()];
25742
25744
  case 1: return [2 /*return*/, _a.sent()];
@@ -25870,16 +25872,17 @@ var ThemeComponent = observer(function (_a) {
25870
25872
  });
25871
25873
 
25872
25874
  var IkasPageHead = observer(function (_a) {
25873
- var _b, _c;
25875
+ var _b;
25874
25876
  var page = _a.page, pageTitle = _a.pageTitle, description = _a.description, pageSpecificDataStr = _a.pageSpecificDataStr, props = __rest(_a, ["page", "pageTitle", "description", "pageSpecificDataStr"]);
25875
25877
  var ogpMetas = [];
25876
25878
  var schemas = [];
25877
25879
  var isCanonicalLinkAdd = false;
25878
25880
  var canonicalHref = "";
25879
- if (typeof window !== "undefined") {
25881
+ useEffect(function () {
25882
+ var _a;
25880
25883
  document.documentElement.lang =
25881
- ((_b = IkasStorefrontConfig.routings.find(function (r) { return r.id === IkasStorefrontConfig.storefrontRoutingId; })) === null || _b === void 0 ? void 0 : _b.locale) || "tr";
25882
- }
25884
+ ((_a = IkasStorefrontConfig.routings.find(function (r) { return r.id === IkasStorefrontConfig.storefrontRoutingId; })) === null || _a === void 0 ? void 0 : _a.locale) || "tr";
25885
+ }, []);
25883
25886
  if (props.addOgpMetas) {
25884
25887
  ogpMetas.push({
25885
25888
  property: "og:type",
@@ -25916,7 +25919,7 @@ var IkasPageHead = observer(function (_a) {
25916
25919
  if (productDetail.selectedVariant.mainImage) {
25917
25920
  ogpMetas.push({
25918
25921
  property: "og:image",
25919
- content: (_c = productDetail.selectedVariant.mainImage) === null || _c === void 0 ? void 0 : _c.src,
25922
+ content: (_b = productDetail.selectedVariant.mainImage) === null || _b === void 0 ? void 0 : _b.src,
25920
25923
  });
25921
25924
  }
25922
25925
  }
@@ -26108,8 +26111,8 @@ function styleInject(css, ref) {
26108
26111
  }
26109
26112
  }
26110
26113
 
26111
- var css_248z = ".style-module_IkasPage__ATOib {\n position: relative;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n visibility: hidden; }\n .style-module_IkasPage__ATOib.style-module_Visible__gfjnC {\n visibility: visible; }\n";
26112
- var styles = {"IkasPage":"style-module_IkasPage__ATOib","Visible":"style-module_Visible__gfjnC"};
26114
+ var css_248z = ".style-module_IkasPage__ATOib {\n position: relative;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n visibility: hidden; }\n";
26115
+ var styles = {"IkasPage":"style-module_IkasPage__ATOib"};
26113
26116
  styleInject(css_248z);
26114
26117
 
26115
26118
  var IkasPage = observer(function (_a) {
@@ -26131,11 +26134,14 @@ var IkasPage = observer(function (_a) {
26131
26134
  var headerComponentPropValue = propValues.find(function (pv) { return pv.component.isHeader; });
26132
26135
  var footerComponentPropValue = propValues.find(function (pv) { return pv.component.isFooter; });
26133
26136
  var others = propValues.filter(function (pv) { return !pv.component.isHeader && !pv.component.isFooter; }) || [];
26137
+ var visibilityStyle = {
26138
+ visibility: mounted ? "visible" : "hidden",
26139
+ };
26134
26140
  if (!page)
26135
26141
  return null;
26136
26142
  return (createElement(Fragment, null,
26137
26143
  createElement(IkasPageHead, { page: page, pageTitle: page.pageTitle, description: page.description, pageSpecificDataStr: pageSpecificDataStr, merchantSettings: merchantSettings, addOgpMetas: addOgpMetas }),
26138
- createElement("div", { className: [styles.IkasPage, mounted ? styles.Visible : ""].join(" ") },
26144
+ createElement("div", { style: visibilityStyle, className: styles.IkasPage },
26139
26145
  createElement("div", null,
26140
26146
  headerComponentPropValue &&
26141
26147
  renderComponent(headerComponentPropValue, settings, -1),
package/build/index.js CHANGED
@@ -25210,7 +25210,7 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
25210
25210
  switch (_b.label) {
25211
25211
  case 0:
25212
25212
  if (this.value === undefined || this.value === null)
25213
- return [2 /*return*/];
25213
+ return [2 /*return*/, { value: null, customData: this.customData }];
25214
25214
  _b.label = 1;
25215
25215
  case 1:
25216
25216
  _b.trys.push([1, 48, , 49]);
@@ -25716,6 +25716,8 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
25716
25716
  value: null,
25717
25717
  customData: this.customData,
25718
25718
  }];
25719
+ selectedCustomData = new IkasThemeCustomData(cloneDeep_1(selectedCustomData));
25720
+ selectedCustomData.isRequired = this.customData.isRequired;
25719
25721
  nestedProvider = new IkasCustomPropValueProvider(this.value, selectedCustomData, this.theme, this.pageType, this.pageDataProvider, this.pageSpecificData);
25720
25722
  return [4 /*yield*/, nestedProvider.getValue()];
25721
25723
  case 1: return [2 /*return*/, _a.sent()];
@@ -25849,16 +25851,17 @@ var ThemeComponent = mobxReactLite.observer(function (_a) {
25849
25851
  });
25850
25852
 
25851
25853
  var IkasPageHead = mobxReactLite.observer(function (_a) {
25852
- var _b, _c;
25854
+ var _b;
25853
25855
  var page = _a.page, pageTitle = _a.pageTitle, description = _a.description, pageSpecificDataStr = _a.pageSpecificDataStr, props = __rest(_a, ["page", "pageTitle", "description", "pageSpecificDataStr"]);
25854
25856
  var ogpMetas = [];
25855
25857
  var schemas = [];
25856
25858
  var isCanonicalLinkAdd = false;
25857
25859
  var canonicalHref = "";
25858
- if (typeof window !== "undefined") {
25860
+ React.useEffect(function () {
25861
+ var _a;
25859
25862
  document.documentElement.lang =
25860
- ((_b = IkasStorefrontConfig.routings.find(function (r) { return r.id === IkasStorefrontConfig.storefrontRoutingId; })) === null || _b === void 0 ? void 0 : _b.locale) || "tr";
25861
- }
25863
+ ((_a = IkasStorefrontConfig.routings.find(function (r) { return r.id === IkasStorefrontConfig.storefrontRoutingId; })) === null || _a === void 0 ? void 0 : _a.locale) || "tr";
25864
+ }, []);
25862
25865
  if (props.addOgpMetas) {
25863
25866
  ogpMetas.push({
25864
25867
  property: "og:type",
@@ -25895,7 +25898,7 @@ var IkasPageHead = mobxReactLite.observer(function (_a) {
25895
25898
  if (productDetail.selectedVariant.mainImage) {
25896
25899
  ogpMetas.push({
25897
25900
  property: "og:image",
25898
- content: (_c = productDetail.selectedVariant.mainImage) === null || _c === void 0 ? void 0 : _c.src,
25901
+ content: (_b = productDetail.selectedVariant.mainImage) === null || _b === void 0 ? void 0 : _b.src,
25899
25902
  });
25900
25903
  }
25901
25904
  }
@@ -26087,8 +26090,8 @@ function styleInject(css, ref) {
26087
26090
  }
26088
26091
  }
26089
26092
 
26090
- var css_248z = ".style-module_IkasPage__ATOib {\n position: relative;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n visibility: hidden; }\n .style-module_IkasPage__ATOib.style-module_Visible__gfjnC {\n visibility: visible; }\n";
26091
- var styles = {"IkasPage":"style-module_IkasPage__ATOib","Visible":"style-module_Visible__gfjnC"};
26093
+ var css_248z = ".style-module_IkasPage__ATOib {\n position: relative;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n visibility: hidden; }\n";
26094
+ var styles = {"IkasPage":"style-module_IkasPage__ATOib"};
26092
26095
  styleInject(css_248z);
26093
26096
 
26094
26097
  var IkasPage = mobxReactLite.observer(function (_a) {
@@ -26110,11 +26113,14 @@ var IkasPage = mobxReactLite.observer(function (_a) {
26110
26113
  var headerComponentPropValue = propValues.find(function (pv) { return pv.component.isHeader; });
26111
26114
  var footerComponentPropValue = propValues.find(function (pv) { return pv.component.isFooter; });
26112
26115
  var others = propValues.filter(function (pv) { return !pv.component.isHeader && !pv.component.isFooter; }) || [];
26116
+ var visibilityStyle = {
26117
+ visibility: mounted ? "visible" : "hidden",
26118
+ };
26113
26119
  if (!page)
26114
26120
  return null;
26115
26121
  return (React.createElement(React.Fragment, null,
26116
26122
  React.createElement(IkasPageHead, { page: page, pageTitle: page.pageTitle, description: page.description, pageSpecificDataStr: pageSpecificDataStr, merchantSettings: merchantSettings, addOgpMetas: addOgpMetas }),
26117
- React.createElement("div", { className: [styles.IkasPage, mounted ? styles.Visible : ""].join(" ") },
26123
+ React.createElement("div", { style: visibilityStyle, className: styles.IkasPage },
26118
26124
  React.createElement("div", null,
26119
26125
  headerComponentPropValue &&
26120
26126
  renderComponent(headerComponentPropValue, settings, -1),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.160-alpha.4",
3
+ "version": "0.0.160-alpha.5",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",