@ikas/storefront 4.13.6 → 4.13.7
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/store/base.js +1 -1
- package/package.json +11 -11
package/build/store/base.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as o,__generator as t}from'./../ext/tslib/tslib.es6.js';import{configure as
|
|
1
|
+
import{__awaiter as o,__generator as t}from'./../ext/tslib/tslib.es6.js';import{configure as i,makeObservable as n,observable as e}from"mobx";import{enableStaticRendering as r}from"mobx-react-lite";import s from"lodash/sortBy";import a from"lodash/flatten";import{IkasCartStore as c}from"./cart/index.js";import{IkasCustomerStore as u}from"./customer/index.js";import l from"./location/index.js";import{IkasThemeJsonPageType as d}from"@ikas/storefront-models";import{IkasStorefrontConfig as h}from"@ikas/storefront-config";import{IkasPageDataInit as p}from"../page-data-init/index.js";i({enforceActions:"never"}),r("undefined"==typeof window);var g=function(){function i(){this.currentPageType=null,this.localeOptions=[],this.languageOptions=[],this.showLocaleOptions=!1,this.currentCountryCode=null,this.spaLinksDisabled=!1,this.localeChecked=!1,this.customerStore=new u(this),this.cartStore=new c(this),"undefined"!=typeof window&&(this.spaLinksDisabled=navigator.userAgent.includes("Instagram")),this.init(),n(this,{currentPageType:e,localeOptions:e,languageOptions:e,showLocaleOptions:e,currentCountryCode:e,spaLinksDisabled:e})}return i.getInstance=function(){return this._instance||(this._instance=new i),this._instance},i.prototype.setLocalization=function(o){o.routing.domain?window.location.replace("https://"+o.routing.domain):window.location.replace(window.location.origin+(o.routing.path?"/"+o.routing.path:"")+(this.router?this.router.asPath:""))},i.prototype.setLanguage=function(o){var t,i,n=h.getRoutings().find((function(t){return t.id===o.id}));if(n)if(this.currentPageType===d.CATEGORY||this.currentPageType===d.BRAND||this.currentPageType===d.PRODUCT){var e=null===(i=null===(t=p.pageSpecificData.metaData)||void 0===t?void 0:t.translations)||void 0===i?void 0:i.find((function(o){return o.locale===n.locale}));if(e&&(null==e?void 0:e.slug)){var r="";r=n.path?"".concat(window.location.origin,"/").concat(n.path,"/").concat(e.slug):"".concat(window.location.origin,"/").concat(e.slug),window.location.replace(r)}else window.location.replace(window.location.origin+(n.path?"/"+n.path:"")+(this.router?this.router.asPath:""))}else window.location.replace(window.location.origin+(n.path?"/"+n.path:"")+(this.router?this.router.asPath:""))},i.prototype.checkLocalization=function(){return o(this,void 0,void 0,(function(){var o,i,n,e,r,c,u,d,p,g,f;return t(this,(function(t){switch(t.label){case 0:return this.localeChecked?[2]:"undefined"==typeof window?(console.warn("checkLocalization should be called on the client side!"),[2]):[4,l.getMyCountry()];case 1:return(o=t.sent()).isSuccess?(i=o.data,n=h.getCurrentRouting(),this.currentCountryCode=i,n&&i?(e=!0,r=h.getRoutings().filter((function(o){var t;return null===(t=o.countryCodes)||void 0===t?void 0:t.includes(i)})),c=h.getRoutings().find((function(o){var t;return!(null===(t=o.countryCodes)||void 0===t?void 0:t.length)})),r.length?r.some((function(o){return o.id===n.id}))||(e=!1):c&&n.id!==c.id&&(e=!1),u=[],d=[],p=a(h.getRoutings().map((function(o){return o.countryCodes||[]}))),[4,l.listCountry({iso2:{in:p}})]):[3,3]):[2];case 2:if(!(g=t.sent()).isSuccess)return[2];f=g.data||[],h.getRoutings().forEach((function(o){var t;(null===(t=o.countryCodes)||void 0===t?void 0:t.length)?o.countryCodes.forEach((function(t){var n=f.find((function(o){return o.iso2===t}));u.some((function(o){return o.iso2===(null==n?void 0:n.iso2)}))||u.push({id:(null==n?void 0:n.iso2)||(null==n?void 0:n.iso3)||Date.now()+"",countryName:(null==n?void 0:n.native)||(null==n?void 0:n.name)||"",iso2:(null==n?void 0:n.iso2)||void 0,iso3:(null==n?void 0:n.iso3)||void 0,routing:o,isRecommended:t===i})})):u.push({id:o.id,routing:o,isRecommended:!h.getRoutings().some((function(o){var t;return null===(t=o.countryCodes)||void 0===t?void 0:t.includes(i)}))})})),r.length&&(h.getRoutings().forEach((function(o){var t;r.some((function(t){return t.id===o.id}))&&d.push({id:o.id,currencyCode:o.currencyCode,currencySymbol:o.currencySymbol,language:"undefined"!=typeof Intl&&void 0!==Intl.DisplayNames&&new Intl.DisplayNames([],{type:"language"}).of(o.locale)||o.locale,locale:o.locale,isSelected:o.id===(null===(t=h.getCurrentRouting())||void 0===t?void 0:t.id)||!1})})),this.languageOptions=s(d,"language")),this.localeOptions=s(u,"countryName"),e||(this.showLocaleOptions=!0),this.localeChecked=!0,t.label=3;case 3:return[2]}}))}))},i.prototype.init=function(){this.customerStore.init()},i}();export{g as IkasBaseStore};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.7",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"build": "rm -rf build && rollup -c"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@ikas/storefront-api": "^4.13.
|
|
21
|
-
"@ikas/storefront-config": "^4.13.
|
|
22
|
-
"@ikas/storefront-model-functions": "^4.13.
|
|
23
|
-
"@ikas/storefront-models": "^4.13.
|
|
24
|
-
"@ikas/storefront-providers": "^4.13.
|
|
20
|
+
"@ikas/storefront-api": "^4.13.7",
|
|
21
|
+
"@ikas/storefront-config": "^4.13.7",
|
|
22
|
+
"@ikas/storefront-model-functions": "^4.13.7",
|
|
23
|
+
"@ikas/storefront-models": "^4.13.7",
|
|
24
|
+
"@ikas/storefront-providers": "^4.13.7",
|
|
25
25
|
"@ikas/localized-address": "^1.0.0-beta.3",
|
|
26
26
|
"@adyen/adyen-web": "^5.28.2",
|
|
27
27
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@ikas/localized-address": "^1.0.0-beta.3",
|
|
58
|
-
"@ikas/storefront-api": "^4.13.
|
|
59
|
-
"@ikas/storefront-config": "^4.13.
|
|
60
|
-
"@ikas/storefront-model-functions": "^4.13.
|
|
61
|
-
"@ikas/storefront-models": "^4.13.
|
|
62
|
-
"@ikas/storefront-providers": "^4.13.
|
|
58
|
+
"@ikas/storefront-api": "^4.13.7",
|
|
59
|
+
"@ikas/storefront-config": "^4.13.7",
|
|
60
|
+
"@ikas/storefront-model-functions": "^4.13.7",
|
|
61
|
+
"@ikas/storefront-models": "^4.13.7",
|
|
62
|
+
"@ikas/storefront-providers": "^4.13.7",
|
|
63
63
|
"mobx": "^6.1.3",
|
|
64
64
|
"mobx-react-lite": "^3.1.5",
|
|
65
65
|
"next": "12.2.0",
|