@ikas/storefront-providers 4.5.0-beta.4 → 4.5.0-beta.6

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.
Files changed (109) hide show
  1. package/build/ext/tslib/tslib.es6.js +1 -0
  2. package/build/index.d.ts +20 -0
  3. package/build/index.js +1 -0
  4. package/build/models/prop-value/attribute-list.d.ts +6 -0
  5. package/build/models/prop-value/attribute.d.ts +6 -0
  6. package/build/models/prop-value/blog-category-list.d.ts +6 -0
  7. package/build/models/prop-value/blog-category.d.ts +4 -0
  8. package/build/models/prop-value/blog-list.d.ts +8 -0
  9. package/build/models/prop-value/blog.d.ts +4 -0
  10. package/build/models/prop-value/brand-list.d.ts +8 -0
  11. package/build/models/prop-value/brand.d.ts +4 -0
  12. package/build/models/prop-value/brand.js +1 -0
  13. package/build/models/prop-value/category-list.d.ts +8 -0
  14. package/build/models/prop-value/category.d.ts +4 -0
  15. package/build/models/prop-value/image.d.ts +4 -0
  16. package/build/models/prop-value/link.d.ts +18 -0
  17. package/build/models/prop-value/link.js +1 -0
  18. package/build/models/prop-value/product-list.d.ts +17 -0
  19. package/build/models/prop-value/product.d.ts +5 -0
  20. package/build/models/prop-value/raffle-list.d.ts +4 -0
  21. package/build/models/prop-value/raffle.d.ts +4 -0
  22. package/build/models/ui/blog-category-list/index.d.ts +17 -0
  23. package/build/models/ui/blog-category-list/index.js +1 -0
  24. package/build/models/ui/blog-category-list/init.d.ts +2 -0
  25. package/build/models/ui/blog-category-list/init.js +1 -0
  26. package/build/models/ui/blog-list/index.d.ts +19 -0
  27. package/build/models/ui/blog-list/index.js +1 -0
  28. package/build/models/ui/blog-list/init.d.ts +2 -0
  29. package/build/models/ui/blog-list/init.js +1 -0
  30. package/build/models/ui/brand-list/index.d.ts +22 -0
  31. package/build/models/ui/brand-list/index.js +1 -0
  32. package/build/models/ui/brand-list/init.d.ts +2 -0
  33. package/build/models/ui/brand-list/init.js +1 -0
  34. package/build/models/ui/category-list/index.d.ts +22 -0
  35. package/build/models/ui/category-list/index.js +1 -0
  36. package/build/models/ui/category-list/init.d.ts +2 -0
  37. package/build/models/ui/category-list/init.js +1 -0
  38. package/build/models/ui/component-renderer/index.d.ts +6 -0
  39. package/build/models/ui/customer-review-list/index.d.ts +11 -0
  40. package/build/models/ui/customer-review-list/init.d.ts +2 -0
  41. package/build/models/ui/customer-review-summary-list/index.d.ts +11 -0
  42. package/build/models/ui/customer-review-summary-list/init.d.ts +2 -0
  43. package/build/models/ui/index.d.ts +12 -0
  44. package/build/models/ui/navigation-link/index.d.ts +7 -0
  45. package/build/models/ui/product-attribute-detail/index.d.ts +6 -0
  46. package/build/models/ui/product-attribute-list/index.d.ts +6 -0
  47. package/build/models/ui/product-list/index.d.ts +66 -0
  48. package/build/models/ui/product-list/index.js +1 -0
  49. package/build/models/ui/product-list/init.d.ts +2 -0
  50. package/build/models/ui/product-list/init.js +1 -0
  51. package/build/models/ui/raffle-list/index.d.ts +16 -0
  52. package/build/models/ui/raffle-list/init.d.ts +2 -0
  53. package/build/models/ui/raffle-list/init.js +1 -0
  54. package/build/providers/helpers/raffle.d.ts +3 -0
  55. package/build/providers/helpers/raffle.js +1 -0
  56. package/build/providers/page-data-get.d.ts +32 -0
  57. package/build/providers/page-data-get.js +1 -0
  58. package/build/providers/placeholders.d.ts +7 -0
  59. package/build/providers/placeholders.js +1 -0
  60. package/build/providers/prop-value/attribute-list.d.ts +8 -0
  61. package/build/providers/prop-value/attribute-list.js +1 -0
  62. package/build/providers/prop-value/attribute.d.ts +8 -0
  63. package/build/providers/prop-value/attribute.js +1 -0
  64. package/build/providers/prop-value/blog-category-list.d.ts +8 -0
  65. package/build/providers/prop-value/blog-category-list.js +1 -0
  66. package/build/providers/prop-value/blog-category.d.ts +8 -0
  67. package/build/providers/prop-value/blog-category.js +1 -0
  68. package/build/providers/prop-value/blog-list.d.ts +11 -0
  69. package/build/providers/prop-value/blog-list.js +1 -0
  70. package/build/providers/prop-value/blog.d.ts +8 -0
  71. package/build/providers/prop-value/blog.js +1 -0
  72. package/build/providers/prop-value/boolean.d.ts +6 -0
  73. package/build/providers/prop-value/boolean.js +1 -0
  74. package/build/providers/prop-value/brand-list.d.ts +8 -0
  75. package/build/providers/prop-value/brand-list.js +1 -0
  76. package/build/providers/prop-value/brand.d.ts +8 -0
  77. package/build/providers/prop-value/brand.js +1 -0
  78. package/build/providers/prop-value/category-list.d.ts +8 -0
  79. package/build/providers/prop-value/category-list.js +1 -0
  80. package/build/providers/prop-value/category.d.ts +8 -0
  81. package/build/providers/prop-value/category.js +1 -0
  82. package/build/providers/prop-value/color.d.ts +6 -0
  83. package/build/providers/prop-value/color.js +1 -0
  84. package/build/providers/prop-value/custom.d.ts +42 -0
  85. package/build/providers/prop-value/custom.js +1 -0
  86. package/build/providers/prop-value/image-list.d.ts +8 -0
  87. package/build/providers/prop-value/image-list.js +1 -0
  88. package/build/providers/prop-value/image.d.ts +9 -0
  89. package/build/providers/prop-value/image.js +1 -0
  90. package/build/providers/prop-value/index.d.ts +3 -0
  91. package/build/providers/prop-value/link.d.ts +26 -0
  92. package/build/providers/prop-value/link.js +1 -0
  93. package/build/providers/prop-value/product-detail.d.ts +8 -0
  94. package/build/providers/prop-value/product-detail.js +1 -0
  95. package/build/providers/prop-value/product-list.d.ts +21 -0
  96. package/build/providers/prop-value/product-list.js +1 -0
  97. package/build/providers/prop-value/raffle-list.d.ts +5 -0
  98. package/build/providers/prop-value/raffle-list.js +1 -0
  99. package/build/providers/prop-value/raffle.d.ts +8 -0
  100. package/build/providers/prop-value/raffle.js +1 -0
  101. package/build/providers/prop-value/rich-text.d.ts +6 -0
  102. package/build/providers/prop-value/rich-text.js +1 -0
  103. package/build/providers/prop-value/slider.d.ts +7 -0
  104. package/build/providers/prop-value/slider.js +1 -0
  105. package/build/providers/prop-value/text.d.ts +6 -0
  106. package/build/providers/prop-value/text.js +1 -0
  107. package/build/providers/types.d.ts +66 -0
  108. package/build/providers/types.js +1 -0
  109. package/package.json +12 -12
