@ikas/storefront-providers 5.0.0-beta.2 → 5.0.0-beta.20
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 t}from'./../../../ext/tslib/tslib.es6.js';import{listStorefrontRaffle as i}from"@ikas/storefront-api";import{IkasStorefrontConfig as
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../../ext/tslib/tslib.es6.js';import{listStorefrontRaffle as i}from"@ikas/storefront-api";import{IkasStorefrontConfig as n}from"@ikas/storefront-config";import{IkasRaffleFunctions as r}from"@ikas/storefront-model-functions";import{populateRaffleProducts as o}from"../../../providers/helpers/raffle.js";function a(i){var n,r;return e(this,void 0,void 0,(function(){var e,o;return t(this,(function(t){switch(t.label){case 0:if(i.isLoading)return[2];i.isLoading=!0,t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,s(i,i.page,i.limit)];case 2:return e=t.sent(),i.data=(null===(n=e.data)||void 0===n?void 0:n.data)||[],i.count=(null===(r=e.data)||void 0===r?void 0:r.count)||0,i.initialized=!0,i.minPage=i.page,[3,5];case 3:return o=t.sent(),console.log(o),[3,5];case 4:return i.isLoading=!1,[7];case 5:return[2]}}))}))}function s(a,s,d){var u;return e(this,void 0,void 0,(function(){var e,l;return t(this,(function(t){switch(t.label){case 0:return[4,i({start:a.start?{eq:a.start}:void 0,end:a.end?{eq:a.end}:void 0,includeDeleted:a.includeDeleted||!1,name:a.name?{eq:a.name}:void 0,id:a.id?{eq:a.id}:void 0,search:a.search||void 0,pagination:{limit:d,page:s}})];case 1:return e=t.sent(),l=null===(u=e.data)||void 0===u?void 0:u.data,[4,o(l||[])];case 2:return t.sent(),null==l||l.forEach((function(e){return r.initRaffle(e,n.getCurrentLocale())})),[2,e]}}))}))}export{a as getInitial};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t,__assign as a}from'./../ext/tslib/tslib.es6.js';import r from"lodash/uniq";import n from"lodash/flatten";import{makeAutoObservable as i}from"mobx";import{IkasThemeJsonPageType as s,IkasRaffleMetadataTargetType as o,IkasBlogMetaDataTargetType as u,IkasHTMLMetaDataTargetType as c,IkasThemeJsonComponentPropType as p}from"@ikas/storefront-models";import{IkasStorefrontConfig as l}from"@ikas/storefront-config";import{IkasProductFunctions as d}from"@ikas/storefront-model-functions";import{IkasProductListPropValueProvider as h}from"./prop-value/product-list.js";import{IkasProductPropValueProvider as g}from"./prop-value/product-detail.js";import{IkasBrandListPropValueProvider as f}from"./prop-value/brand-list.js";import{IkasBrandPropValueProvider as v}from"./prop-value/brand.js";import{IkasLinkPropValueProvider as m}from"./prop-value/link.js";import{IkasImageListPropValueProvider as T}from"./prop-value/image-list.js";import{IkasTextPropValueProvider as S}from"./prop-value/text.js";import{IkasColorPropValueProvider as y}from"./prop-value/color.js";import{IkasBooleanPropValueProvider as D}from"./prop-value/boolean.js";import{IkasImagePropValueProvider as L}from"./prop-value/image.js";import{IkasCategoryPropValueProvider as O}from"./prop-value/category.js";import{IkasCategoryListPropValueProvider as P}from"./prop-value/category-list.js";import{IkasCustomPropValueProvider as b}from"./prop-value/custom.js";import{IkasSliderPropValueProvider as I}from"./prop-value/slider.js";import{IkasRichTextPropValueProvider as w}from"./prop-value/rich-text.js";import{IkasBlogPropValueProvider as C}from"./prop-value/blog.js";import{IkasBlogListPropValueProvider as R}from"./prop-value/blog-list.js";import{IkasAttributePropValueProvider as E}from"./prop-value/attribute.js";import{IkasAttributeListPropValueProvider as A}from"./prop-value/attribute-list.js";import{IkasBlogCategoryPropValueProvider as V}from"./prop-value/blog-category.js";import{IkasBlogCategoryListPropValueProvider as j}from"./prop-value/blog-category-list.js";import{IkasRafflePropValueProvider as G}from"./prop-value/raffle.js";import{IkasRaffleListPropValueProvider as F}from"./prop-value/raffle-list.js";import{listMerchantSettings as _,listCustomerReviewSummary as B,listProductOptionSet as M,searchProducts as k,listProductBrand as U,listCategory as N,listBlog as q,listBlogCategory as Y,listStorefrontRaffle as x,listHTMLMetaData as J,listRaffleMetaData as K,listBlogMetaData as X}from"@ikas/storefront-api";import{populateRaffleProducts as H}from"./helpers/raffle.js";var $=function(){function $(e,t,a){this.pageType=null,this.pageParams={},this.pageComponentPropValues=[],this.pageSpecificData=null,this.merchantSettings=null,this.possiblePageTypes=[],this.linkMetaDataTargetIds=[],this.productReviewSummary=null,this.theme=e,this.pageParams=t||{},this.pageType=a,i(this)}return Object.defineProperty($.prototype,"page",{get:function(){var e=this;if(this.pageType===s.CUSTOM){var t=this.pageParams.slug;return this.theme.pages.find((function(e){return e.type===s.CUSTOM&&e.slug===t}))}return this.theme.pages.find((function(t){return t.type===e.pageType}))},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"nextPageData",{get:function(){var e,t,r,n,i,o=[],u=[];return this.pageComponentPropValues.forEach((function(e){if(u.push({pageComponent:{id:e.pageComponent.id,componentId:e.pageComponent.componentId},propValues:e.propValues}),!o.find((function(t){return t.id===e.component.id}))){var t=a({},e.component);t.props.forEach((function(e){delete e.description,delete e.displayName,delete e.translations,delete e.groupId})),delete t.translations,delete t.defaultPropValues,delete t.displayName,delete t.description,delete t.dir,o.push(t)}})),{props:JSON.parse(JSON.stringify({propValues:u,themeJsonComponents:o,customDataList:this.theme.customData,pageSpecificData:this.pageSpecificData||null,pageType:(null===(e=this.page)||void 0===e?void 0:e.type)||s.CUSTOM,pageTitle:(null===(t=this.page)||void 0===t?void 0:t.pageTitle)||null,pageDescription:(null===(r=this.page)||void 0===r?void 0:r.description)||null,canonicals:(null===(n=this.page)||void 0===n?void 0:n.canonicals)||null,disableIndex:(null===(i=this.page)||void 0===i?void 0:i.disableIndex)||null,settings:this.theme.settings||{},productReviewSummary:this.productReviewSummary,configJson:l.toJSON(),merchantSettings:this.getMerchantSettings()}))}},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"specification",{get:function(){var e,t,a=this,r=this.page;return(null==r?void 0:r.type)===s.PRODUCT?null===(e=r.specifications)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=a.pageSpecificData)||void 0===t?void 0:t.id)})):null===(t=null==r?void 0:r.specifications)||void 0===t?void 0:t.find((function(e){var t;return e.id===(null===(t=a.pageSpecificData)||void 0===t?void 0:t.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"pageComponents",{get:function(){var e;return this.specification?this.specification.components:(null===(e=this.page)||void 0===e?void 0:e.components)||[]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"$pageComponentPropValues",{get:function(){return this.pageComponentPropValues},enumerable:!1,configurable:!0}),$.prototype.getMerchantSettings=function(){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,_({})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.merchantSettings=e.data),[2]}}))}))},$.prototype.getPageData=function(){return e(this,void 0,void 0,(function(){var e,a=this;return t(this,(function(t){switch(t.label){case 0:return this.pageSpecificData?[3,2]:[4,this.getPageSpecificData()];case 1:t.sent(),t.label=2;case 2:return this.page?[4,this.getMerchantSettings()]:[2];case 3:return t.sent(),e=this,[4,Promise.all(this.pageComponents.map((function(e){return a.getPageComponentPropValues(e)})))];case 4:return e.pageComponentPropValues=t.sent(),[4,this.setLinkSlugs()];case 5:return t.sent(),[4,this.getProductReviewSummary()];case 6:return t.sent(),[2]}}))}))},$.prototype.getProductReviewSummary=function(){var a,r,n;return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.pageType!==s.PRODUCT?[3,2]:[4,B({productId:{eq:null===(a=this.pageSpecificData)||void 0===a?void 0:a.id}})];case 1:(e=t.sent()).isSuccess&&(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)&&(this.productReviewSummary=e.data.data[0]),t.label=2;case 2:return[2]}}))}))},$.prototype.getPageSpecificData=function(){var a,r,n,i;return e(this,void 0,void 0,(function(){var p,h,g,f,v,m,T,S,y,D,L=this;return t(this,(function(O){switch(O.label){case 0:return this.pageType&&![s.BRAND,s.PRODUCT,s.CATEGORY,s.BLOG,s.BLOG_CATEGORY,s.RAFFLE_DETAIL].includes(this.pageType)?[2]:(p=this.pageParams.slug)?(h=[],(null===(a=this.possiblePageTypes)||void 0===a?void 0:a.includes(s.BLOG))||(null===(r=this.possiblePageTypes)||void 0===r?void 0:r.includes(s.BLOG_CATEGORY))?[4,X({slug:{eq:p}})]:[3,2]):[2];case 1:return g=O.sent(),(h=(null===(n=g.data)||void 0===n?void 0:n.data)||[]).length?[3,6]:[2];case 2:return(null===(i=this.possiblePageTypes)||void 0===i?void 0:i.includes(s.RAFFLE_DETAIL))?[4,K({slug:{eq:p}})]:[3,4];case 3:return g=O.sent(),(h=g.data||[]).length?[3,6]:[2];case 4:return[4,J({slug:{eq:p}})];case 5:if(g=O.sent(),!(h=g.data||[])||!h.length)return[2];O.label=6;case 6:if(!(f=h[0]).targetId)return[2];switch(v=function(){return e(L,void 0,void 0,(function(){var e,a,r,n,i,o,u,c,p,h,g;return t(this,(function(t){switch(t.label){case 0:return[4,k({input:{productIdList:[f.targetId],priceListId:l.getPriceListId(),salesChannelId:l.getSalesChannelId()}})];case 1:return e=t.sent(),(null===(h=null===(p=null==e?void 0:e.data)||void 0===p?void 0:p.data)||void 0===h?void 0:h.length)?(a=e.data.data[0]).productOptionSetId?[4,M({id:{eq:a.productOptionSetId}})]:[3,3]:[2];case 2:(r=t.sent()).isSuccess&&(null===(g=null==r?void 0:r.data)||void 0===g?void 0:g.length)&&(a.productOptionSet=r.data[0]),t.label=3;case 3:return(n=a.variants.find((function(e){return e.isActive})))?(a.selectedVariantValues=n.variantValues,i=d.getDisplayedVariantTypes,this.pageSpecificData=a,(o=i(this.pageSpecificData,a.selectedVariantValues)).length&&(u=o[0]).displayedVariantValues.length&&(c=u.displayedVariantValues.find((function(e){return e.hasStock})))&&(this.pageSpecificData.selectedVariantValues=c.variant.variantValues),this.pageType=s.PRODUCT,this.setPageMetaData(f),[2]):[2]}}))}))},m=function(){return e(L,void 0,void 0,(function(){var e,a,r,n;return t(this,(function(t){switch(t.label){case 0:return[4,U({id:{eq:f.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)?(a=e.data.data[0],this.pageSpecificData=a,this.pageType=s.BRAND,this.setPageMetaData(f),[2]):[2]}}))}))},T=function(){return e(L,void 0,void 0,(function(){var e,a,r,n;return t(this,(function(t){switch(t.label){case 0:return[4,N({id:{eq:f.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)?(a=e.data.data[0],this.pageSpecificData=a,this.pageType=s.CATEGORY,this.setPageMetaData(f),[2]):[2]}}))}))},S=function(){return e(L,void 0,void 0,(function(){var e,a,r,n;return t(this,(function(t){switch(t.label){case 0:return[4,q({id:{eq:f.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)?(a=e.data.data[0],this.pageSpecificData=a,this.pageType=s.BLOG,this.setPageMetaData(f),[2]):[2]}}))}))},y=function(){return e(L,void 0,void 0,(function(){var e,a,r,n;return t(this,(function(t){switch(t.label){case 0:return[4,Y({id:{eq:f.targetId},pagination:{page:1,limit:1}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)?(a=e.data.data[0],this.pageSpecificData=a,this.pageType=s.BLOG_CATEGORY,this.setPageMetaData(f),[2]):[2]}}))}))},D=function(){return e(L,void 0,void 0,(function(){var e,a,r,n;return t(this,(function(t){switch(t.label){case 0:return[4,x({id:{eq:f.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)?(a=e.data.data[0],[4,H([a])]):[2];case 2:return t.sent(),this.pageSpecificData=a,this.pageType=s.RAFFLE_DETAIL,this.setPageMetaData(f),[2]}}))}))},f.targetType){case c.BRAND:return[3,7];case c.CATEGORY:return[3,9];case c.PRODUCT:return[3,11];case u.BLOG:return[3,13];case u.BLOG_CATEGORY:return[3,15];case o.RAFFLE:return[3,17]}return[3,19];case 7:return[4,m()];case 8:return[2,O.sent()];case 9:return[4,T()];case 10:return[2,O.sent()];case 11:return[4,v()];case 12:return[2,O.sent()];case 13:return[4,S()];case 14:return[2,O.sent()];case 15:return[4,y()];case 16:return[2,O.sent()];case 17:return[4,D()];case 18:return[2,O.sent()];case 19:return[3,20];case 20:return[2]}}))}))},$.prototype.getPageComponentPropValues=function(a){return e(this,void 0,void 0,(function(){var r,n,i,s=this;return t(this,(function(o){switch(o.label){case 0:return r=this.theme.components.find((function(e){return e.id===a.componentId})),n={pageComponent:a,component:r,propValues:{}},i=function(r){return e(s,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return e=n.propValues,i=r.name,[4,this.getPageComponentPropValue(a,r)];case 1:return e[i]=t.sent(),[2]}}))}))},[4,Promise.all(r.props.map(i))];case 1:return o.sent(),[2,n]}}))}))},$.prototype.getPageComponentPropValue=function(a,r){return e(this,void 0,void 0,(function(){var e,n,i,s,o,u=this;return t(this,(function(t){switch(t.label){case 0:if(n=a.propValues[r.name],i=[p.RAFFLE_LIST],null==n&&!i.includes(r.type))return[2,null];switch(r.type){case p.TEXT:return[3,1];case p.RICH_TEXT:return[3,2];case p.BOOLEAN:return[3,3];case p.IMAGE:return[3,4];case p.IMAGE_LIST:return[3,5];case p.BRAND:return[3,6];case p.BRAND_LIST:return[3,7];case p.PRODUCT_LIST:return[3,8];case p.PRODUCT_DETAIL:return[3,9];case p.PRODUCT_ATTRIBUTE:return[3,10];case p.PRODUCT_ATTRIBUTE_LIST:return[3,11];case p.CATEGORY:return[3,12];case p.CATEGORY_LIST:return[3,13];case p.LINK:case p.LIST_OF_LINK:return[3,14];case p.COLOR:return[3,15];case p.CUSTOM:return[3,16];case p.COMPONENT:case p.COMPONENT_LIST:return[3,17];case p.BLOG:return[3,19];case p.BLOG_LIST:return[3,20];case p.BLOG_CATEGORY:return[3,21];case p.BLOG_CATEGORY_LIST:return[3,22];case p.RAFFLE:return[3,23];case p.RAFFLE_LIST:return[3,24];case p.SLIDER:return[3,25]}return[3,26];case 1:return e=new S(n),[3,27];case 2:return e=new w(n),[3,27];case 3:return e=new D(n),[3,27];case 4:return e=new L(n),[3,27];case 5:return e=new T(n),[3,27];case 6:return e=new v(n),[3,27];case 7:return e=new f(n),[3,27];case 8:return e=new h(this.pageType,n,this.pageSpecificData),[3,27];case 9:return e=new g(n),[3,27];case 10:return e=new E(n),[3,27];case 11:return e=new A(n),[3,27];case 12:return e=new O(n),[3,27];case 13:return e=new P(n),[3,27];case 14:return e=new m(n,this.theme,this.linkMetaDataTargetIds),[3,27];case 15:return e=new y(n),[3,27];case 16:return(s=this.theme.customData.find((function(e){return e.id===r.customDataId})))?(e=new b(n,s,this.theme,this.pageType,this,this.pageSpecificData,this.pageParams),[3,27]):[2];case 17:return o=n,[4,Promise.all(o.map((function(e){return u.getPageComponentPropValues(e)})))];case 18:case 28:return[2,t.sent()];case 19:return e=new C(n),[3,27];case 20:return e=new R(this.pageType,n,this.pageSpecificData),[3,27];case 21:return e=new V(n),[3,27];case 22:return e=new j(n),[3,27];case 23:return e=new G(n),[3,27];case 24:return e=new F,[3,27];case 25:return e=new I(n),[3,27];case 26:return[3,27];case 27:return[4,null==e?void 0:e.getValue()]}}))}))},$.prototype.setPageMetaData=function(e){this.page&&(this.page.pageTitle=e.pageTitle||null,this.page.description=e.description||null,this.page.canonicals=e.canonicals||null,this.page.disableIndex=e.disableIndex||null)},$.prototype.setLinkSlugs=function(){return e(this,void 0,void 0,(function(){var e,a,r;return t(this,(function(t){switch(t.label){case 0:return e=[],a=[],r=[],this.linkMetaDataTargetIds.forEach((function(t){switch(t.type){case"DEFAULT":e.push(t);break;case"BLOG":a.push(t);break;case"RAFFLE":r.push(t)}})),[4,Promise.all([this.getLinkSlugs(e,"DEFAULT"),this.getLinkSlugs(a,"BLOG"),this.getLinkSlugs(r,"RAFFLE")])];case 1:return[2,t.sent()]}}))}))},$.prototype.getLinkSlugs=function(a,n){return e(this,void 0,void 0,(function(){var i,s,o=this;return t(this,(function(u){switch(u.label){case 0:return i=r(a.map((function(e){return e.id}))),s=[],i.length?[4,function(){return e(o,void 0,void 0,(function(){var e,a,r,o,u;return t(this,(function(t){switch(t.label){case 0:switch(e=[],n){case"DEFAULT":return[3,1];case"BLOG":return[3,3];case"RAFFLE":return[3,5]}return[3,7];case 1:return[4,J({targetId:{in:i}})];case 2:return a=t.sent(),e=a.data||[],[3,8];case 3:return[4,X({targetId:{in:i}})];case 4:return r=t.sent(),e=(null===(u=r.data)||void 0===u?void 0:u.data)||[],[3,8];case 5:return[4,K({targetId:{in:i}})];case 6:return o=t.sent(),e=o.data||[],[3,8];case 7:return[3,8];case 8:return e.length&&(s=e),[2]}}))}))}()]:[2];case 1:return u.sent(),a.forEach((function(e){var t=s.find((function(t){return t.targetId===e.id}));t&&(e.navigationLink.href+=t.slug)})),[2]}}))}))},$.prototype.getFlatCustomData=function(e){var t=this;if(!e.nestedData||!e.nestedData.length)return[e];var a=n(e.nestedData.map((function(e){return t.getFlatCustomData(e)}))),r=[];return r.push(e),r=r.concat(a)},$}();export{$ as IkasPageDataProvider};
|
|
1
|
+
import{__awaiter as e,__generator as t,__assign as a}from'./../ext/tslib/tslib.es6.js';import r from"lodash/uniq";import n from"lodash/flatten";import{makeAutoObservable as i}from"mobx";import{IkasThemeJsonPageType as s,IkasRaffleMetadataTargetType as o,IkasBlogMetaDataTargetType as u,IkasHTMLMetaDataTargetType as c,IkasThemeJsonComponentPropType as p}from"@ikas/storefront-models";import{IkasStorefrontConfig as l}from"@ikas/storefront-config";import{IkasProductFunctions as d}from"@ikas/storefront-model-functions";import{IkasProductListPropValueProvider as h}from"./prop-value/product-list.js";import{IkasProductPropValueProvider as g}from"./prop-value/product-detail.js";import{IkasBrandListPropValueProvider as f}from"./prop-value/brand-list.js";import{IkasBrandPropValueProvider as v}from"./prop-value/brand.js";import{IkasLinkPropValueProvider as m}from"./prop-value/link.js";import{IkasImageListPropValueProvider as T}from"./prop-value/image-list.js";import{IkasTextPropValueProvider as S}from"./prop-value/text.js";import{IkasColorPropValueProvider as y}from"./prop-value/color.js";import{IkasBooleanPropValueProvider as D}from"./prop-value/boolean.js";import{IkasImagePropValueProvider as L}from"./prop-value/image.js";import{IkasCategoryPropValueProvider as O}from"./prop-value/category.js";import{IkasCategoryListPropValueProvider as P}from"./prop-value/category-list.js";import{IkasCustomPropValueProvider as b}from"./prop-value/custom.js";import{IkasSliderPropValueProvider as I}from"./prop-value/slider.js";import{IkasRichTextPropValueProvider as w}from"./prop-value/rich-text.js";import{IkasBlogPropValueProvider as C}from"./prop-value/blog.js";import{IkasBlogListPropValueProvider as R}from"./prop-value/blog-list.js";import{IkasAttributePropValueProvider as E}from"./prop-value/attribute.js";import{IkasAttributeListPropValueProvider as A}from"./prop-value/attribute-list.js";import{IkasBlogCategoryPropValueProvider as j}from"./prop-value/blog-category.js";import{IkasBlogCategoryListPropValueProvider as V}from"./prop-value/blog-category-list.js";import{IkasRafflePropValueProvider as G}from"./prop-value/raffle.js";import{IkasRaffleListPropValueProvider as F}from"./prop-value/raffle-list.js";import{listMerchantSettings as _,listCustomerReviewSummary as B,listProductOptionSet as M,searchProducts as k,listProductBrand as U,listCategory as N,listBlog as q,listBlogCategory as Y,listStorefrontRaffle as x,listHTMLMetaData as J,listRaffleMetaData as K,listBlogMetaData as X}from"@ikas/storefront-api";import{populateRaffleProducts as H}from"./helpers/raffle.js";var $=function(){function $(e,t,a){this.pageType=null,this.pageParams={},this.pageComponentPropValues=[],this.pageSpecificData=null,this.merchantSettings=null,this.possiblePageTypes=[],this.linkMetaDataTargetIds=[],this.productReviewSummary=null,this.theme=e,this.pageParams=t||{},this.pageType=a,i(this)}return Object.defineProperty($.prototype,"page",{get:function(){var e=this;if(this.pageType===s.CUSTOM){var t=this.pageParams.slug;return this.theme.pages.find((function(e){return e.type===s.CUSTOM&&e.slug===t}))}return this.theme.pages.find((function(t){return t.type===e.pageType}))},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"nextPageData",{get:function(){var e,t,r,n,i,o=[],u=[];return this.pageComponentPropValues.forEach((function(e){if(u.push({pageComponent:{id:e.pageComponent.id,componentId:e.pageComponent.componentId},propValues:e.propValues}),!o.find((function(t){return t.id===e.component.id}))){var t=a({},e.component);t.props.forEach((function(e){delete e.description,delete e.displayName,delete e.translations,delete e.groupId})),delete t.translations,delete t.defaultPropValues,delete t.displayName,delete t.description,delete t.dir,o.push(t)}})),{props:JSON.parse(JSON.stringify({propValues:u,themeJsonComponents:o,customDataList:this.theme.customData,pageSpecificData:this.pageSpecificData||null,pageType:(null===(e=this.page)||void 0===e?void 0:e.type)||s.CUSTOM,pageTitle:(null===(t=this.page)||void 0===t?void 0:t.pageTitle)||null,pageDescription:(null===(r=this.page)||void 0===r?void 0:r.description)||null,canonicals:(null===(n=this.page)||void 0===n?void 0:n.canonicals)||null,disableIndex:(null===(i=this.page)||void 0===i?void 0:i.disableIndex)||null,settings:this.theme.settings||{},productReviewSummary:this.productReviewSummary,configJson:l.toJSON(),merchantSettings:this.getMerchantSettings()}))}},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"specification",{get:function(){var e,t,a=this,r=this.page;return(null==r?void 0:r.type)===s.PRODUCT?null===(e=r.specifications)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=a.pageSpecificData)||void 0===t?void 0:t.id)})):null===(t=null==r?void 0:r.specifications)||void 0===t?void 0:t.find((function(e){var t;return e.id===(null===(t=a.pageSpecificData)||void 0===t?void 0:t.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"pageComponents",{get:function(){var e;return this.specification?this.specification.components:(null===(e=this.page)||void 0===e?void 0:e.components)||[]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"$pageComponentPropValues",{get:function(){return this.pageComponentPropValues},enumerable:!1,configurable:!0}),$.prototype.getMerchantSettings=function(){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,_({})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.merchantSettings=e.data),[2]}}))}))},$.prototype.getPageData=function(){return e(this,void 0,void 0,(function(){var e,a=this;return t(this,(function(t){switch(t.label){case 0:return this.pageSpecificData?[3,2]:[4,this.getPageSpecificData()];case 1:t.sent(),t.label=2;case 2:return this.page?[4,this.getMerchantSettings()]:[2];case 3:return t.sent(),e=this,[4,Promise.all(this.pageComponents.map((function(e){return a.getPageComponentPropValues(e)})))];case 4:return e.pageComponentPropValues=t.sent(),[4,this.setLinkSlugs()];case 5:return t.sent(),[4,this.getProductReviewSummary()];case 6:return t.sent(),[2]}}))}))},$.prototype.getProductReviewSummary=function(){var a,r,n;return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.pageType!==s.PRODUCT?[3,2]:[4,B({productId:{eq:null===(a=this.pageSpecificData)||void 0===a?void 0:a.id}})];case 1:(e=t.sent()).isSuccess&&(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)&&(this.productReviewSummary=e.data.data[0]),t.label=2;case 2:return[2]}}))}))},$.prototype.getPageSpecificData=function(){var a,r,n,i;return e(this,void 0,void 0,(function(){var p,h,g,f,v,m,T,S,y,D,L=this;return t(this,(function(O){switch(O.label){case 0:return this.pageType&&![s.BRAND,s.PRODUCT,s.CATEGORY,s.BLOG,s.BLOG_CATEGORY,s.RAFFLE_DETAIL].includes(this.pageType)?[2]:(p=this.pageParams.slug)?(h=[],(null===(a=this.possiblePageTypes)||void 0===a?void 0:a.includes(s.BLOG))||(null===(r=this.possiblePageTypes)||void 0===r?void 0:r.includes(s.BLOG_CATEGORY))?[4,X({slug:{eq:p}})]:[3,2]):[2];case 1:return g=O.sent(),(h=(null===(n=g.data)||void 0===n?void 0:n.data)||[]).length?[3,6]:[2];case 2:return(null===(i=this.possiblePageTypes)||void 0===i?void 0:i.includes(s.RAFFLE_DETAIL))?[4,K({slug:{eq:p}})]:[3,4];case 3:return g=O.sent(),(h=g.data||[]).length?[3,6]:[2];case 4:return[4,J({slug:{eq:p}})];case 5:if(g=O.sent(),!(h=g.data||[])||!h.length)return[2];O.label=6;case 6:if(!(f=h[0]).targetId)return[2];switch(v=function(){return e(L,void 0,void 0,(function(){var e,a,r,n,i,o,u,c,p,h,g;return t(this,(function(t){switch(t.label){case 0:return[4,k({input:{productIdList:[f.targetId],priceListId:l.getPriceListId(),salesChannelId:l.getSalesChannelId()}})];case 1:return e=t.sent(),(null===(h=null===(p=null==e?void 0:e.data)||void 0===p?void 0:p.data)||void 0===h?void 0:h.length)?(a=e.data.data[0]).productOptionSetId?[4,M({id:{eq:a.productOptionSetId}})]:[3,3]:[2];case 2:(r=t.sent()).isSuccess&&(null===(g=null==r?void 0:r.data)||void 0===g?void 0:g.length)&&(a.productOptionSet=r.data[0]),t.label=3;case 3:return(n=a.variants.find((function(e){return e.isActive})))?(a.selectedVariantValues=n.variantValues,i=d.getDisplayedVariantTypes,this.pageSpecificData=a,(o=i(this.pageSpecificData)).length&&(u=o[0]).displayedVariantValues.length&&(c=u.displayedVariantValues.find((function(e){return e.hasStock})))&&(this.pageSpecificData.selectedVariantValues=c.variant.variantValues),this.pageType=s.PRODUCT,this.setPageMetaData(f),[2]):[2]}}))}))},m=function(){return e(L,void 0,void 0,(function(){var e,a,r,n;return t(this,(function(t){switch(t.label){case 0:return[4,U({id:{eq:f.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)?(a=e.data.data[0],this.pageSpecificData=a,this.pageType=s.BRAND,this.setPageMetaData(f),[2]):[2]}}))}))},T=function(){return e(L,void 0,void 0,(function(){var e,a,r,n;return t(this,(function(t){switch(t.label){case 0:return[4,N({id:{eq:f.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)?(a=e.data.data[0],this.pageSpecificData=a,this.pageType=s.CATEGORY,this.setPageMetaData(f),[2]):[2]}}))}))},S=function(){return e(L,void 0,void 0,(function(){var e,a,r,n;return t(this,(function(t){switch(t.label){case 0:return[4,q({id:{eq:f.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)?(a=e.data.data[0],this.pageSpecificData=a,this.pageType=s.BLOG,this.setPageMetaData(f),[2]):[2]}}))}))},y=function(){return e(L,void 0,void 0,(function(){var e,a,r,n;return t(this,(function(t){switch(t.label){case 0:return[4,Y({id:{eq:f.targetId},pagination:{page:1,limit:1}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)?(a=e.data.data[0],this.pageSpecificData=a,this.pageType=s.BLOG_CATEGORY,this.setPageMetaData(f),[2]):[2]}}))}))},D=function(){return e(L,void 0,void 0,(function(){var e,a,r,n;return t(this,(function(t){switch(t.label){case 0:return[4,x({id:{eq:f.targetId}})];case 1:return(e=t.sent()).isSuccess&&(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)?(a=e.data.data[0],[4,H([a])]):[2];case 2:return t.sent(),this.pageSpecificData=a,this.pageType=s.RAFFLE_DETAIL,this.setPageMetaData(f),[2]}}))}))},f.targetType){case c.BRAND:return[3,7];case c.CATEGORY:return[3,9];case c.PRODUCT:return[3,11];case u.BLOG:return[3,13];case u.BLOG_CATEGORY:return[3,15];case o.RAFFLE:return[3,17]}return[3,19];case 7:return[4,m()];case 8:return[2,O.sent()];case 9:return[4,T()];case 10:return[2,O.sent()];case 11:return[4,v()];case 12:return[2,O.sent()];case 13:return[4,S()];case 14:return[2,O.sent()];case 15:return[4,y()];case 16:return[2,O.sent()];case 17:return[4,D()];case 18:return[2,O.sent()];case 19:return[3,20];case 20:return[2]}}))}))},$.prototype.getPageComponentPropValues=function(a){return e(this,void 0,void 0,(function(){var r,n,i,s=this;return t(this,(function(o){switch(o.label){case 0:return r=this.theme.components.find((function(e){return e.id===a.componentId})),n={pageComponent:a,component:r,propValues:{}},i=function(r){return e(s,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return e=n.propValues,i=r.name,[4,this.getPageComponentPropValue(a,r)];case 1:return e[i]=t.sent(),[2]}}))}))},[4,Promise.all(r.props.map(i))];case 1:return o.sent(),[2,n]}}))}))},$.prototype.getPageComponentPropValue=function(a,r){return e(this,void 0,void 0,(function(){var e,n,i,s,o,u=this;return t(this,(function(t){switch(t.label){case 0:if(n=a.propValues[r.name],i=[p.RAFFLE_LIST],null==n&&!i.includes(r.type))return[2,null];switch(r.type){case p.TEXT:return[3,1];case p.RICH_TEXT:return[3,2];case p.BOOLEAN:return[3,3];case p.IMAGE:return[3,4];case p.IMAGE_LIST:return[3,5];case p.BRAND:return[3,6];case p.BRAND_LIST:return[3,7];case p.PRODUCT_LIST:return[3,8];case p.PRODUCT_DETAIL:return[3,9];case p.PRODUCT_ATTRIBUTE:return[3,10];case p.PRODUCT_ATTRIBUTE_LIST:return[3,11];case p.CATEGORY:return[3,12];case p.CATEGORY_LIST:return[3,13];case p.LINK:case p.LIST_OF_LINK:return[3,14];case p.COLOR:return[3,15];case p.CUSTOM:return[3,16];case p.COMPONENT:case p.COMPONENT_LIST:return[3,17];case p.BLOG:return[3,19];case p.BLOG_LIST:return[3,20];case p.BLOG_CATEGORY:return[3,21];case p.BLOG_CATEGORY_LIST:return[3,22];case p.RAFFLE:return[3,23];case p.RAFFLE_LIST:return[3,24];case p.SLIDER:return[3,25]}return[3,26];case 1:return e=new S(n),[3,27];case 2:return e=new w(n),[3,27];case 3:return e=new D(n),[3,27];case 4:return e=new L(n),[3,27];case 5:return e=new T(n),[3,27];case 6:return e=new v(n),[3,27];case 7:return e=new f(n),[3,27];case 8:return e=new h(this.pageType,n,this.pageSpecificData),[3,27];case 9:return e=new g(n),[3,27];case 10:return e=new E(n),[3,27];case 11:return e=new A(n),[3,27];case 12:return e=new O(n),[3,27];case 13:return e=new P(n),[3,27];case 14:return e=new m(n,this.theme,this.linkMetaDataTargetIds),[3,27];case 15:return e=new y(n),[3,27];case 16:return(s=this.theme.customData.find((function(e){return e.id===r.customDataId})))?(e=new b(n,s,this.theme,this.pageType,this,this.pageSpecificData,this.pageParams),[3,27]):[2];case 17:return o=n,[4,Promise.all(o.map((function(e){return u.getPageComponentPropValues(e)})))];case 18:case 28:return[2,t.sent()];case 19:return e=new C(n),[3,27];case 20:return e=new R(this.pageType,n,this.pageSpecificData),[3,27];case 21:return e=new j(n),[3,27];case 22:return e=new V(n),[3,27];case 23:return e=new G(n),[3,27];case 24:return e=new F,[3,27];case 25:return e=new I(n),[3,27];case 26:return[3,27];case 27:return[4,null==e?void 0:e.getValue()]}}))}))},$.prototype.setPageMetaData=function(e){this.page&&(this.page.pageTitle=e.pageTitle||null,this.page.description=e.description||null,this.page.canonicals=e.canonicals||null,this.page.disableIndex=e.disableIndex||null)},$.prototype.setLinkSlugs=function(){return e(this,void 0,void 0,(function(){var e,a,r;return t(this,(function(t){switch(t.label){case 0:return e=[],a=[],r=[],this.linkMetaDataTargetIds.forEach((function(t){switch(t.type){case"DEFAULT":e.push(t);break;case"BLOG":a.push(t);break;case"RAFFLE":r.push(t)}})),[4,Promise.all([this.getLinkSlugs(e,"DEFAULT"),this.getLinkSlugs(a,"BLOG"),this.getLinkSlugs(r,"RAFFLE")])];case 1:return[2,t.sent()]}}))}))},$.prototype.getLinkSlugs=function(a,n){return e(this,void 0,void 0,(function(){var i,s,o=this;return t(this,(function(u){switch(u.label){case 0:return i=r(a.map((function(e){return e.id}))),s=[],i.length?[4,function(){return e(o,void 0,void 0,(function(){var e,a,r,o,u;return t(this,(function(t){switch(t.label){case 0:switch(e=[],n){case"DEFAULT":return[3,1];case"BLOG":return[3,3];case"RAFFLE":return[3,5]}return[3,7];case 1:return[4,J({targetId:{in:i}})];case 2:return a=t.sent(),e=a.data||[],[3,8];case 3:return[4,X({targetId:{in:i}})];case 4:return r=t.sent(),e=(null===(u=r.data)||void 0===u?void 0:u.data)||[],[3,8];case 5:return[4,K({targetId:{in:i}})];case 6:return o=t.sent(),e=o.data||[],[3,8];case 7:return[3,8];case 8:return e.length&&(s=e),[2]}}))}))}()]:[2];case 1:return u.sent(),a.forEach((function(e){var t=s.find((function(t){return t.targetId===e.id}));t&&(e.navigationLink.href+=t.slug)})),[2]}}))}))},$.prototype.getFlatCustomData=function(e){var t=this;if(!e.nestedData||!e.nestedData.length)return[e];var a=n(e.nestedData.map((function(e){return t.getFlatCustomData(e)}))),r=[];return r.push(e),r=r.concat(a)},$}();export{$ as IkasPageDataProvider};
|
|
@@ -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 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};
|
|
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.ACTIVATE_CUSTOMER?e=new l({href:"/account/activate",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": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.20",
|
|
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": "^5.0.0-beta.
|
|
21
|
-
"@ikas/storefront-config": "^5.0.0-beta.
|
|
22
|
-
"@ikas/storefront-model-functions": "^5.0.0-beta.
|
|
23
|
-
"@ikas/storefront-models": "^5.0.0-beta.
|
|
20
|
+
"@ikas/storefront-api": "^5.0.0-beta.20",
|
|
21
|
+
"@ikas/storefront-config": "^5.0.0-beta.20",
|
|
22
|
+
"@ikas/storefront-model-functions": "^5.0.0-beta.20",
|
|
23
|
+
"@ikas/storefront-models": "^5.0.0-beta.20",
|
|
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": "^5.0.0-beta.
|
|
42
|
-
"@ikas/storefront-config": "^5.0.0-beta.
|
|
43
|
-
"@ikas/storefront-model-functions": "^5.0.0-beta.
|
|
44
|
-
"@ikas/storefront-models": "^5.0.0-beta.
|
|
41
|
+
"@ikas/storefront-api": "^5.0.0-beta.20",
|
|
42
|
+
"@ikas/storefront-config": "^5.0.0-beta.20",
|
|
43
|
+
"@ikas/storefront-model-functions": "^5.0.0-beta.20",
|
|
44
|
+
"@ikas/storefront-models": "^5.0.0-beta.20",
|
|
45
45
|
"lodash": "^4.17.21"
|
|
46
46
|
}
|
|
47
47
|
}
|