@ikas/storefront-providers 4.4.0-beta.1 → 4.4.0-beta.11

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,5 +1,5 @@
1
1
  import { IkasBrand, IkasCategory, IkasFilterCategory, IkasProduct, IkasProductFilter, IkasThemeJsonPageType } from "@ikas/storefront-models";
2
- import { IkasRelatedProductProps } from "../../../providers/prop-value/product-list";
2
+ import { IkasRelatedProductProps, IkasViewedTogetherProductProps } from "../../../providers/prop-value/product-list";
3
3
  import { IkasProductListPropValue } from "../../prop-value/product-list";
4
4
  export declare type IkasProductList = {
5
5
  data: IkasProduct[];
@@ -19,6 +19,7 @@ export declare type IkasProductList = {
19
19
  filterBrandId?: string | null;
20
20
  filterCategoryId?: string | null;
21
21
  relatedProductData?: IkasRelatedProductProps | null;
22
+ viewedTogetherProductData?: IkasViewedTogetherProductProps | null;
22
23
  pageSpecificData: IkasCategory | IkasBrand | null;
23
24
  recommendFor?: string | null;
24
25
  isLoading?: boolean;
@@ -32,7 +33,8 @@ export declare enum IkasProductListType {
32
33
  CATEGORY = "CATEGORY",
33
34
  SEARCH = "SEARCH",
34
35
  LAST_VIEWED = "LAST_VIEWED",
35
- RELATED_PRODUCTS = "RELATED_PRODUCTS"
36
+ RELATED_PRODUCTS = "RELATED_PRODUCTS",
37
+ VIEWED_TOGETHER = "VIEWED_TOGETHER"
36
38
  }
37
39
  export declare enum IkasProductListSortType {
38
40
  INCREASING_PRICE = "INCREASING_PRICE",
@@ -61,4 +63,4 @@ export declare type FacetValue = {
61
63
  id: string;
62
64
  count: number;
63
65
  };
64
- export type { IkasRelatedProductProps };
66
+ export type { IkasRelatedProductProps, IkasViewedTogetherProductProps };
@@ -1 +1 @@
1
- var E,D,A,T;!function(E){E.ALL="ALL",E.STATIC="STATIC",E.DISCOUNTED="DISCOUNTED",E.RECOMMENDED="RECOMMENDED",E.CATEGORY="CATEGORY",E.SEARCH="SEARCH",E.LAST_VIEWED="LAST_VIEWED",E.RELATED_PRODUCTS="RELATED_PRODUCTS"}(E||(E={})),function(E){E.INCREASING_PRICE="INCREASING_PRICE",E.DECREASING_PRICE="DECREASING_PRICE",E.LAST_ADDED="LAST_ADDED",E.FIRST_ADDED="FIRST_ADDED",E.INCREASING_DISCOUNT="INCREASING_DISCOUNT",E.DECRASING_DISCOUNT="DECRASING_DISCOUNT",E.FEATURED="FEATURED",E.DEFAULT="DEFAULT"}(D||(D={})),function(E){E.CATEGORY="CATEGORY",E.BRAND="BRAND"}(A||(A={})),function(E){E.HIDE_OUT_OF_STOCK="HIDE_OUT_OF_STOCK",E.SHOW_ALL="SHOW_ALL",E.SHOW_OUT_OF_STOCK_AT_END="SHOW_OUT_OF_STOCK_AT_END"}(T||(T={}));export{D as IkasProductListSortType,E as IkasProductListType,T as IkasProductSearchShowStockOption,A as IkasRelatedProductsType};
1
+ var E,D,T,A;!function(E){E.ALL="ALL",E.STATIC="STATIC",E.DISCOUNTED="DISCOUNTED",E.RECOMMENDED="RECOMMENDED",E.CATEGORY="CATEGORY",E.SEARCH="SEARCH",E.LAST_VIEWED="LAST_VIEWED",E.RELATED_PRODUCTS="RELATED_PRODUCTS",E.VIEWED_TOGETHER="VIEWED_TOGETHER"}(E||(E={})),function(E){E.INCREASING_PRICE="INCREASING_PRICE",E.DECREASING_PRICE="DECREASING_PRICE",E.LAST_ADDED="LAST_ADDED",E.FIRST_ADDED="FIRST_ADDED",E.INCREASING_DISCOUNT="INCREASING_DISCOUNT",E.DECRASING_DISCOUNT="DECRASING_DISCOUNT",E.FEATURED="FEATURED",E.DEFAULT="DEFAULT"}(D||(D={})),function(E){E.CATEGORY="CATEGORY",E.BRAND="BRAND"}(T||(T={})),function(E){E.HIDE_OUT_OF_STOCK="HIDE_OUT_OF_STOCK",E.SHOW_ALL="SHOW_ALL",E.SHOW_OUT_OF_STOCK_AT_END="SHOW_OUT_OF_STOCK_AT_END"}(A||(A={}));export{D as IkasProductListSortType,E as IkasProductListType,A as IkasProductSearchShowStockOption,T as IkasRelatedProductsType};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t,__assign as r}from'./../../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as i,IkasCategoryProductsOrderType as n}from"@ikas/storefront-models";import{IkasProductListType as o,IkasProductSearchShowStockOption as a,IkasProductListSortType as u}from"./index.js";import{IkasProductFilterFunctions as d}from"@ikas/storefront-model-functions";import{searchProducts as s,getSuggestedProducts as l,getProductFilterData as c,SortByDirectionEnum as f,SortByTypeEnum as v}from"@ikas/storefront-api";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";import"../blog-category-list/index.js";import"../blog-list/index.js";import"../brand-list/index.js";import"../category-list/index.js";function I(i,a){var s,l,c,f;return e(this,void 0,void 0,(function(){var e,v,p,I,T,g,y;return t(this,(function(t){switch(t.label){case 0:!function(e){var t;if((null===(t=e.pageSpecificData)||void 0===t?void 0:t.orderType)&&[o.ALL].includes(e.type))switch(e.pageSpecificData.orderType){case n.HIGHEST_DISCOUNT_RATIO:e.sort=u.DECRASING_DISCOUNT;break;case n.LOWEST_DISCOUNT_RATIO:e.sort=u.INCREASING_DISCOUNT;break;case n.HIGHEST_PRICE:e.sort=u.DECREASING_PRICE;break;case n.LOWEST_PRICE:e.sort=u.INCREASING_PRICE;break;case n.NEWEST:e.sort=u.LAST_ADDED;break;case n.OLDEST:e.sort=u.FIRST_ADDED;break;case n.MANUALLY:e.sort=u.FEATURED}}(i),i.isLoading=!0,e=Date.now(),i.fetchRequestTime=e,t.label=1;case 1:return t.trys.push([1,5,,6]),v=a?i.page:1,p=i.limit,!function(e){return e.type===o.ALL||e.type===o.CATEGORY}(i)||i.filters?[3,3]:[4,D(i)];case 2:t.sent(),t.label=3;case 3:if(S(i))return i.data=[],i.page=1,i.minPage=1,i.count=0,i.initialized=!0,[2,!0];if(void 0,C(i))v=void 0,p=200;else if(function(e){return e.type===o.DISCOUNTED}(i))v=1,p=10;else if(function(e){return e.type===o.RECOMMENDED}(i))v=1,p=10;else if(E(i))return[2];return[4,A(i,v||1,p||10,undefined)];case 4:return(I=t.sent())&&i.fetchRequestTime===e?(T=[],E(i)?[2]:(C(i)?(g=i.productListPropValue.productIds||[],T=(null==g?void 0:g.map((function(e){var t,i,n=null===(i=null===(t=I.data)||void 0===t?void 0:t.data)||void 0===i?void 0:i.find((function(t){return t.id===e.productId})),o=null==n?void 0:n.variants.find((function(t){return t.id===e.variantId}));if((null==o?void 0:o.isActive)||(o=null==n?void 0:n.variants.find((function(e){return e.isActive}))),n&&o)return r(r({},n),{selectedVariantValues:o.variantValues})})).filter((function(e){return!!e})))||[]):T=(null===(l=null===(s=I.data)||void 0===s?void 0:s.data)||void 0===l?void 0:l.map((function(e){var t=e.variants.find((function(e){return e.isActive}));return r(r({},e),{selectedVariantValues:(t||e.variants[0]).variantValues})})))||[],function(e,t){var r,i,n=d.isCustomValueFilter;null===(r=e.filters)||void 0===r||r.forEach((function(e){var r,i,o,a=null==t?void 0:t.find((function(t){return t.id===e.id}));a?null===(r=e.values)||void 0===r||r.forEach((function(t){var r=a.values.find((function(e){return e.id===t.id}));r?t.resultCount=r.count:n(e)?t.resultCount=null:t.resultCount=0})):n(e)?null===(i=e.values)||void 0===i||i.forEach((function(e){return e.resultCount=null})):null===(o=e.values)||void 0===o||o.forEach((function(e){return e.resultCount=0}))}));var o=null==t?void 0:t.find((function(e){return"category"===e.id}));o&&(null===(i=e.filterCategories)||void 0===i||i.forEach((function(e){var t=o.values.find((function(t){return t.id===e.id}));e.resultCount=t?t.count:0})))}(i,null===(c=I.data)||void 0===c?void 0:c.facets),i.data=T,i.count=(null===(f=I.data)||void 0===f?void 0:f.count)||0,i.initialized=!0,i.page=v||1,i.minPage=i.page,[2,!0])):[2];case 5:return y=t.sent(),console.error(y),[3,6];case 6:return[2]}}))}))}function C(e){return e.type===o.STATIC}function E(e){return e.type===o.LAST_VIEWED}function S(e){return e.type===o.SEARCH}function A(r,n,c,I){var E,A,D;return e(this,void 0,void 0,(function(){var e,T,g,y,R;return t(this,(function(t){switch(t.label){case 0:return e=[],T=[],g=d.getValueList,null===(E=r.filters)||void 0===E||E.forEach((function(t){var r=g(t);r.length&&e.push({id:t.id,type:t.type,displayType:t.displayType,valueList:r}),t.isFacetFilter&&T.push({id:t.id,type:t.type,displayType:t.displayType})})),y=null===(A=r.filterCategories)||void 0===A?void 0:A.filter((function(e){return e.isSelected})).map((function(e){return e.id})),R=function(e){var t,r;switch(e.sort){case u.INCREASING_PRICE:t=f.ASC,r=v.PRICE;break;case u.DECREASING_PRICE:t=f.DESC,r=v.PRICE;break;case u.FIRST_ADDED:t=f.ASC,r=v.CREATED_AT;break;case u.LAST_ADDED:t=f.DESC,r=v.CREATED_AT;break;case u.INCREASING_DISCOUNT:t=f.ASC,r=v.DISCOUNT_RATIO;break;case u.DECRASING_DISCOUNT:t=f.DESC,r=v.DISCOUNT_RATIO;break;case u.FEATURED:if(S(e))return;t=f.ASC,r=v.MANUAL_SORT;break;case u.DEFAULT:t=void 0,r=void 0}if(t&&r)return{direction:t,type:r}}(r),function(e){return e.type===o.RELATED_PRODUCTS}(r)&&r.relatedProductData?[4,l({priceListId:p.getPriceListId(),salesChannelId:p.getSalesChannelId(),productId:r.relatedProductData.productId,brandIds:r.relatedProductData.brandIds,categoryIds:r.relatedProductData.categoryIds,locale:p.getCurrentLocale()})]:[3,2];case 1:case 3:return[2,t.sent()];case 2:return[4,s({input:{page:n,perPage:c,productIdList:C(r)?null===(D=r.productListPropValue.productIds)||void 0===D?void 0:D.map((function(e){return e.productId})):I,filterList:e,facetList:T,brandId:r.pageType===i.BRAND&&r.type!==o.SEARCH?r.filterBrandId:void 0,categoryIdList:y&&y.length?y:r.filterCategoryId?[r.filterCategoryId]:void 0,priceListId:p.getPriceListId(),salesChannelId:p.getSalesChannelId(),query:r.searchKeyword,order:r.type===o.SEARCH?[]:R?[R]:[],showStockOption:p.getStockPreference()||a.SHOW_ALL}})]}}))}))}function D(r){var n,o,a;return e(this,void 0,void 0,(function(){var e,u;return t(this,(function(t){switch(t.label){case 0:return[4,c({categoryId:r.filterCategoryId?r.filterCategoryId:void 0,locale:p.getCurrentLocale()})];case 1:return e=t.sent(),r.filters=(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.filters)||null,r.filterCategories=(null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.categories)||null,r.pageType!==i.CATEGORY&&r.filterCategoryId&&(u=null===(a=r.filterCategories)||void 0===a?void 0:a.find((function(e){return e.id===r.filterCategoryId})))&&(u.isSelected=!0),r.filters&&r.filters.sort((function(e,t){return e.order>t.order?1:-1})),[2]}}))}))}export{I as getInitial};
1
+ import{__awaiter as e,__generator as t,__assign as r}from'./../../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as i,IkasCategoryProductsOrderType as n}from"@ikas/storefront-models";import{IkasProductListType as a,IkasProductSearchShowStockOption as o,IkasProductListSortType as u}from"./index.js";import{IkasProductFilterFunctions as d}from"@ikas/storefront-model-functions";import{searchProducts as s,getSuggestedProducts as l,getProductFilterData as c,SortByDirectionEnum as f,SortByTypeEnum as v}from"@ikas/storefront-api";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";import"../blog-category-list/index.js";import"../blog-list/index.js";import"../brand-list/index.js";import"../category-list/index.js";import{GetSuggestedProductsMethodEnum as I}from"@ikas/storefront-api/src/__api/types";function C(i,o){var s,l,c,f;return e(this,void 0,void 0,(function(){var e,v,p,I,C,A,y;return t(this,(function(t){switch(t.label){case 0:!function(e){var t;if((null===(t=e.pageSpecificData)||void 0===t?void 0:t.orderType)&&[a.ALL].includes(e.type))switch(e.pageSpecificData.orderType){case n.HIGHEST_DISCOUNT_RATIO:e.sort=u.DECRASING_DISCOUNT;break;case n.LOWEST_DISCOUNT_RATIO:e.sort=u.INCREASING_DISCOUNT;break;case n.HIGHEST_PRICE:e.sort=u.DECREASING_PRICE;break;case n.LOWEST_PRICE:e.sort=u.INCREASING_PRICE;break;case n.NEWEST:e.sort=u.LAST_ADDED;break;case n.OLDEST:e.sort=u.FIRST_ADDED;break;case n.MANUALLY:e.sort=u.FEATURED}}(i),i.isLoading=!0,e=Date.now(),i.fetchRequestTime=e,t.label=1;case 1:return t.trys.push([1,5,,6]),v=o?i.page:1,p=i.limit,!function(e){return e.type===a.ALL||e.type===a.CATEGORY}(i)||i.filters?[3,3]:[4,g(i)];case 2:t.sent(),t.label=3;case 3:if(D(i))return i.data=[],i.page=1,i.minPage=1,i.count=0,i.initialized=!0,[2,!0];if(void 0,E(i))v=void 0,p=200;else if(function(e){return e.type===a.DISCOUNTED}(i))v=1,p=10;else if(function(e){return e.type===a.RECOMMENDED}(i))v=1,p=10;else if(T(i))return[2];return[4,S(i,v||1,p||10,undefined)];case 4:return(I=t.sent())&&i.fetchRequestTime===e?(C=[],T(i)?[2]:(E(i)?(A=i.productListPropValue.productIds||[],C=(null==A?void 0:A.map((function(e){var t,i,n=null===(i=null===(t=I.data)||void 0===t?void 0:t.data)||void 0===i?void 0:i.find((function(t){return t.id===e.productId})),a=null==n?void 0:n.variants.find((function(t){return t.id===e.variantId}));if((null==a?void 0:a.isActive)||(a=null==n?void 0:n.variants.find((function(e){return e.isActive}))),n&&a)return r(r({},n),{selectedVariantValues:a.variantValues})})).filter((function(e){return!!e})))||[]):C=(null===(l=null===(s=I.data)||void 0===s?void 0:s.data)||void 0===l?void 0:l.map((function(e){var t=e.variants.find((function(e){return e.isActive}));return r(r({},e),{selectedVariantValues:(t||e.variants[0]).variantValues})})))||[],function(e,t){var r,i,n=d.isCustomValueFilter;null===(r=e.filters)||void 0===r||r.forEach((function(e){var r,i,a,o=null==t?void 0:t.find((function(t){return t.id===e.id}));o?null===(r=e.values)||void 0===r||r.forEach((function(t){var r=o.values.find((function(e){return e.id===t.id}));r?t.resultCount=r.count:n(e)?t.resultCount=null:t.resultCount=0})):n(e)?null===(i=e.values)||void 0===i||i.forEach((function(e){return e.resultCount=null})):null===(a=e.values)||void 0===a||a.forEach((function(e){return e.resultCount=0}))}));var a=null==t?void 0:t.find((function(e){return"category"===e.id}));a&&(null===(i=e.filterCategories)||void 0===i||i.forEach((function(e){var t=a.values.find((function(t){return t.id===e.id}));e.resultCount=t?t.count:0})))}(i,null===(c=I.data)||void 0===c?void 0:c.facets),i.data=C,i.count=(null===(f=I.data)||void 0===f?void 0:f.count)||0,i.initialized=!0,i.page=v||1,i.minPage=i.page,[2,!0])):[2];case 5:return y=t.sent(),console.error(y),[3,6];case 6:return[2]}}))}))}function E(e){return e.type===a.STATIC}function T(e){return e.type===a.LAST_VIEWED}function D(e){return e.type===a.SEARCH}function S(r,n,c,C){var T,S,g;return e(this,void 0,void 0,(function(){var e,A,y,R,h;return t(this,(function(t){switch(t.label){case 0:return e=[],A=[],y=d.getValueList,null===(T=r.filters)||void 0===T||T.forEach((function(t){var r=y(t);r.length&&e.push({id:t.id,type:t.type,displayType:t.displayType,valueList:r}),t.isFacetFilter&&A.push({id:t.id,type:t.type,displayType:t.displayType})})),R=null===(S=r.filterCategories)||void 0===S?void 0:S.filter((function(e){return e.isSelected})).map((function(e){return e.id})),h=function(e){var t,r;switch(e.sort){case u.INCREASING_PRICE:t=f.ASC,r=v.PRICE;break;case u.DECREASING_PRICE:t=f.DESC,r=v.PRICE;break;case u.FIRST_ADDED:t=f.ASC,r=v.CREATED_AT;break;case u.LAST_ADDED:t=f.DESC,r=v.CREATED_AT;break;case u.INCREASING_DISCOUNT:t=f.ASC,r=v.DISCOUNT_RATIO;break;case u.DECRASING_DISCOUNT:t=f.DESC,r=v.DISCOUNT_RATIO;break;case u.FEATURED:if(D(e))return;t=f.ASC,r=v.MANUAL_SORT;break;case u.DEFAULT:t=void 0,r=void 0}if(t&&r)return{direction:t,type:r}}(r),function(e){return e.type===a.RELATED_PRODUCTS}(r)&&r.relatedProductData?[4,l({priceListId:p.getPriceListId(),salesChannelId:p.getSalesChannelId(),productId:r.relatedProductData.productId,brandIds:r.relatedProductData.brandIds,categoryIds:r.relatedProductData.categoryIds,locale:p.getCurrentLocale()})]:[3,2];case 1:case 3:case 5:return[2,t.sent()];case 2:return function(e){return e.type===a.VIEWED_TOGETHER}(r)&&r.viewedTogetherProductData?[4,l({priceListId:p.getPriceListId(),salesChannelId:p.getSalesChannelId(),method:I.VIEWED_TOGETHER,productIds:r.viewedTogetherProductData.productIds,locale:p.getCurrentLocale()})]:[3,4];case 4:return[4,s({input:{page:n,perPage:c,productIdList:E(r)?null===(g=r.productListPropValue.productIds)||void 0===g?void 0:g.map((function(e){return e.productId})):C,filterList:e,facetList:A,brandId:r.pageType===i.BRAND&&r.type!==a.SEARCH?r.filterBrandId:void 0,categoryIdList:R&&R.length?R:r.filterCategoryId?[r.filterCategoryId]:void 0,priceListId:p.getPriceListId(),salesChannelId:p.getSalesChannelId(),query:r.searchKeyword,order:r.type===a.SEARCH?[]:h?[h]:[],showStockOption:p.getStockPreference()||o.SHOW_ALL}})]}}))}))}function g(r){var n,a,o;return e(this,void 0,void 0,(function(){var e,u;return t(this,(function(t){switch(t.label){case 0:return[4,c({categoryId:r.filterCategoryId?r.filterCategoryId:void 0,locale:p.getCurrentLocale()})];case 1:return e=t.sent(),r.filters=(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.filters)||null,r.filterCategories=(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.categories)||null,r.pageType!==i.CATEGORY&&r.filterCategoryId&&(u=null===(o=r.filterCategories)||void 0===o?void 0:o.find((function(e){return e.id===r.filterCategoryId})))&&(u.isSelected=!0),r.filters&&r.filters.sort((function(e,t){return e.order>t.order?1:-1})),[2]}}))}))}export{C as getInitial};
@@ -1 +1 @@
1
- import{IkasProductType as t,IkasRaffleVerificationType as e}from"@ikas/storefront-models";function a(){return{id:"",name:"",type:t.PHYSICAL,description:"",shortDescription:"",metaData:null,brand:null,categories:[],tags:[],variants:[],attributes:[],variantTypes:[],productOptionSetId:null,baseUnit:null,averageRating:null,reviewCount:null,groupVariantsByVariantTypeId:null}}function n(){return{categoryPath:[],description:null,imageId:null,name:"",parentId:null,metaData:null,categoryPathItems:[],orderType:null,id:"",createdAt:0,updatedAt:0}}function d(){return{description:null,imageId:null,metaData:null,orderType:null,name:"",id:"",createdAt:0,updatedAt:0}}function l(){return{createdAt:0,id:"",updatedAt:0,blogContent:{content:"",createdAt:0,id:"",updatedAt:0},categoryId:"",imageId:"",isPublished:!1,locale:null,metadata:{canonicals:[],description:"",disableIndex:!1,pageTitle:null,slug:"",targetId:null,targetType:null,createdAt:0,id:"",updatedAt:0},publishedAt:null,shortDescription:"",storefrontId:"",tagIds:[],tags:[],title:"",writer:{firstName:"",lastName:""},category:r()}}function r(){return{createdAt:0,id:"",updatedAt:0,imageId:"",metadata:{canonicals:[],description:"",disableIndex:!1,pageTitle:null,slug:"",targetId:null,targetType:null,createdAt:0,id:"",updatedAt:0},name:""}}function i(){return{createdAt:0,id:"",updatedAt:0,deleted:!1,dateRange:null,metadata:null,name:"",requiredCustomerAccount:!1,status:!1,variants:[],products:[],verificationType:e.EMAIL}}export{l as getPlaceholderBlog,r as getPlaceholderBlogCategory,d as getPlaceholderBrand,n as getPlaceholderCategory,a as getPlaceholderProduct,i as getPlaceholderRaffle};
1
+ import{IkasProductType as t,IkasRaffleVerificationType as e}from"@ikas/storefront-models";function a(){return{id:"",name:"",type:t.PHYSICAL,description:"",shortDescription:"",metaData:null,brand:null,categories:[],tags:[],variants:[],attributes:[],variantTypes:[],productOptionSetId:null,baseUnit:null,averageRating:null,reviewCount:null,stars:null,groupVariantsByVariantTypeId:null}}function n(){return{categoryPath:[],description:null,imageId:null,name:"",parentId:null,metaData:null,categoryPathItems:[],orderType:null,id:"",createdAt:0,updatedAt:0}}function l(){return{description:null,imageId:null,metaData:null,orderType:null,name:"",id:"",createdAt:0,updatedAt:0}}function r(){return{createdAt:0,id:"",updatedAt:0,blogContent:{content:"",createdAt:0,id:"",updatedAt:0},categoryId:"",imageId:"",isPublished:!1,locale:null,metadata:{canonicals:[],description:"",disableIndex:!1,pageTitle:null,slug:"",targetId:null,targetType:null,createdAt:0,id:"",updatedAt:0},publishedAt:null,shortDescription:"",storefrontId:"",tagIds:[],tags:[],title:"",writer:{firstName:"",lastName:""},category:d()}}function d(){return{createdAt:0,id:"",updatedAt:0,imageId:"",metadata:{canonicals:[],description:"",disableIndex:!1,pageTitle:null,slug:"",targetId:null,targetType:null,createdAt:0,id:"",updatedAt:0},name:""}}function i(){return{createdAt:0,id:"",updatedAt:0,deleted:!1,dateRange:null,metadata:null,name:"",requiredCustomerAccount:!1,status:!1,variants:[],products:[],verificationType:e.EMAIL}}export{r as getPlaceholderBlog,d as getPlaceholderBlogCategory,l as getPlaceholderBrand,n as getPlaceholderCategory,a as getPlaceholderProduct,i as getPlaceholderRaffle};
@@ -7,11 +7,15 @@ export declare type IkasRelatedProductProps = {
7
7
  categoryIds: string[] | null;
8
8
  productId: string;
9
9
  };
10
+ export declare type IkasViewedTogetherProductProps = {
11
+ productIds: string[];
12
+ };
10
13
  export declare class IkasProductListPropValueProvider implements IkasPropValueProvider<IkasProductList> {
11
14
  private pageType;
12
15
  private productListPropValue;
13
16
  private pageSpecificData?;
14
17
  private relatedProductData?;
18
+ private viewedTogetherProductData?;
15
19
  constructor(pageType: IkasThemeJsonPageType, productListPropValue: IkasProductListPropValue, pageSpecificData?: any);
16
20
  getValue(): Promise<IkasProductList>;
17
21
  }
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as i}from'./../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as e}from"@ikas/storefront-models";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import{IkasProductListType as r,IkasRelatedProductsType as a,IkasProductListSortType as o}from"../../models/ui/product-list/index.js";import{getInitial as s}from"../../models/ui/product-list/init.js";var p=function(){function p(t,i,e){this.relatedProductData=null,this.pageType=t,this.productListPropValue=i,this.pageSpecificData=e,this.relatedProductData=null}return p.prototype.getValue=function(){var p,d;return t(this,void 0,void 0,(function(){var t,u,l,c,n;return i(this,(function(i){switch(i.label){case 0:return this.productListPropValue.productListType===r.ALL&&this.productListPropValue.usePageFilter&&(this.pageType===e.CATEGORY?(l=this.pageSpecificData,u=l.id):this.pageType===e.BRAND&&(c=this.pageSpecificData,t=c.id)),this.productListPropValue.productListType===r.CATEGORY&&this.productListPropValue.category&&(u=this.productListPropValue.category),this.pageType===e.PRODUCT&&this.productListPropValue.productListType===r.RELATED_PRODUCTS&&this.productListPropValue.relatedProductsType&&this.pageSpecificData&&(this.relatedProductData={brandIds:null,categoryIds:null,productId:""},this.productListPropValue.relatedProductsType===a.CATEGORY?this.relatedProductData.categoryIds=this.pageSpecificData.categories.map((function(t){return t.id})):this.relatedProductData.brandIds=[null===(d=null===(p=this.pageSpecificData)||void 0===p?void 0:p.brand)||void 0===d?void 0:d.id],this.relatedProductData.productId=this.pageSpecificData.id),n={data:[],count:0,page:1,limit:this.productListPropValue.initialLimit||10,type:this.productListPropValue.productListType||r.ALL,sort:this.productListPropValue.initialSort||o.LAST_ADDED,productListPropValue:this.productListPropValue,filterBrandId:t,filterCategoryId:u,pageType:this.pageType,pageSpecificData:[e.CATEGORY,e.BRAND].includes(this.pageType)?this.pageSpecificData:void 0,relatedProductData:this.relatedProductData,filters:null,infiniteScrollPage:null},[4,s(n)];case 1:return i.sent(),[2,n]}}))}))},p}();export{p as IkasProductListPropValueProvider};
1
+ import{__awaiter as t,__generator as i}from'./../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as e}from"@ikas/storefront-models";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import{IkasProductListType as r,IkasRelatedProductsType as a,IkasProductListSortType as o}from"../../models/ui/product-list/index.js";import{getInitial as s}from"../../models/ui/product-list/init.js";var d=function(){function d(t,i,e){this.relatedProductData=null,this.viewedTogetherProductData=null,this.pageType=t,this.productListPropValue=i,this.pageSpecificData=e,this.relatedProductData=null,this.viewedTogetherProductData=null}return d.prototype.getValue=function(){var d,p;return t(this,void 0,void 0,(function(){var t,u,c,l,h;return i(this,(function(i){switch(i.label){case 0:return this.productListPropValue.productListType===r.ALL&&this.productListPropValue.usePageFilter&&(this.pageType===e.CATEGORY?(c=this.pageSpecificData,u=c.id):this.pageType===e.BRAND&&(l=this.pageSpecificData,t=l.id)),this.productListPropValue.productListType===r.CATEGORY&&this.productListPropValue.category&&(u=this.productListPropValue.category),this.pageType===e.PRODUCT&&this.productListPropValue.productListType===r.RELATED_PRODUCTS&&this.productListPropValue.relatedProductsType&&this.pageSpecificData&&(this.relatedProductData={brandIds:null,categoryIds:null,productId:""},this.productListPropValue.relatedProductsType===a.CATEGORY?this.relatedProductData.categoryIds=this.pageSpecificData.categories.map((function(t){return t.id})):this.relatedProductData.brandIds=[null===(p=null===(d=this.pageSpecificData)||void 0===d?void 0:d.brand)||void 0===p?void 0:p.id],this.relatedProductData.productId=this.pageSpecificData.id),this.pageType===e.PRODUCT&&this.productListPropValue.productListType===r.VIEWED_TOGETHER&&this.pageSpecificData&&(this.viewedTogetherProductData={productIds:[]},this.viewedTogetherProductData.productIds=[this.pageSpecificData.id]),h={data:[],count:0,page:1,limit:this.productListPropValue.initialLimit||10,type:this.productListPropValue.productListType||r.ALL,sort:this.productListPropValue.initialSort||o.LAST_ADDED,productListPropValue:this.productListPropValue,filterBrandId:t,filterCategoryId:u,pageType:this.pageType,pageSpecificData:[e.CATEGORY,e.BRAND].includes(this.pageType)?this.pageSpecificData:void 0,relatedProductData:this.relatedProductData,viewedTogetherProductData:this.viewedTogetherProductData,filters:null,infiniteScrollPage:null},[4,s(h)];case 1:return i.sent(),[2,h]}}))}))},d}();export{d as IkasProductListPropValueProvider};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront-providers",
3
- "version": "4.4.0-beta.1",
3
+ "version": "4.4.0-beta.11",
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.4.0-beta.1",
21
- "@ikas/storefront-config": "^4.4.0-beta.1",
22
- "@ikas/storefront-model-functions": "^4.4.0-beta.1",
23
- "@ikas/storefront-models": "^4.4.0-beta.1",
20
+ "@ikas/storefront-api": "^4.4.0-beta.11",
21
+ "@ikas/storefront-config": "^4.4.0-beta.11",
22
+ "@ikas/storefront-model-functions": "^4.4.0-beta.11",
23
+ "@ikas/storefront-models": "^4.4.0-beta.11",
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.4.0-beta.1",
42
- "@ikas/storefront-config": "^4.4.0-beta.1",
43
- "@ikas/storefront-model-functions": "^4.4.0-beta.1",
44
- "@ikas/storefront-models": "^4.4.0-beta.1",
41
+ "@ikas/storefront-api": "^4.4.0-beta.11",
42
+ "@ikas/storefront-config": "^4.4.0-beta.11",
43
+ "@ikas/storefront-model-functions": "^4.4.0-beta.11",
44
+ "@ikas/storefront-models": "^4.4.0-beta.11",
45
45
  "lodash": "^4.17.21"
46
46
  }
47
47
  }