@@ -0,0 +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,stars:null,groupVariantsByVariantTypeId:null,deleted:!1}}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 d(){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{d as getPlaceholderBlog,r as getPlaceholderBlogCategory,l as getPlaceholderBrand,n as getPlaceholderCategory,a as getPlaceholderProduct,i as getPlaceholderRaffle};
@@ -0,0 +1,8 @@
1
+ import IkasPropValueProvider from ".";
2
+ import { IkasAttributeListPropValue } from "../../models/prop-value/attribute-list";
3
+ import { IkasAttributeListPropValueData } from "../types";
4
+ export declare class IkasAttributeListPropValueProvider implements IkasPropValueProvider<IkasAttributeListPropValueData> {
5
+ private attributeListPropValue;
6
+ constructor(prop: IkasAttributeListPropValue);
7
+ getValue(): Promise<IkasAttributeListPropValueData>;
8
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as i}from'./../../ext/tslib/tslib.es6.js';import{searchProducts as a}from"@ikas/storefront-api";import{IkasStorefrontConfig as e}from"@ikas/storefront-config";import{IkasProductFunctions as r}from"@ikas/storefront-model-functions";var s=function(){function s(t){this.attributeListPropValue=t}return s.prototype.getValue=function(){var s,u;return t(this,void 0,void 0,(function(){var t,n,o,l,d,p,c,V=this;return i(this,(function(i){switch(i.label){case 0:return!(null===(s=this.attributeListPropValue.attributeIds)||void 0===s?void 0:s.length)||this.attributeListPropValue.usePageData||!this.attributeListPropValue.usePageData&&!this.attributeListPropValue.variantId?[2,{productDetail:null,attributeListPropValue:this.attributeListPropValue}]:[4,a({input:{productIdList:[this.attributeListPropValue.productId],priceListId:e.getPriceListId(),salesChannelId:e.getSalesChannelId()}})];case 1:return(n=i.sent()).isSuccess&&(null===(u=n.data)||void 0===u?void 0:u.data)&&(o=n.data.data,l=r.hasVariant,o.length&&((d=o[0])&&l(d)?(p=d.variants.find((function(t){return t.id===V.attributeListPropValue.variantId})))&&(d.selectedVariantValues=p.variantValues,t=d):(c=d.variants.find((function(t){return t.isActive})),d.selectedVariantValues=(c||d.variants[0]).variantValues,t=d))),[2,{productDetail:t||null,attributeListPropValue:this.attributeListPropValue}]}}))}))},s}();export{s as IkasAttributeListPropValueProvider};
@@ -0,0 +1,8 @@
1
+ import IkasPropValueProvider from ".";
2
+ import { IkasAttributePropValue } from "../../models/prop-value/attribute";
3
+ import { IkasAttributePropValueData } from "../types";
4
+ export declare class IkasAttributePropValueProvider implements IkasPropValueProvider<IkasAttributePropValueData> {
5
+ private attributePropValue;
6
+ constructor(prop: IkasAttributePropValue);
7
+ getValue(): Promise<IkasAttributePropValueData>;
8
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as a}from'./../../ext/tslib/tslib.es6.js';import{searchProducts as i}from"@ikas/storefront-api";import{IkasStorefrontConfig as e}from"@ikas/storefront-config";import{IkasProductFunctions as r}from"@ikas/storefront-model-functions";var u=function(){function u(t){this.attributePropValue=t}return u.prototype.getValue=function(){var u,n;return t(this,void 0,void 0,(function(){var t,o,s,l,d,p,c,V=this;return a(this,(function(a){switch(a.label){case 0:return!this.attributePropValue.attributeId||(null===(u=this.attributePropValue)||void 0===u?void 0:u.usePageData)||!this.attributePropValue.usePageData&&!this.attributePropValue.variantId?[2,{productDetail:null,attributePropValue:this.attributePropValue}]:[4,i({input:{productIdList:[this.attributePropValue.productId],priceListId:e.getPriceListId(),salesChannelId:e.getSalesChannelId()}})];case 1:return(o=a.sent()).isSuccess&&(null===(n=o.data)||void 0===n?void 0:n.data)&&(s=o.data.data).length&&(l=s[0],d=r.hasVariant,l&&d(l)?(p=l.variants.find((function(t){return t.id===V.attributePropValue.variantId})))&&(l.selectedVariantValues=p.variantValues,t=l):(c=l.variants.find((function(t){return t.isActive})),l.selectedVariantValues=(c||l.variants[0]).variantValues,t=l)),[2,{productDetail:t||null,attributePropValue:this.attributePropValue}]}}))}))},u}();export{u as IkasAttributePropValueProvider};
@@ -0,0 +1,8 @@
1
+ import IkasPropValueProvider from ".";
2
+ import { IkasBlogCategoryListPropValue } from "../../models/prop-value/blog-category-list";
3
+ import { IkasBlogCategoryList } from "../../models/ui";
4
+ export declare class IkasBlogCategoryListPropValueProvider implements IkasPropValueProvider<IkasBlogCategoryList> {
5
+ private blogCategoryListPropValue;
6
+ constructor(blogCategoryListPropValue: IkasBlogCategoryListPropValue);
7
+ getValue(): Promise<IkasBlogCategoryList>;
8
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as o}from'./../../ext/tslib/tslib.es6.js';import{getInitial as e}from"../../models/ui/blog-category-list/init.js";var i=function(){function i(t){this.blogCategoryListPropValue=t}return i.prototype.getValue=function(){return t(this,void 0,void 0,(function(){var t;return o(this,(function(o){switch(o.label){case 0:return t={data:[],count:0,page:1,limit:10,blogCategoryListPropValue:this.blogCategoryListPropValue,type:this.blogCategoryListPropValue.blogCategoryListType},[4,e(t)];case 1:return o.sent(),[2,t]}}))}))},i}();export{i as IkasBlogCategoryListPropValueProvider};
@@ -0,0 +1,8 @@
1
+ import IkasPropValueProvider from ".";
2
+ import { IkasBlogCategoryPropValue } from "../../models/prop-value/blog-category";
3
+ import { IkasBlogCategoryPropValueData } from "../types";
4
+ export declare class IkasBlogCategoryPropValueProvider implements IkasPropValueProvider<IkasBlogCategoryPropValueData | null> {
5
+ private blogCategoryPropValue;
6
+ constructor(propValue: IkasBlogCategoryPropValue);
7
+ getValue(): Promise<IkasBlogCategoryPropValueData | null>;
8
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as o,__generator as t}from'./../../ext/tslib/tslib.es6.js';import{listBlogCategory as a}from"@ikas/storefront-api";import{getPlaceholderBlogCategory as e}from"../placeholders.js";var r=function(){function r(o){this.blogCategoryPropValue=o}return r.prototype.getValue=function(){var r,l;return o(this,void 0,void 0,(function(){var o;return t(this,(function(t){switch(t.label){case 0:return(null===(r=this.blogCategoryPropValue)||void 0===r?void 0:r.usePageData)?[2,{blogCategory:null,blogCategoryPropValue:this.blogCategoryPropValue}]:this.blogCategoryPropValue.blogCategoryId?[4,a({id:{eq:this.blogCategoryPropValue.blogCategoryId},pagination:{page:1,limit:1}})]:[2,null];case 1:return(o=t.sent()).isSuccess&&(null===(l=o.data)||void 0===l?void 0:l.data)?[2,{blogCategory:o.data.data[0]||e(),blogCategoryPropValue:this.blogCategoryPropValue}]:[2,{blogCategory:e(),blogCategoryPropValue:this.blogCategoryPropValue}]}}))}))},r}();export{r as IkasBlogCategoryPropValueProvider};
@@ -0,0 +1,11 @@
1
+ import { IkasThemeJsonPageType } from "@ikas/storefront-models";
2
+ import IkasPropValueProvider from ".";
3
+ import { IkasBlogListPropValue } from "../../models/prop-value/blog-list";
4
+ import { IkasBlogList } from "../../models/ui";
5
+ export declare class IkasBlogListPropValueProvider implements IkasPropValueProvider<IkasBlogList> {
6
+ private pageType;
7
+ private blogListPropValue;
8
+ private pageSpecificData?;
9
+ constructor(pageType: IkasThemeJsonPageType, blogListPropValue: IkasBlogListPropValue, pageSpecificData?: any);
10
+ getValue(): Promise<IkasBlogList>;
11
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as i,__generator as t}from'./../../ext/tslib/tslib.es6.js';import{IkasThemeJsonPageType as o}from"@ikas/storefront-models";import"../../models/ui/blog-category-list/index.js";import{IkasBlogListType as e}from"../../models/ui/blog-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import{getInitial as s}from"../../models/ui/blog-list/init.js";var l=function(){function l(i,t,o){this.pageType=i,this.blogListPropValue=t,this.pageSpecificData=o}return l.prototype.getValue=function(){return i(this,void 0,void 0,(function(){var i,l,r;return t(this,(function(t){switch(t.label){case 0:return i=null,this.blogListPropValue.blogListType===e.ALL&&this.blogListPropValue.usePageFilter&&this.pageType===o.BLOG_CATEGORY&&this.pageSpecificData&&(l=this.pageSpecificData,i=l.id),this.blogListPropValue.blogListType===e.CATEGORY&&this.blogListPropValue.categoryId&&(i=this.blogListPropValue.categoryId),r={data:[],count:0,type:this.blogListPropValue.blogListType,page:1,limit:this.blogListPropValue.initialLimit||10,blogListPropValue:this.blogListPropValue,filterCategoryId:i},[4,s(r)];case 1:return t.sent(),[2,r]}}))}))},l}();export{l as IkasBlogListPropValueProvider};
@@ -0,0 +1,8 @@
1
+ import IkasPropValueProvider from ".";
2
+ import { IkasBlogPropValue } from "../../models/prop-value/blog";
3
+ import { IkasBlogPropValueData } from "../types";
4
+ export declare class IkasBlogPropValueProvider implements IkasPropValueProvider<IkasBlogPropValueData | null> {
5
+ private blogPropValue;
6
+ constructor(propValue: IkasBlogPropValue);
7
+ getValue(): Promise<IkasBlogPropValueData | null>;
8
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as o,__generator as l}from'./../../ext/tslib/tslib.es6.js';import{listBlog as t}from"@ikas/storefront-api";import{getPlaceholderBlog as e}from"../placeholders.js";var r=function(){function r(o){this.blogPropValue=o}return r.prototype.getValue=function(){var r,i,a;return o(this,void 0,void 0,(function(){var o;return l(this,(function(l){switch(l.label){case 0:return(null===(r=this.blogPropValue)||void 0===r?void 0:r.usePageData)?[2,{blog:null,blogPropValue:this.blogPropValue}]:this.blogPropValue.blogId?[4,t({id:{eq:this.blogPropValue.blogId}})]:[2,null];case 1:return(o=l.sent()).isSuccess&&(null===(a=null===(i=o.data)||void 0===i?void 0:i.data)||void 0===a?void 0:a.length)?[2,{blog:o.data.data[0]||e(),blogPropValue:this.blogPropValue}]:[2,{blog:e(),blogPropValue:this.blogPropValue}]}}))}))},r}();export{r as IkasBlogPropValueProvider};
@@ -0,0 +1,6 @@
1
+ import IkasPropValueProvider from ".";
2
+ export declare class IkasBooleanPropValueProvider implements IkasPropValueProvider<boolean> {
3
+ private bool;
4
+ constructor(boolPropValue: boolean);
5
+ getValue(): Promise<boolean>;
6
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as o}from'./../../ext/tslib/tslib.es6.js';var n=function(){function n(t){this.bool=t}return n.prototype.getValue=function(){return t(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.bool||!1]}))}))},n}();export{n as IkasBooleanPropValueProvider};
@@ -0,0 +1,8 @@
1
+ import IkasPropValueProvider from ".";
2
+ import { IkasBrandListPropValue } from "../../models/prop-value/brand-list";
3
+ import { IkasBrandList } from "../../models/ui";
4
+ export declare class IkasBrandListPropValueProvider implements IkasPropValueProvider<IkasBrandList> {
5
+ private brandListPropValue;
6
+ constructor(brandListPropValue: IkasBrandListPropValue);
7
+ getValue(): Promise<IkasBrandList>;
8
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as i,__generator as t}from'./../../ext/tslib/tslib.es6.js';import"../../models/ui/blog-category-list/index.js";import"../../models/ui/blog-list/index.js";import{IkasBrandListSortType as r}from"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import{getInitial as o}from"../../models/ui/brand-list/init.js";var s=function(){function s(i){this.brandListPropValue=i}return s.prototype.getValue=function(){return i(this,void 0,void 0,(function(){var i;return t(this,(function(t){switch(t.label){case 0:return i={data:[],count:0,type:this.brandListPropValue.brandListType,sort:this.brandListPropValue.initialSort||r.A_Z,page:1,limit:this.brandListPropValue.initialLimit||10,brandListPropValue:this.brandListPropValue},[4,o(i)];case 1:return t.sent(),[2,i]}}))}))},s}();export{s as IkasBrandListPropValueProvider};
@@ -0,0 +1,8 @@
1
+ import IkasPropValueProvider from ".";
2
+ import { IkasBrandPropValue } from "../../models/prop-value/brand";
3
+ import { IkasBrandPropValueData } from "../types";
4
+ export declare class IkasBrandPropValueProvider implements IkasPropValueProvider<IkasBrandPropValueData | null> {
5
+ private brandPropValue;
6
+ constructor(prop: IkasBrandPropValue);
7
+ getValue(): Promise<IkasBrandPropValueData | null>;
8
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as r,__generator as a}from'./../../ext/tslib/tslib.es6.js';import{listProductBrand as t}from"@ikas/storefront-api";import{getPlaceholderBrand as e}from"../placeholders.js";var n=function(){function n(r){this.brandPropValue=r}return n.prototype.getValue=function(){var n;return r(this,void 0,void 0,(function(){var r,o;return a(this,(function(a){switch(a.label){case 0:if(this.brandPropValue.usePageData)return[2,{brand:null,brandPropValue:this.brandPropValue}];if(!this.brandPropValue.brandId)return[2,null];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,t({id:{eq:this.brandPropValue.brandId}})];case 2:return(r=a.sent()).isSuccess&&(null===(n=r.data)||void 0===n?void 0:n.data)?[2,{brand:r.data.data.length?r.data.data[0]:e(),brandPropValue:this.brandPropValue}]:[3,4];case 3:return o=a.sent(),console.log(o),[3,4];case 4:return[2,null]}}))}))},n}();export{n as IkasBrandPropValueProvider};
@@ -0,0 +1,8 @@
1
+ import IkasPropValueProvider from ".";
2
+ import { IkasCategoryListPropValue } from "../../models/prop-value/category-list";
3
+ import { IkasCategoryList } from "../../models/ui";
4
+ export declare class IkasCategoryListPropValueProvider implements IkasPropValueProvider<IkasCategoryList> {
5
+ private categoryListPropValue;
6
+ constructor(categoryListPropValue: IkasCategoryListPropValue);
7
+ getValue(): Promise<IkasCategoryList>;
8
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as i}from'./../../ext/tslib/tslib.es6.js';import"../../models/ui/blog-category-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/brand-list/index.js";import{IkasCategoryListSortType as o}from"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import{getInitial as e}from"../../models/ui/category-list/init.js";var r=function(){function r(t){this.categoryListPropValue=t}return r.prototype.getValue=function(){return t(this,void 0,void 0,(function(){var t;return i(this,(function(i){switch(i.label){case 0:return t={data:[],count:0,type:this.categoryListPropValue.categoryListType,sort:this.categoryListPropValue.initialSort||o.A_Z,page:1,limit:this.categoryListPropValue.initialLimit||10,categoryListPropValue:this.categoryListPropValue},[4,e(t)];case 1:return i.sent(),[2,t]}}))}))},r}();export{r as IkasCategoryListPropValueProvider};
@@ -0,0 +1,8 @@
1
+ import IkasPropValueProvider from ".";
2
+ import { IkasCategoryPropValue } from "../../models/prop-value/category";
3
+ import { IkasCategoryPropValueData } from "../types";
4
+ export declare class IkasCategoryPropValueProvider implements IkasPropValueProvider<IkasCategoryPropValueData | null> {
5
+ private categoryPropValue;
6
+ constructor(prop: IkasCategoryPropValue);
7
+ getValue(): Promise<IkasCategoryPropValueData | null>;
8
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as e}from'./../../ext/tslib/tslib.es6.js';import{listCategory as r}from"@ikas/storefront-api";import{getPlaceholderCategory as o}from"../placeholders.js";var a=function(){function a(t){this.categoryPropValue=t}return a.prototype.getValue=function(){var a,l;return t(this,void 0,void 0,(function(){var t,u;return e(this,(function(e){switch(e.label){case 0:if(this.categoryPropValue.usePageData)return[2,{category:null,categoryPropValue:this.categoryPropValue}];if(!this.categoryPropValue.categoryId)return[2,null];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,r({id:{eq:this.categoryPropValue.categoryId}})];case 2:return t=e.sent(),[2,{category:(null===(l=null===(a=t.data)||void 0===a?void 0:a.data)||void 0===l?void 0:l.length)?t.data.data[0]:o(),categoryPropValue:this.categoryPropValue}];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2,null]}}))}))},a}();export{a as IkasCategoryPropValueProvider};
@@ -0,0 +1,6 @@
1
+ import IkasPropValueProvider from ".";
2
+ export declare class IkasColorPropValueProvider implements IkasPropValueProvider<string> {
3
+ private color;
4
+ constructor(colorPropValue: string);
5
+ getValue(): Promise<string>;
6
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as o}from'./../../ext/tslib/tslib.es6.js';var n=function(){function n(t){this.color=t}return n.prototype.getValue=function(){return t(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.color]}))}))},n}();export{n as IkasColorPropValueProvider};
@@ -0,0 +1,42 @@
1
+ import IkasPropValueProvider from ".";
2
+ import { IkasPageDataProvider } from "../page-data-get";
3
+ import { IkasThemeJson, IkasThemeJsonCustomData, IkasThemeJsonPageType } from "@ikas/storefront-models";
4
+ import { IkasCustomDataPropValueData } from "../types";
5
+ export declare class IkasCustomPropValueProvider implements IkasPropValueProvider<IkasCustomDataPropValueData | undefined> {
6
+ private value;
7
+ private customData;
8
+ private theme;
9
+ private pageType;
10
+ private pageSpecificData?;
11
+ private pageParams?;
12
+ private pageDataProvider;
13
+ constructor(value: any, customData: IkasThemeJsonCustomData, theme: IkasThemeJson, pageType: IkasThemeJsonPageType, pageDataProvider: IkasPageDataProvider, pageSpecificData?: any, pageParams?: Record<string, any>);
14
+ getValue(): Promise<IkasCustomDataPropValueData | undefined>;
15
+ private getBooleanValue;
16
+ private getBrandListPropValue;
17
+ private getBrandPropValue;
18
+ private getCategoryListPropValue;
19
+ private getCategoryPropValue;
20
+ private getColorPropValue;
21
+ private getRichTextPropValue;
22
+ private getImageListPropValue;
23
+ private getImagePropValue;
24
+ private getLinkPropValue;
25
+ private getProductDetailPropValue;
26
+ private getProductListPropValue;
27
+ private getProductAttributePropValue;
28
+ private getProductAttributeListPropValue;
29
+ private getTextValue;
30
+ private getObjectValue;
31
+ private getArrayValue;
32
+ private getEnumValue;
33
+ private getCustomDataValue;
34
+ private getComponentListValue;
35
+ private getBlogValue;
36
+ private getBlogListValue;
37
+ private getBlogCategoryValue;
38
+ private getBlogCategoryListValue;
39
+ private getRaffleValue;
40
+ private getRaffleListValue;
41
+ private getSliderValue;
42
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import a from"lodash/cloneDeep";import{IkasBrandListPropValueProvider as s}from"./brand-list.js";import{IkasBrandPropValueProvider as u}from"./brand.js";import{IkasCategoryListPropValueProvider as i}from"./category-list.js";import{IkasCategoryPropValueProvider as n}from"./category.js";import{IkasColorPropValueProvider as o}from"./color.js";import{IkasBooleanPropValueProvider as c}from"./boolean.js";import{IkasTextPropValueProvider as l}from"./text.js";import{IkasImageListPropValueProvider as h}from"./image-list.js";import{IkasImagePropValueProvider as d}from"./image.js";import{IkasLinkPropValueProvider as p}from"./link.js";import{IkasProductPropValueProvider as m}from"./product-detail.js";import{IkasProductListPropValueProvider as f}from"./product-list.js";import{IkasRichTextPropValueProvider as g}from"./rich-text.js";import{IkasBlogPropValueProvider as v}from"./blog.js";import{IkasBlogListPropValueProvider as D}from"./blog-list.js";import{IkasAttributePropValueProvider as V}from"./attribute.js";import{IkasAttributeListPropValueProvider as w}from"./attribute-list.js";import{IkasBlogCategoryPropValueProvider as I}from"./blog-category.js";import{IkasBlogCategoryListPropValueProvider as y}from"./blog-category-list.js";import{IkasRaffleListPropValueProvider as T}from"./raffle-list.js";import{IkasRafflePropValueProvider as L}from"./raffle.js";import{IkasSliderPropValueProvider as P}from"./slider.js";import{IkasThemeJsonComponentPropType as b}from"@ikas/storefront-models";var R=function(){function R(t,e,r,a,s,u,i){this.value=t,this.customData=e,this.theme=r,this.pageType=a,this.pageDataProvider=s,this.pageSpecificData=u,this.pageParams=i}return R.prototype.getValue=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if((void 0===this.value||null===this.value)&&this.customData.type!==b.RAFFLE_LIST)return[2,{value:null,customDataId:this.customData.id}];e.label=1;case 1:switch(e.trys.push([1,58,,59]),this.customData.type){case b.TEXT:return[3,2];case b.RICH_TEXT:return[3,4];case b.BOOLEAN:return[3,6];case b.BRAND_LIST:return[3,8];case b.BRAND:return[3,10];case b.CATEGORY_LIST:return[3,12];case b.CATEGORY:return[3,14];case b.COLOR:return[3,16];case b.IMAGE_LIST:return[3,18];case b.IMAGE:return[3,20];case b.LINK:case b.LIST_OF_LINK:return[3,22];case b.PRODUCT_DETAIL:return[3,24];case b.PRODUCT_LIST:return[3,26];case b.PRODUCT_ATTRIBUTE:return[3,28];case b.PRODUCT_ATTRIBUTE_LIST:return[3,30];case b.OBJECT:return[3,32];case b.DYNAMIC_LIST:case b.STATIC_LIST:return[3,34];case b.ENUM:return[3,36];case b.CUSTOM:return[3,38];case b.COMPONENT:case b.COMPONENT_LIST:return[3,40];case b.BLOG:return[3,42];case b.BLOG_LIST:return[3,44];case b.BLOG_CATEGORY:return[3,46];case b.BLOG_CATEGORY_LIST:return[3,48];case b.RAFFLE:return[3,50];case b.RAFFLE_LIST:return[3,52];case b.SLIDER:return[3,54]}return[3,56];case 2:return[4,this.getTextValue()];case 3:return t=e.sent(),[3,57];case 4:return[4,this.getRichTextPropValue()];case 5:return t=e.sent(),[3,57];case 6:return[4,this.getBooleanValue()];case 7:return t=e.sent(),[3,57];case 8:return[4,this.getBrandListPropValue()];case 9:return t=e.sent(),[3,57];case 10:return[4,this.getBrandPropValue()];case 11:return t=e.sent(),[3,57];case 12:return[4,this.getCategoryListPropValue()];case 13:return t=e.sent(),[3,57];case 14:return[4,this.getCategoryPropValue()];case 15:return t=e.sent(),[3,57];case 16:return[4,this.getColorPropValue()];case 17:return t=e.sent(),[3,57];case 18:return[4,this.getImageListPropValue()];case 19:return t=e.sent(),[3,57];case 20:return[4,this.getImagePropValue()];case 21:return t=e.sent(),[3,57];case 22:return[4,this.getLinkPropValue()];case 23:return t=e.sent(),[3,57];case 24:return[4,this.getProductDetailPropValue()];case 25:return t=e.sent(),[3,57];case 26:return[4,this.getProductListPropValue()];case 27:return t=e.sent(),[3,57];case 28:return[4,this.getProductAttributePropValue()];case 29:return t=e.sent(),[3,57];case 30:return[4,this.getProductAttributeListPropValue()];case 31:return t=e.sent(),[3,57];case 32:return[4,this.getObjectValue()];case 33:return t=e.sent(),[3,57];case 34:return[4,this.getArrayValue()];case 35:return t=e.sent(),[3,57];case 36:return[4,this.getEnumValue()];case 37:return t=e.sent(),[3,57];case 38:return[4,this.getCustomDataValue()];case 39:return t=e.sent(),[3,57];case 40:return[4,this.getComponentListValue()];case 41:return t=e.sent(),[3,57];case 42:return[4,this.getBlogValue()];case 43:return t=e.sent(),[3,57];case 44:return[4,this.getBlogListValue()];case 45:return t=e.sent(),[3,57];case 46:return[4,this.getBlogCategoryValue()];case 47:return t=e.sent(),[3,57];case 48:return[4,this.getBlogCategoryListValue()];case 49:return t=e.sent(),[3,57];case 50:return[4,this.getRaffleValue()];case 51:return t=e.sent(),[3,57];case 52:return[4,this.getRaffleListValue()];case 53:return t=e.sent(),[3,57];case 54:return[4,this.getSliderValue()];case 55:return t=e.sent(),[3,57];case 56:return[3,57];case 57:return[3,59];case 58:return e.sent(),[2];case 59:return!this.customData.isRequired||void 0!==(null==t?void 0:t.value)&&null!==(null==t?void 0:t.value)?[2,t]:[2]}}))}))},R.prototype.getBooleanValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new c(this.value).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getBrandListPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new s(this.value).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getBrandPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new u(this.value).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getCategoryListPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new i(this.value).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getCategoryPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new n(this.value).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getColorPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new o(this.value).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getRichTextPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new g(this.value).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getImageListPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new h(this.value).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getImagePropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new d(this.value).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getLinkPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new p(this.value,this.theme,this.pageDataProvider.linkMetaDataTargetIds).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getProductDetailPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new m(this.value).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getProductListPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new f(this.pageType,this.value,this.pageSpecificData).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getProductAttributePropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new V(this.value).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getProductAttributeListPropValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new w(this.value).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getTextValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new l(this.value).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getObjectValue=function(){return t(this,void 0,void 0,(function(){var t,r,a,s,u,i;return e(this,(function(e){switch(e.label){case 0:t={},r=0,a=this.customData.nestedData||[],e.label=1;case 1:if(!(r<a.length))return[3,4];if(!(s=a[r]).key)return[3,3];if(u=this.value[s.key],s.isRequired&&s.type!==b.RAFFLE_LIST&&null==u)throw new Error("Required data is missing");return[4,new R(u,s,this.theme,this.pageType,this.pageDataProvider,this.pageSpecificData).getValue()];case 2:if(i=e.sent(),s.isRequired&&null==i)throw new Error("Required data is missing");t[s.key]=i,e.label=3;case 3:return r++,[3,1];case 4:return[2,{value:t,customDataId:this.customData.id}]}}))}))},R.prototype.getArrayValue=function(){return t(this,void 0,void 0,(function(){var t,r,a,s,u,i;return e(this,(function(e){switch(e.label){case 0:if(!this.value||!Array.isArray(this.value))throw new Error("Incorrect data!");t=[],r=this.customData.nestedData[0],a=0,s=this.value,e.label=1;case 1:if(!(a<s.length))return[3,4];if(u=s[a],r.isRequired&&r.type!==b.RAFFLE_LIST&&null==u)throw new Error("Required data is missing");return[4,new R(u,r,this.theme,this.pageType,this.pageDataProvider,this.pageSpecificData).getValue()];case 2:if(i=e.sent(),r.isRequired&&null==i)throw new Error("Required data is missing");t.push(i),e.label=3;case 3:return a++,[3,1];case 4:return[2,{value:t,customDataId:this.customData.id}]}}))}))},R.prototype.getEnumValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){return[2,{value:this.value,customDataId:this.customData.id}]}))}))},R.prototype.getCustomDataValue=function(){return t(this,void 0,void 0,(function(){var t,r=this;return e(this,(function(e){switch(e.label){case 0:return(t=this.theme.customData.find((function(t){return t.id===r.customData.customDataId})))?((t=a(t)).isRequired=this.customData.isRequired,[4,new R(this.value,t,this.theme,this.pageType,this.pageDataProvider,this.pageSpecificData).getValue()]):[2,{value:null,customDataId:this.customData.id}];case 1:return[2,e.sent()]}}))}))},R.prototype.getComponentListValue=function(){return t(this,void 0,void 0,(function(){var t,a,s=this;return e(this,(function(e){switch(e.label){case 0:return t=this.value?this.value.map((function(t){return r({},t)})):[],a={},[4,Promise.all(t.map((function(t){return s.pageDataProvider.getPageComponentPropValues(t)})))];case 1:return[2,(a.value=e.sent(),a.customDataId=this.customData.id,a)]}}))}))},R.prototype.getBlogValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new v(this.value).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getBlogListValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new D(this.pageType,this.value,this.pageSpecificData).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getBlogCategoryValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new I(this.value).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getBlogCategoryListValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new y(this.value).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getRaffleValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new L(this.value).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getRaffleListValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,(new T).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R.prototype.getSliderValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new P(this.value).getValue()];case 1:return[2,{value:t.sent(),customDataId:this.customData.id}]}}))}))},R}();export{R as IkasCustomPropValueProvider};
@@ -0,0 +1,8 @@
1
+ import { IkasImage } from "@ikas/storefront-models";
2
+ import IkasPropValueProvider from ".";
3
+ import { IkasImagePropValue } from "../../models/prop-value/image";
4
+ export declare class IkasImageListPropValueProvider implements IkasPropValueProvider<IkasImage[]> {
5
+ private imageListPropValue;
6
+ constructor(imageListPropValue: (string | IkasImagePropValue)[]);
7
+ getValue(): Promise<IkasImage[]>;
8
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as e}from'./../../ext/tslib/tslib.es6.js';var i=function(){function i(t){this.imageListPropValue=t}return i.prototype.getValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){return[2,this.imageListPropValue.map((function(t){return{id:"object"==typeof t?t.id:t,isVideo:!1,altText:"object"==typeof t?t.altText:null}}))]}))}))},i}();export{i as IkasImageListPropValueProvider};
@@ -0,0 +1,9 @@
1
+ import { IkasImage } from "@ikas/storefront-models";
2
+ import IkasPropValueProvider from ".";
3
+ import { IkasImagePropValue } from "../../models/prop-value/image";
4
+ export declare class IkasImagePropValueProvider implements IkasPropValueProvider<IkasImage> {
5
+ private imagePropValue;
6
+ private isObject;
7
+ constructor(imagePropValue: string | IkasImagePropValue);
8
+ getValue(): Promise<IkasImage>;
9
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as e}from'./../../ext/tslib/tslib.es6.js';var i=function(){function i(t){this.isObject="object"==typeof t,this.isObject,this.imagePropValue=t}return i.prototype.getValue=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){return[2,{id:"object"==typeof this.imagePropValue?this.imagePropValue.id:this.imagePropValue,isVideo:!1,altText:"object"==typeof this.imagePropValue?this.imagePropValue.altText:null}]}))}))},i}();export{i as IkasImagePropValueProvider};
@@ -0,0 +1,3 @@
1
+ export default interface IkasPropValueProvider<T> {
2
+ getValue: () => Promise<T>;
3
+ }
@@ -0,0 +1,26 @@
1
+ import { IkasThemeJson } from "@ikas/storefront-models";
2
+ import IkasPropValueProvider from ".";
3
+ import { IkasLinkPropValue } from "../../models/prop-value/link";
4
+ import { IkasNavigationLink } from "../../models/ui";
5
+ export declare type IkasLinkMetaDataType = "DEFAULT" | "BLOG" | "RAFFLE";
6
+ export declare type IkasLinkMetaDataTargetId = {
7
+ type: IkasLinkMetaDataType;
8
+ id: string;
9
+ navigationLink: NavigationLink;
10
+ };
11
+ export declare class IkasLinkPropValueProvider implements IkasPropValueProvider<NavigationLink | NavigationLink[]> {
12
+ private linkPropValue;
13
+ private theme;
14
+ private linkMetaDataTargetIds;
15
+ constructor(linkPropValue: IkasLinkPropValue | IkasLinkPropValue[], theme: IkasThemeJson, linkMetaDataTargetIds: IkasLinkMetaDataTargetId[]);
16
+ private getNavigationLink;
17
+ getValue(): Promise<IkasNavigationLink | IkasNavigationLink[]>;
18
+ }
19
+ export declare class NavigationLink implements IkasNavigationLink {
20
+ href: string;
21
+ label: string;
22
+ subLinks: IkasNavigationLink[];
23
+ isExternal?: boolean | null;
24
+ itemId?: string;
25
+ constructor(data: IkasNavigationLink);
26
+ }
@@ -0,0 +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};
@@ -0,0 +1,8 @@
1
+ import IkasPropValueProvider from ".";
2
+ import { IkasProductPropValue } from "../../models/prop-value/product";
3
+ import { IkasProductPropValueData } from "../types";
4
+ export declare class IkasProductPropValueProvider implements IkasPropValueProvider<IkasProductPropValueData | null> {
5
+ private productDetailPropValue;
6
+ constructor(prop: IkasProductPropValue);
7
+ getValue(): Promise<IkasProductPropValueData | null>;
8
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as e}from'./../../ext/tslib/tslib.es6.js';import{listProductOptionSet as a,searchProducts as r}from"@ikas/storefront-api";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import{IkasProductFunctions as o}from"@ikas/storefront-model-functions";import{getPlaceholderProduct as u}from"../placeholders.js";var l=function(){function l(t){this.productDetailPropValue=t}return l.prototype.getValue=function(){var l,n,d;return t(this,void 0,void 0,(function(){var t,s,p,c,V,f,v,h=this;return e(this,(function(e){switch(e.label){case 0:return(null===(l=this.productDetailPropValue)||void 0===l?void 0:l.usePageData)?[2,{productDetailPropValue:this.productDetailPropValue,productDetail:null}]:this.productDetailPropValue.productId?[4,r({input:{productIdList:[this.productDetailPropValue.productId],priceListId:i.getPriceListId(),salesChannelId:i.getSalesChannelId()}})]:[2,null];case 1:return(t=e.sent()).isSuccess&&(null===(n=t.data)||void 0===n?void 0:n.data)?(s=t.data.data).length?(p=s[0]).productOptionSetId?[4,a({id:{eq:p.productOptionSetId}})]:[3,3]:[3,4]:[3,5];case 2:(c=e.sent()).isSuccess&&(null===(d=c.data)||void 0===d?void 0:d.length)&&(p.productOptionSet=c.data[0]),e.label=3;case 3:return V=o.hasVariant,p&&V(p)?(f=p.variants.find((function(t){return t.id===h.productDetailPropValue.variantId})))?(p.selectedVariantValues=null==f?void 0:f.variantValues,[2,{productDetailPropValue:this.productDetailPropValue,productDetail:p}]):[2,null]:(v=p.variants.find((function(t){return t.isActive})),p.selectedVariantValues=(v||p.variants[0]).variantValues,[2,{productDetailPropValue:this.productDetailPropValue,productDetail:p}]);case 4:return[2,{productDetailPropValue:this.productDetailPropValue,productDetail:u()}];case 5:return[2,null]}}))}))},l}();export{l as IkasProductPropValueProvider};
@@ -0,0 +1,21 @@
1
+ import { IkasThemeJsonPageType } from "@ikas/storefront-models";
2
+ import IkasPropValueProvider from ".";
3
+ import { IkasProductListPropValue } from "../../models/prop-value/product-list";
4
+ import { IkasProductList } from "../../models/ui";
5
+ export declare type IkasRelatedProductProps = {
6
+ brandIds: string[] | null;
7
+ categoryIds: string[] | null;
8
+ productId: string;
9
+ };
10
+ export declare type IkasViewedTogetherProductProps = {
11
+ productIds: string[];
12
+ };
13
+ export declare class IkasProductListPropValueProvider implements IkasPropValueProvider<IkasProductList> {
14
+ private pageType;
15
+ private productListPropValue;
16
+ private pageSpecificData?;
17
+ private relatedProductData?;
18
+ private viewedTogetherProductData?;
19
+ constructor(pageType: IkasThemeJsonPageType, productListPropValue: IkasProductListPropValue, pageSpecificData?: any);
20
+ getValue(): Promise<IkasProductList>;
21
+ }
@@ -0,0 +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 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};
@@ -0,0 +1,5 @@
1
+ import IkasPropValueProvider from ".";
2
+ import { IkasRaffleList } from "../../models/ui";
3
+ export declare class IkasRaffleListPropValueProvider implements IkasPropValueProvider<IkasRaffleList> {
4
+ getValue(): Promise<IkasRaffleList>;
5
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as i}from'./../../ext/tslib/tslib.es6.js';import{getInitial as e}from"../../models/ui/raffle-list/init.js";var n=function(){function n(){}return n.prototype.getValue=function(){return t(this,void 0,void 0,(function(){var t;return i(this,(function(i){switch(i.label){case 0:return[4,e(t={data:[],count:0,page:1,limit:20})];case 1:return i.sent(),[2,t]}}))}))},n}();export{n as IkasRaffleListPropValueProvider};
@@ -0,0 +1,8 @@
1
+ import IkasPropValueProvider from ".";
2
+ import { IkasRafflePropValue } from "../../models/prop-value/raffle";
3
+ import { IkasRafflePropValueData } from "../types";
4
+ export declare class IkasRafflePropValueProvider implements IkasPropValueProvider<IkasRafflePropValueData | null> {
5
+ private rafflePropValue;
6
+ constructor(propValue: IkasRafflePropValue);
7
+ getValue(): Promise<IkasRafflePropValueData | null>;
8
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as e,__generator as r}from'./../../ext/tslib/tslib.es6.js';import{listStorefrontRaffle as a}from"@ikas/storefront-api";import{populateRaffleProducts as l}from"../helpers/raffle.js";import{getPlaceholderRaffle as t}from"../placeholders.js";var o=function(){function o(e){this.rafflePropValue=e}return o.prototype.getValue=function(){var o,f,i;return e(this,void 0,void 0,(function(){var e,s;return r(this,(function(r){switch(r.label){case 0:return(null===(o=this.rafflePropValue)||void 0===o?void 0:o.usePageData)?[2,{raffle:null,rafflePropValue:this.rafflePropValue}]:this.rafflePropValue.raffleId?[4,a({id:{eq:this.rafflePropValue.raffleId}})]:[2,null];case 1:return(e=r.sent()).isSuccess&&(null===(i=null===(f=e.data)||void 0===f?void 0:f.data)||void 0===i?void 0:i.length)?(s=e.data.data[0],[4,l([s])]):[2,null];case 2:return r.sent(),[2,{raffle:s||t(),rafflePropValue:this.rafflePropValue}]}}))}))},o}();export{o as IkasRafflePropValueProvider};
@@ -0,0 +1,6 @@
1
+ import IkasPropValueProvider from ".";
2
+ export declare class IkasRichTextPropValueProvider implements IkasPropValueProvider<string> {
3
+ private text;
4
+ constructor(textPropValue: string);
5
+ getValue(): Promise<string>;
6
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as n}from'./../../ext/tslib/tslib.es6.js';var i=function(){function i(t){this.text=t}return i.prototype.getValue=function(){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.text]}))}))},i}();export{i as IkasRichTextPropValueProvider};
@@ -0,0 +1,7 @@
1
+ import IkasPropValueProvider from ".";
2
+ import { IkasSliderPropValueData } from "../types";
3
+ export declare class IkasSliderPropValueProvider implements IkasPropValueProvider<IkasSliderPropValueData> {
4
+ private sliderData;
5
+ constructor(sliderData: IkasSliderPropValueData);
6
+ getValue(): Promise<IkasSliderPropValueData>;
7
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as i}from'./../../ext/tslib/tslib.es6.js';var n=function(){function n(t){this.sliderData=t}return n.prototype.getValue=function(){return t(this,void 0,void 0,(function(){return i(this,(function(t){return[2,{value:this.sliderData.value,unit:this.sliderData.unit}]}))}))},n}();export{n as IkasSliderPropValueProvider};
@@ -0,0 +1,6 @@
1
+ import IkasPropValueProvider from ".";
2
+ export declare class IkasTextPropValueProvider implements IkasPropValueProvider<string> {
3
+ private text;
4
+ constructor(textPropValue: string);
5
+ getValue(): Promise<string>;
6
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as n}from'./../../ext/tslib/tslib.es6.js';var i=function(){function i(t){this.text=t}return i.prototype.getValue=function(){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.text]}))}))},i}();export{i as IkasTextPropValueProvider};
@@ -0,0 +1,66 @@
1
+ import { IkasBlog, IkasBlogCategory, IkasBrand, IkasCategory, IkasProduct, IkasProductOptionSet, IkasRaffle, IkasThemeJsonComponent, IkasThemeJsonPageComponent, IkasVariantValue } from "@ikas/storefront-models";
2
+ import { IkasAttributeListPropValue } from "../models/prop-value/attribute-list";
3
+ import { IkasAttributePropValue } from "../models/prop-value/attribute";
4
+ import { IkasBlogCategoryPropValue } from "../models/prop-value/blog-category";
5
+ import { IkasBlogPropValue } from "../models/prop-value/blog";
6
+ import { IkasBrandPropValue } from "../models/prop-value/brand";
7
+ import { IkasCategoryPropValue } from "../models/prop-value/category";
8
+ import { IkasProductPropValue } from "../models/prop-value/product";
9
+ import { IkasRafflePropValue } from "../models/prop-value/raffle";
10
+ export declare class IkasPageComponentPropValue {
11
+ pageComponent: IkasThemeJsonPageComponent;
12
+ component: IkasThemeJsonComponent;
13
+ propValues: Record<string, any>;
14
+ constructor(data: IkasPageComponentPropValue);
15
+ }
16
+ export declare type IkasSimplePageComponentPropValue = {
17
+ pageComponent: {
18
+ id: string;
19
+ componentId: string;
20
+ };
21
+ propValues: Record<string, any>;
22
+ };
23
+ export declare type IkasAttributeListPropValueData = {
24
+ productDetail: IkasProduct | null;
25
+ attributeListPropValue: IkasAttributeListPropValue;
26
+ };
27
+ export declare type IkasAttributePropValueData = {
28
+ productDetail: IkasProductPropValueProduct | null;
29
+ attributePropValue: IkasAttributePropValue;
30
+ };
31
+ export declare type IkasBlogCategoryPropValueData = {
32
+ blogCategory: IkasBlogCategory | null;
33
+ blogCategoryPropValue: IkasBlogCategoryPropValue;
34
+ };
35
+ export declare type IkasBlogPropValueData = {
36
+ blog: IkasBlog | null;
37
+ blogPropValue: IkasBlogPropValue;
38
+ };
39
+ export declare type IkasBrandPropValueData = {
40
+ brand: IkasBrand | null;
41
+ brandPropValue: IkasBrandPropValue;
42
+ };
43
+ export declare type IkasCategoryPropValueData = {
44
+ category: IkasCategory | null;
45
+ categoryPropValue: IkasCategoryPropValue;
46
+ };
47
+ export declare type IkasCustomDataPropValueData = {
48
+ value: any;
49
+ customDataId: string;
50
+ };
51
+ export declare type IkasProductPropValueProduct = {
52
+ productOptionSet?: IkasProductOptionSet | null;
53
+ selectedVariantValues?: IkasVariantValue[] | null;
54
+ } & IkasProduct;
55
+ export declare type IkasProductPropValueData = {
56
+ productDetailPropValue: IkasProductPropValue;
57
+ productDetail: IkasProductPropValueProduct | null;
58
+ };
59
+ export declare type IkasRafflePropValueData = {
60
+ raffle: IkasRaffle | null;
61
+ rafflePropValue: IkasRafflePropValue;
62
+ };
63
+ export declare type IkasSliderPropValueData = {
64
+ value: number;
65
+ unit: string | null;
66
+ };
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as o}from"mobx";var p=function(p){this.pageComponent=p.pageComponent,this.component=p.component,this.propValues=p.propValues||{},o(this)};export{p as IkasPageComponentPropValue};
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@ikas/storefront-providers",
3
- "version": "4.5.0-beta.4",
3
+ "version": "4.5.0-beta.6",
4
4
  "description": "Data providers for ikas storefront theme components.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
