@ikas/storefront-providers 4.0.17 → 4.0.18
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as n}from'./../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as i}from"@ikas/storefront-models";import{IkasLinkType as
|
|
1
|
+
import{__awaiter as e,__generator as n}from'./../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as i}from"@ikas/storefront-models";import{IkasLinkType as a}from"../../models/prop-value/link.js";var t=function(){function t(e,n,i){this.linkPropValue=e,this.theme=n,this.linkMetaDataTargetIds=i}return t.prototype.getNavigationLink=function(t){var s,r;return e(this,void 0,void 0,(function(){var e,o,u,p,b,h,f,c,d=this;return n(this,(function(n){switch(n.label){case 0:return t.linkType===a.PAGE?t.pageType===i.INDEX?e=new l({href:"/",label:t.label||"",subLinks:[]}):t.pageType===i.ACCOUNT?e=new l({href:"/account",label:t.label||"",subLinks:[]}):t.pageType===i.ADDRESSES?e=new l({href:"/account/addresses",label:t.label||"",subLinks:[]}):t.pageType===i.ORDERS?e=new l({href:"/account/orders",label:t.label||"",subLinks:[]}):t.pageType===i.FAVORITE_PRODUCTS?e=new l({href:"/account/favorite-products",label:t.label||"",subLinks:[]}):t.pageType===i.LOGIN?e=new l({href:"/account/login",label:t.label||"",subLinks:[]}):t.pageType===i.REGISTER?e=new l({href:"/account/register",label:t.label||"",subLinks:[]}):t.pageType===i.FORGOT_PASSWORD?e=new l({href:"/account/forgot-password",label:t.label||"",subLinks:[]}):t.pageType===i.RECOVER_PASSWORD?e=new l({href:"/account/recover-password",label:t.label||"",subLinks:[]}):t.pageType===i.BLOG_INDEX?e=new l({href:"/blog",label:t.label||"",subLinks:[]}):t.pageType===i.CART?e=new l({href:"/cart",label:t.label||"",subLinks:[]}):t.pageType===i.SEARCH?e=new l({href:"/search",label:t.label||"",subLinks:[]}):t.pageType===i.CUSTOM?(o=this.theme.pages.find((function(e){return e.id===t.pageId})))&&(e=new l({href:"/pages/"+o.slug,label:t.label||"",subLinks:[]})):[i.PRODUCT,i.BRAND,i.CATEGORY].includes(t.pageType)?t.itemId&&(e=new l({href:"/",label:t.label||"",subLinks:[]}),this.linkMetaDataTargetIds.push({type:"DEFAULT",id:t.itemId,navigationLink:e})):[i.BLOG,i.BLOG_CATEGORY].includes(t.pageType)?t.itemId&&(e=new l({href:"/blog/",label:t.label||"",subLinks:[]}),this.linkMetaDataTargetIds.push({type:"BLOG",id:t.itemId,navigationLink:e})):t.pageType===i.RAFFLE?e=new l({href:"/raffle/",label:t.label||"",subLinks:[]}):t.pageType===i.RAFFLE_DETAIL?t.itemId&&(e=new l({href:"/raffle/",label:t.label||"",subLinks:[]}),this.linkMetaDataTargetIds.push({type:"RAFFLE",id:t.itemId,navigationLink:e})):t.pageType===i.RAFFLE_ACCOUNT&&(e=new l({href:"/account/raffles",label:t.label||"",subLinks:[]})):t.linkType===a.EXTERNAL&&(e=new l({href:t.externalLink||"",label:t.label||"",subLinks:[],isExternal:!0})),e?(u=e,[4,Promise.all(t.subLinks.map((function(e){return d.getNavigationLink(e)})))]):[3,2];case 1:return u.subLinks=n.sent(),t.pageComponentId&&t.pageId&&(p=this.theme.pages.find((function(e){return e.id===t.pageId})),b=null===(s=this.theme.components.find((function(e){return e.isHeader})))||void 0===s?void 0:s.id,h=null===(r=this.theme.components.find((function(e){return e.isFooter})))||void 0===r?void 0:r.id,f=(null==p?void 0:p.components.filter((function(e){return e.componentId!==b&&e.componentId!==h})))||[],-1!==(c=f.findIndex((function(e){return e.id===t.pageComponentId})))&&(e.href+="#"+c)),[2,e];case 2:return[2,new l({href:"",label:"",subLinks:[]})]}}))}))},t.prototype.getValue=function(){return e(this,void 0,void 0,(function(){var e=this;return n(this,(function(n){switch(n.label){case 0:return Array.isArray(this.linkPropValue)?[4,Promise.all(this.linkPropValue.map((function(n){return e.getNavigationLink(n)})))]:[3,2];case 1:case 3:return[2,n.sent()];case 2:return[4,this.getNavigationLink(this.linkPropValue)]}}))}))},t}(),l=function(e){this.href=e.href,this.label=e.label,this.subLinks=e.subLinks,this.isExternal=e.isExternal,this.itemId=e.itemId};export{t as IkasLinkPropValueProvider,l as NavigationLink};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront-providers",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.18",
|
|
4
4
|
"description": "Data providers for ikas storefront theme components.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
20
|
-
"@ikas/storefront-api": "^4.0.
|
|
21
|
-
"@ikas/storefront-config": "^4.0.
|
|
22
|
-
"@ikas/storefront-model-functions": "^4.0.
|
|
23
|
-
"@ikas/storefront-models": "^4.0.
|
|
20
|
+
"@ikas/storefront-api": "^4.0.18",
|
|
21
|
+
"@ikas/storefront-config": "^4.0.18",
|
|
22
|
+
"@ikas/storefront-model-functions": "^4.0.18",
|
|
23
|
+
"@ikas/storefront-models": "^4.0.18",
|
|
24
24
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
25
25
|
"rollup-plugin-rename-node-modules": "^1.2.0",
|
|
26
26
|
"@types/lodash": "^4.14.168",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"mobx": "^6.1.3",
|
|
41
|
-
"@ikas/storefront-api": "^4.0.
|
|
42
|
-
"@ikas/storefront-config": "^4.0.
|
|
43
|
-
"@ikas/storefront-model-functions": "^4.0.
|
|
44
|
-
"@ikas/storefront-models": "^4.0.
|
|
41
|
+
"@ikas/storefront-api": "^4.0.18",
|
|
42
|
+
"@ikas/storefront-config": "^4.0.18",
|
|
43
|
+
"@ikas/storefront-model-functions": "^4.0.18",
|
|
44
|
+
"@ikas/storefront-models": "^4.0.18",
|
|
45
45
|
"lodash": "^4.17.21"
|
|
46
46
|
}
|
|
47
47
|
}
|