7
- "main": "./build/index.js",
8
- "module": "./build/index.js",
7
+ "main": "build/index.js",
8
+ "module": "build/index.js",
9
9
  "files": [
10
- "./build"
10
+ "build"
11
11
  ],
12
12
  "type": "module",
13
13
  "scripts": {
@@ -17,10 +17,10 @@
17
17
  },
18
18
  "devDependencies": {
19
19
  "@rollup/plugin-commonjs": "^22.0.0",
20
- "@ikas/storefront-api": "^4.5.0-beta.4",
21
- "@ikas/storefront-config": "^4.5.0-beta.4",
22
- "@ikas/storefront-model-functions": "^4.5.0-beta.4",
23
- "@ikas/storefront-models": "^4.5.0-beta.4",
20
+ "@ikas/storefront-api": "^4.5.0-beta.6",
21
+ "@ikas/storefront-config": "^4.5.0-beta.6",
22
+ "@ikas/storefront-model-functions": "^4.5.0-beta.6",
23
+ "@ikas/storefront-models": "^4.5.0-beta.6",
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.5.0-beta.4",
42
- "@ikas/storefront-config": "^4.5.0-beta.4",
43
- "@ikas/storefront-model-functions": "^4.5.0-beta.4",
44
- "@ikas/storefront-models": "^4.5.0-beta.4",
41
+ "@ikas/storefront-api": "^4.5.0-beta.6",
42
+ "@ikas/storefront-config": "^4.5.0-beta.6",
43
+ "@ikas/storefront-model-functions": "^4.5.0-beta.6",
44
+ "@ikas/storefront-models": "^4.5.0-beta.6",
45
45
  "lodash": "^4.17.21"
46
46
  }
47
47
  }