@bikdotai/bik-component-library 0.0.508 → 0.0.509-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/assets/{bundle-0deb4a74.css → bundle-22122157.css} +325 -0
- package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/cjs/components/carousel-preview/CarouselPreview.d.ts +2 -0
- package/dist/cjs/components/carousel-preview/CarouselPreview.js +32 -1
- package/dist/cjs/components/carousel-preview/CarouselPreview.style.js +2 -2
- package/dist/cjs/components/discount-modal/StaticCoupon/StaticCoupon.js +1 -1
- package/dist/cjs/components/product-picker-v2/collectionScreen.d.ts +1 -0
- package/dist/cjs/components/product-picker-v2/collectionScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/modal.js +1 -1
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/cjs/components/template-context-mapper/context/templateModalContext.d.ts +4 -1
- package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
- package/dist/esm/assets/{bundle-0deb4a74.css → bundle-22122157.css} +325 -0
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/esm/components/carousel-preview/CarouselPreview.d.ts +2 -0
- package/dist/esm/components/carousel-preview/CarouselPreview.js +32 -1
- package/dist/esm/components/carousel-preview/CarouselPreview.style.js +2 -2
- package/dist/esm/components/discount-modal/StaticCoupon/StaticCoupon.js +1 -1
- package/dist/esm/components/product-picker-v2/collectionScreen.d.ts +1 -0
- package/dist/esm/components/product-picker-v2/collectionScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/modal.js +1 -1
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/esm/components/template-context-mapper/context/templateModalContext.d.ts +4 -1
- package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
- package/package.json +4 -1
|
@@ -45,10 +45,10 @@ import e from"styled-components";import{COLORS as o}from"../../constants/Theme.j
|
|
|
45
45
|
background-color: white;
|
|
46
46
|
box-shadow: 0px 1.5px 6px 0px #0000001f;
|
|
47
47
|
}
|
|
48
|
-
.slider {
|
|
48
|
+
/* .slider {
|
|
49
49
|
width: 100%;
|
|
50
50
|
height: ${e=>e.height};
|
|
51
|
-
}
|
|
51
|
+
} */
|
|
52
52
|
|
|
53
53
|
.carousel__slide-focus-ring {
|
|
54
54
|
display: none !important;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as i}from"react/jsx-runtime";import a from"../../../assets/icons/info.svg.js";import{Input as e}from"../../input/Input.js";import{BodySecondaryLink as o,BodySecondary as n}from"../../TypographyStyle.js";import{DEFAULT_THEME as s}from"../../../constants/Theme.js";import{StaticCouponContainerStyled as c}from"../DiscountModal.styled.js";const r=r=>t(c,{children:[t("div",Object.assign({className:"static-coupon__data"},{children:[i("div",Object.assign({className:"static-input__wrapper"},{children:i(e,{maxCharLimit:
|
|
1
|
+
import{jsxs as t,jsx as i}from"react/jsx-runtime";import a from"../../../assets/icons/info.svg.js";import{Input as e}from"../../input/Input.js";import{BodySecondaryLink as o,BodySecondary as n}from"../../TypographyStyle.js";import{DEFAULT_THEME as s}from"../../../constants/Theme.js";import{StaticCouponContainerStyled as c}from"../DiscountModal.styled.js";const r=r=>t(c,{children:[t("div",Object.assign({className:"static-coupon__data"},{children:[i("div",Object.assign({className:"static-input__wrapper"},{children:i(e,{maxCharLimit:30,onChangeText:t=>{r.setDiscountData(Object.assign(Object.assign({},r.discountData),{couponCode:null==t?void 0:t.trim()}))},labelText:"Coupon code",value:r.discountData.couponCode,placeholder:"Enter code created on shopify"})})),i("div",Object.assign({className:"static-input__wrapper"},{children:i(e,{maxCharLimit:30,labelText:"Coupon title",value:r.discountData.title,onChangeText:t=>{r.setDiscountData(Object.assign(Object.assign({},r.discountData),{title:null==t?void 0:t.trim()}))},placeholder:"Enter coupon title"})}))]})),i(e,{maxCharLimit:60,labelText:"Coupon description",value:r.discountData.description,onChangeText:t=>{r.setDiscountData(Object.assign(Object.assign({},r.discountData),{description:null==t?void 0:t.trim()}))},placeholder:"Enter coupon description"}),!r.hideProbability&&i(e,{labelText:"Probability",value:r.discountData.probability?r.discountData.probability.toString():"",onChangeText:t=>{r.setDiscountData(Object.assign(Object.assign({},r.discountData),{probability:t.startsWith(".")?parseFloat(parseFloat(`0${t}`).toFixed(2)):parseFloat(parseFloat(t).toFixed(2))}))},placeholder:"Enter probability in decimals (0 - 1)"}),r.discountAdminUrl&&t("div",Object.assign({className:"info__container"},{children:[i(a,{height:18,width:18,color:s.colorsV2.content.secondary}),i(o,Object.assign({onClick:()=>{window.open(r.discountAdminUrl,"_blank")}},{children:"Click here"})),i(n,{children:"to create discount code on Shopify"})]}))]});export{r as default};
|
|
@@ -24,6 +24,7 @@ interface CollectionsScreenInterface {
|
|
|
24
24
|
hideCollectionCheckbox?: boolean;
|
|
25
25
|
renderWithoutModal?: boolean;
|
|
26
26
|
pickerType?: 'COLLECTION' | 'PRODUCT';
|
|
27
|
+
scrollContainerRef: React.RefObject<HTMLDivElement>;
|
|
27
28
|
}
|
|
28
29
|
export declare const CollectionsScreen: (props: CollectionsScreenInterface) => import("react/jsx-runtime").JSX.Element;
|
|
29
30
|
export interface CollectionCardInterface {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import l from"../../assets/icons/chevronRight.svg.js";import{useRef as i,useState as r,useEffect as n}from"react";import{CheckBox as c}from"../checkBox/CheckBox.js";import{IconButton as s}from"../icon-button/IconButton.js";import{Tag as d}from"../tag/Tag.js";import{Tooltip as a}from"../tooltips/Tooltip.js";import{TitleRegular as u,BodyPrimary as h}from"../TypographyStyle.js";import{EmptyState as p}from"./emptyState.js";import{ProductPickerShimmer as m}from"./ProductPickerShimmer.js";import{CollectionCardStyle as C,CollectionCardInfoStyle as v,CollectionCardDetailStyle as g,CollectionNameHolder as y}from"./style.js";import{isCollectionPartiallyChecked as b}from"./utility.js";const f=(e,t,o)=>{if(!e)return"";if(e.length<=t)return e;const l=e.slice(0,t-1);return(o?l.slice(0,l.lastIndexOf(" ")):l)+"..."},k=o=>{var l;const{customCollectionRestriction:c,dataLoading:s,collections:d,selectedCollectionsDispatch:a,setCollectionId:u,setSelectedCollectionId:h,selectedCollections:C,setScreen:v,collectionFetcher:g,collectionsDispatch:y,pagingControls:f,storeId:k,setSaveDisabled:O,hideCollectionCheckbox:I,renderWithoutModal:S,pickerType:P,scrollContainerRef:T}=o,x=i(null),D=i(f.curPage),L=!!c&&(null==C?void 0:C.isCustom),[R,w]=r(!1),E=i(!1),B=i(!1),N=()=>{if(!T||!(null==T?void 0:T.current))return;const{scrollTop:e,clientHeight:t,scrollHeight:o}=T.current;e+t>=o-20&&!E.current&&!B.current&&(O(!0),w(!0),B.current=!0,O(!0),w(!0),g(D.current,k).then((e=>{y({type:"paged",data:(null==e?void 0:e.collections)||{}}),f.setCurPage(D.current+1),w(!1),O(!1),B.current=!1,Object.keys(null==e?void 0:e.collections).length||(E.current=!0)})).catch())};return n((()=>{var e;return null===(e=null==T?void 0:T.current)||void 0===e||e.addEventListener("scroll",N),()=>{var e;null===(e=null==T?void 0:T.current)||void 0===e||e.removeEventListener("scroll",N)}}),[]),n((()=>{D.current=f.curPage}),[f.curPage]),n((()=>{const e=new IntersectionObserver((e=>{e[0].isIntersecting&&D.current>0&&!E.current&&(O(!0),w(!0),g(D.current,k).then((e=>{y({type:"paged",data:(null==e?void 0:e.collections)||{}}),f.setCurPage(D.current+1),w(!1),O(!1),Object.keys(e).length||(E.current=!0)})).catch())}),{threshold:1});return x.current&&e.observe(x.current),()=>{x.current&&e.unobserve(x.current)}}),[x]),e("div",{children:[(null===(l=Object.keys(null!=d?d:{}))||void 0===l?void 0:l.length)?Object.keys(d).map((e=>{var o,l;const i=!!(null==C?void 0:C[e])&&("PRODUCT"!==P||!!Object.keys(null!==(l=null===(o=null==C?void 0:C[e])||void 0===o?void 0:o.products)&&void 0!==l?l:{}).length);return t(j,{customCollectionRestriction:c,data:d[e],isDisabled:L&&!(null==C?void 0:C[e]),isChecked:i,isPartiallyChecked:b(e,null==d?void 0:d[e],C),selectedCollectionsDispatch:a,setCollectionId:u,setSelectedCollectionId:h,setScreen:v,id:e,hideCollectionCheckbox:I||"-1"===e,selectedCollections:C,renderWithoutModal:S,pickerType:P},e)})):s?t(m,{}):t(p,{title:"No collections to show",subtitle:"We couldn’t find any collection."}),t("div",{ref:x}),R&&t(m,{})]})},j=i=>{const{customCollectionRestriction:r,data:n,selectedCollectionsDispatch:p,setCollectionId:m,setSelectedCollectionId:b,isPartiallyChecked:f,setScreen:k,id:j,isChecked:O,isDisabled:I,hideCollectionCheckbox:S,pickerType:P,usedInSearch:T}=i;return e(C,Object.assign({isDisabled:I,onClick:e=>{if(!I){if("COLLECTION"===P)return e.stopPropagation(),p({type:"reset",data:{}}),p({type:"selected",data:{id:j,val:n,isRestricted:r}}),m(j),void b(j);m(j),b(j),k("products")}},isActive:O,usedInSearch:null!=T&&T},{children:[e(v,{children:[!S&&t(c,{isDisabled:I,isChecked:O,isPartiallyChecked:f,onValueChange:function(e,t,o){null==o||o.stopPropagation(),p(e?{type:"selected",data:{id:j,val:n,isRestricted:r}}:{type:"unselected",data:{id:j}}),b(e?j:"")}}),t(g,{children:t(a,Object.assign({body:n.name,placement:"bottom",delay:400,variant:"light"},{children:e(y,{children:[t(T?h:u,Object.assign({numberOfLines:1},{children:n.name})),n.isSmartCollection?t("div",Object.assign({style:{display:"flex"}},{children:t(d,{tagText:"Smart Collection",type:"warning"})})):t(o,{})]})}))})]}),"COLLECTION"!==P&&t(s,{height:12,width:12,disabled:I,Icon:l})]}))};export{j as CollectionCard,k as CollectionsScreen,f as truncate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import c from"../../assets/icons/search.svg.js";import{useReducer as r,useState as s,useRef as i,useEffect as l}from"react";import{COLORS as n}from"../../constants/Theme.js";import{Button as d}from"../button/Button.js";import{Input as a}from"../input/Input.js";import{StyledModal as u}from"../modals/styledModal.js";import{Spinner as h}from"../spinner/Spinner.js";import{Tag as p}from"../tag/Tag.js";import{CollectionsScreen as m}from"./collectionScreen.js";import{ProductInfoOverlay as C}from"./productInfoOverlay.js";import{ProductsScreen as g}from"./productScreen.js";import{RearrangeScreen as f}from"./rearrangeScreen.js";import{collectionsReducer as b,searchReducer as y,selectedColectionsReducer as S,CollectionIdContext as v}from"./reducers.js";import{SearchScreen as k}from"./searchScreen.js";import{SelectedScreen as P}from"./selectedScreen.js";import{ContainerStyle as j,ScrollContainerStyle as x}from"./style.js";import{OUT_OF_STOCK_ACTION as I}from"./type.js";var F;!function(e){e.Collections="collections",e.RearrangeProducts="rearrange",e.SelectedProducts="view",e.SearchProducts="searchProducts",e.Products="products"}(F||(F={}));const O=O=>{const{storeId:T,selectedItems:D,onClose:R,visible:w,zIndex:E,exactLimit:A,limit:V,hideCollectionCheckbox:$,hideProductCheckbox:B,outOfStockAction:L=I.BLUR,hideVariantCheckbox:M,selectProductsFromCustomCollection:z,hideSelectionCount:W,title:G,width:H,renderWithoutModal:Y,onClickSave:K,pickerType:N,hideProductVariants:U=!1,startupScreen:q=F.Collections,rearrangeEnabled:J,selectSingleItem:Q=!1,showProductDetails:X,containerStyle:Z}=O,[_,ee]=r(b,{}),[te,oe]=s([F.Collections,F.RearrangeProducts].includes(q)?q:F.Collections),[ce,re]=s("grid"),[se,ie]=s(""),[le,ne]=s(""),[de,ae]=s(0),[ue,he]=s(!1),[pe,me]=s(0),[Ce,ge]=s(""),[fe,be]=s(!1),[ye,Se]=s(!1),[ve,ke]=r(y,{collections:{},products:{}}),[Pe,je]=r(S,Object.keys(D).length>0?D:{}),xe=i(null),[Ie,Fe]=s(!1),[Oe,Te]=s();l((()=>{he(!0),Se(!0),O.collectionFetcher(de,T).then((e=>{ee({type:"fetched",data:(null==e?void 0:e.collections)||{}}),he(!1),ae((e=>e+1)),Se(!1)})).catch()}),[]),l((()=>{let e=0;U?Object.keys(Pe||[]).forEach((t=>{var o;Object.keys((null===(o=Pe[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c;"-1"!==t&&Pe[-1]&&(null===(c=Pe[-1].products)||void 0===c?void 0:c[o])||(e+=1)}))})):Object.keys(Pe||[]).forEach((t=>{var o;Object.keys((null===(o=Pe[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=Pe[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),me(e)}),[_,Pe,U]),l((()=>{le&&(he(!0),O.productFetcher(le,T).then((e=>{Object.keys(e).length&&ee({type:"productsFetched",data:{collectionId:le,products:e}}),he(!1)})).catch())}),[le]),l((()=>{const e=setTimeout((()=>{"rearrange"!==te&&(Ce.length||"collections"!==te)&&(Ce.length?(be(!0),O.searchFetcher(T,Ce).then((e=>{"collections"in e&&"products"in e?(ke({type:"set",data:e}),ee({type:"searched",data:e.collections})):(ke({type:"set",data:{collections:{},products:e}}),ee({type:"searched",data:e})),oe("searchProducts"),he(!1),be(!1)}))):oe("collections"))}),800);return()=>clearTimeout(e)}),[Ce]),l((()=>{K&&(O.onAdd(Pe,pe),De())}),[K]),l((()=>{Q&&Object.keys(Pe||{}).length&&pe&&(O.onAdd(Pe,pe),De())}),[Q,Pe,pe]);const De=()=>{je({type:"reset",data:{}})},Re=e(j,Object.assign({style:null!=Z?Z:{}},{children:[O.postHeader&&t("div",Object.assign({style:{padding:"0 24px"}},{children:O.postHeader})),!O.hideGlobalSearch&&t(o,{children:("collections"===te||"searchProducts"===te)&&t("div",Object.assign({style:{padding:Y?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:t(a,{placeholder:"Search Collections or Products",noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>fe?t(h,{size:"small",color:n.content.primary}):t(c,{})},id:"listInput",height:"24px",type:"text",value:Ce,onChangeText:e=>{e.length&&e.trim().length?ge(e):ge("")}})}))}),e(x,Object.assign({ref:xe,screenName:te},{children:["collections"===te&&t(m,{customCollectionRestriction:O.customCollectionRestriction,dataLoading:ye,collections:_,selectedCollectionsDispatch:je,setCollectionId:ie,setSelectedCollectionId:ne,setScreen:oe,selectedCollections:Pe,collectionFetcher:O.collectionFetcher,storeId:T,collectionsDispatch:ee,setSaveDisabled:he,pagingControls:{curPage:de,setCurPage:ae},hideCollectionCheckbox:$,renderWithoutModal:Y,pickerType:N}),"products"===te&&se&&t(v.Provider,Object.assign({value:se},{children:t(g,{hideInCollectionSearch:O.hideInCollectionSearch,customCollectionRestriction:O.customCollectionRestriction,productFetcher:O.productFetcher,setScreen:oe,storeId:T,data:_[se],collectionsDispatch:ee,selectedCollectionsDispatch:je,selectedData:Pe,setSaveDisabled:he,searchInCollectionFetcher:O.searchInCollectionFetcher,hideProductCheckbox:B,outOfStockAction:L,hideVariantCheckbox:M,selectProductsFromCustomCollection:z,renderWithoutModal:Y,pickerType:N,hideProductVariants:U,fbStatusFetcher:O.fbStatusFetcher,onProductDetailClick:e=>{Fe(!0),Te(e)},showProductDetailInfoIcon:X,scrollContainerRef:xe})})),"view"===te&&t(P,{selectedCollections:Pe||{},selectedCollectionsDispatch:je,setScreen:oe,collections:_,hideProductVariants:U,outOfStockAction:L,storeId:T,fbStatusFetcher:O.fbStatusFetcher}),"rearrange"===te&&t(f,{selectedCollections:Pe||{},selectedCollectionsDispatch:je,setScreen:oe,outOfStockAction:L,rearrangeViewType:"grid"===ce?"list":"grid",scrollContainerRef:xe,storeId:T,fbStatusFetcher:O.fbStatusFetcher}),"searchProducts"===te&&t(k,{customCollectionRestriction:O.customCollectionRestriction,selectedCollections:Pe||{},searchedCollections:ve||{},searchedCollectionsDispatch:ke,selectedCollectionsDispatch:je,setScreen:oe,collections:_,onBackPress:()=>{ge(""),ke({type:"set",data:{collections:{},products:{}}})},pickerType:N,hideProductCheckbox:B,hideProductVariants:U,hideVariantCheckbox:M,storeId:T,fbStatusFetcher:O.fbStatusFetcher,setCollectionId:ie,setSelectedCollectionId:ne,renderWithoutModal:Y,hideCollectionCheckbox:$,outOfStockAction:L})]}))]}));return t(o,{children:Y?Re:e(u,Object.assign({zIndex:E,open:w,onClose:()=>{null==R||R(),De()},headingTitle:G||("collections"===te||"products"===te?"Select Products":"view"===te?"Selected Products":"searchProducts"===te?"Searched Results":"rearrange"===te?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:H||"600px"},headerRightCustomElement:t(o,{}),footerContainerStyle:O.stickyFooter?{position:"absolute",bottom:0,left:0,width:"100%",zIndex:9,background:n.surface.standard}:void 0,primaryButton:{buttonText:ue?"Loading...":te===F.RearrangeProducts?"Done":"Add",disabled:ue||pe<1||A&&pe<A||!A&&V&&pe>V||!1,onClick:()=>{O.onAdd(Pe,pe),De()}},wrapperStyle:O.stickyFooter?{height:"calc(100vh - 168px)"}:void 0,footerLeftCustomElement:W?t(o,{}):A&&pe>A?t(p,{tagText:`You can only select ${A} products`,type:"negative"}):V&&pe>V?t(p,{tagText:`You can only select ${V} products`,type:"negative"}):t(d,pe>0?{onClick:()=>{oe(J?F.RearrangeProducts:F.SelectedProducts)},buttonText:A?`${pe}/${A} products selected`:`${pe} products selected`,buttonType:["rearrange","view"].includes(te)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(te)}:{disabled:!0,buttonText:A?`${pe}/${A} products selected`:`${pe} products selected`,buttonType:"tertiaryGray"}),hideCrossButton:Ie},{children:[Re,Ie&&Oe?t(C,{productData:Oe,outOfStockAction:L,onClose:()=>{Fe(!1)}}):t(o,{})]}))})};export{O as ProductPickerModal,F as ScreenName};
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import c from"../../assets/icons/search.svg.js";import{useReducer as r,useState as s,useRef as i,useEffect as l}from"react";import{COLORS as n}from"../../constants/Theme.js";import{Button as d}from"../button/Button.js";import{Input as a}from"../input/Input.js";import{StyledModal as u}from"../modals/styledModal.js";import{Spinner as h}from"../spinner/Spinner.js";import{Tag as p}from"../tag/Tag.js";import{CollectionsScreen as m}from"./collectionScreen.js";import{ProductInfoOverlay as C}from"./productInfoOverlay.js";import{ProductsScreen as g}from"./productScreen.js";import{RearrangeScreen as f}from"./rearrangeScreen.js";import{collectionsReducer as b,searchReducer as y,selectedColectionsReducer as S,CollectionIdContext as v}from"./reducers.js";import{SearchScreen as k}from"./searchScreen.js";import{SelectedScreen as P}from"./selectedScreen.js";import{ContainerStyle as j,ScrollContainerStyle as x}from"./style.js";import{OUT_OF_STOCK_ACTION as I}from"./type.js";var F;!function(e){e.Collections="collections",e.RearrangeProducts="rearrange",e.SelectedProducts="view",e.SearchProducts="searchProducts",e.Products="products"}(F||(F={}));const O=O=>{const{storeId:T,selectedItems:D,onClose:R,visible:w,zIndex:E,exactLimit:A,limit:V,hideCollectionCheckbox:$,hideProductCheckbox:B,outOfStockAction:L=I.BLUR,hideVariantCheckbox:M,selectProductsFromCustomCollection:z,hideSelectionCount:W,title:G,width:H,renderWithoutModal:Y,onClickSave:K,pickerType:N,hideProductVariants:U=!1,startupScreen:q=F.Collections,rearrangeEnabled:J,selectSingleItem:Q=!1,showProductDetails:X,containerStyle:Z}=O,[_,ee]=r(b,{}),[te,oe]=s([F.Collections,F.RearrangeProducts].includes(q)?q:F.Collections),[ce,re]=s("grid"),[se,ie]=s(""),[le,ne]=s(""),[de,ae]=s(0),[ue,he]=s(!1),[pe,me]=s(0),[Ce,ge]=s(""),[fe,be]=s(!1),[ye,Se]=s(!1),[ve,ke]=r(y,{collections:{},products:{}}),[Pe,je]=r(S,Object.keys(D).length>0?D:{}),xe=i(null),[Ie,Fe]=s(!1),[Oe,Te]=s();l((()=>{he(!0),Se(!0),O.collectionFetcher(de,T).then((e=>{ee({type:"fetched",data:(null==e?void 0:e.collections)||{}}),he(!1),ae((e=>e+1)),Se(!1)})).catch()}),[]),l((()=>{let e=0;U?Object.keys(Pe||[]).forEach((t=>{var o;Object.keys((null===(o=Pe[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c;"-1"!==t&&Pe[-1]&&(null===(c=Pe[-1].products)||void 0===c?void 0:c[o])||(e+=1)}))})):Object.keys(Pe||[]).forEach((t=>{var o;Object.keys((null===(o=Pe[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=Pe[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),me(e)}),[_,Pe,U]),l((()=>{le&&(he(!0),O.productFetcher(le,T).then((e=>{Object.keys(e).length&&ee({type:"productsFetched",data:{collectionId:le,products:e}}),he(!1)})).catch())}),[le]),l((()=>{const e=setTimeout((()=>{"rearrange"!==te&&(Ce.length||"collections"!==te)&&(Ce.length?(be(!0),O.searchFetcher(T,Ce).then((e=>{"collections"in e&&"products"in e?(ke({type:"set",data:e}),ee({type:"searched",data:e.collections})):(ke({type:"set",data:{collections:{},products:e}}),ee({type:"searched",data:e})),oe("searchProducts"),he(!1),be(!1)}))):oe("collections"))}),800);return()=>clearTimeout(e)}),[Ce]),l((()=>{K&&(O.onAdd(Pe,pe),De())}),[K]),l((()=>{Q&&Object.keys(Pe||{}).length&&pe&&(O.onAdd(Pe,pe),De())}),[Q,Pe,pe]);const De=()=>{je({type:"reset",data:{}})},Re=e(j,Object.assign({style:null!=Z?Z:{}},{children:[O.postHeader&&t("div",Object.assign({style:{padding:"0 24px"}},{children:O.postHeader})),!O.hideGlobalSearch&&t(o,{children:("collections"===te||"searchProducts"===te)&&t("div",Object.assign({style:{padding:Y?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:t(a,{placeholder:"Search Collections or Products",noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>fe?t(h,{size:"small",color:n.content.primary}):t(c,{})},id:"listInput",height:"24px",type:"text",value:Ce,onChangeText:e=>{e.length&&e.trim().length?ge(e):ge("")}})}))}),e(x,Object.assign({ref:xe,screenName:te},{children:["collections"===te&&t(m,{customCollectionRestriction:O.customCollectionRestriction,dataLoading:ye,collections:_,selectedCollectionsDispatch:je,setCollectionId:ie,setSelectedCollectionId:ne,setScreen:oe,selectedCollections:Pe,collectionFetcher:O.collectionFetcher,storeId:T,collectionsDispatch:ee,setSaveDisabled:he,pagingControls:{curPage:de,setCurPage:ae},hideCollectionCheckbox:$,renderWithoutModal:Y,pickerType:N,scrollContainerRef:xe}),"products"===te&&se&&t(v.Provider,Object.assign({value:se},{children:t(g,{hideInCollectionSearch:O.hideInCollectionSearch,customCollectionRestriction:O.customCollectionRestriction,productFetcher:O.productFetcher,setScreen:oe,storeId:T,data:_[se],collectionsDispatch:ee,selectedCollectionsDispatch:je,selectedData:Pe,setSaveDisabled:he,searchInCollectionFetcher:O.searchInCollectionFetcher,hideProductCheckbox:B,outOfStockAction:L,hideVariantCheckbox:M,selectProductsFromCustomCollection:z,renderWithoutModal:Y,pickerType:N,hideProductVariants:U,fbStatusFetcher:O.fbStatusFetcher,onProductDetailClick:e=>{Fe(!0),Te(e)},showProductDetailInfoIcon:X,scrollContainerRef:xe})})),"view"===te&&t(P,{selectedCollections:Pe||{},selectedCollectionsDispatch:je,setScreen:oe,collections:_,hideProductVariants:U,outOfStockAction:L,storeId:T,fbStatusFetcher:O.fbStatusFetcher}),"rearrange"===te&&t(f,{selectedCollections:Pe||{},selectedCollectionsDispatch:je,setScreen:oe,outOfStockAction:L,rearrangeViewType:"grid"===ce?"list":"grid",scrollContainerRef:xe,storeId:T,fbStatusFetcher:O.fbStatusFetcher}),"searchProducts"===te&&t(k,{customCollectionRestriction:O.customCollectionRestriction,selectedCollections:Pe||{},searchedCollections:ve||{},searchedCollectionsDispatch:ke,selectedCollectionsDispatch:je,setScreen:oe,collections:_,onBackPress:()=>{ge(""),ke({type:"set",data:{collections:{},products:{}}})},pickerType:N,hideProductCheckbox:B,hideProductVariants:U,hideVariantCheckbox:M,storeId:T,fbStatusFetcher:O.fbStatusFetcher,setCollectionId:ie,setSelectedCollectionId:ne,renderWithoutModal:Y,hideCollectionCheckbox:$,outOfStockAction:L})]}))]}));return t(o,{children:Y?Re:e(u,Object.assign({zIndex:E,open:w,onClose:()=>{null==R||R(),De()},headingTitle:G||("collections"===te||"products"===te?"Select Products":"view"===te?"Selected Products":"searchProducts"===te?"Searched Results":"rearrange"===te?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:H||"600px"},headerRightCustomElement:t(o,{}),footerContainerStyle:O.stickyFooter?{position:"absolute",bottom:0,left:0,width:"100%",zIndex:9,background:n.surface.standard}:void 0,primaryButton:{buttonText:ue?"Loading...":te===F.RearrangeProducts?"Done":"Add",disabled:ue||pe<1||A&&pe<A||!A&&V&&pe>V||!1,onClick:()=>{O.onAdd(Pe,pe),De()}},wrapperStyle:O.stickyFooter?{height:"calc(100vh - 168px)"}:void 0,footerLeftCustomElement:W?t(o,{}):A&&pe>A?t(p,{tagText:`You can only select ${A} products`,type:"negative"}):V&&pe>V?t(p,{tagText:`You can only select ${V} products`,type:"negative"}):t(d,pe>0?{onClick:()=>{oe(J?F.RearrangeProducts:F.SelectedProducts)},buttonText:A?`${pe}/${A} products selected`:`${pe} products selected`,buttonType:["rearrange","view"].includes(te)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(te)}:{disabled:!0,buttonText:A?`${pe}/${A} products selected`:`${pe} products selected`,buttonType:"tertiaryGray"}),hideCrossButton:Ie},{children:[Re,Ie&&Oe?t(C,{productData:Oe,outOfStockAction:L,onClose:()=>{Fe(!1)}}):t(o,{})]}))})};export{O as ProductPickerModal,F as ScreenName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as l,Fragment as o}from"react/jsx-runtime";import{useEffect as t,useState as i,useMemo as
|
|
1
|
+
import{jsx as e,jsxs as l,Fragment as o}from"react/jsx-runtime";import{useEffect as t,useState as i,useRef as r,useMemo as a}from"react";import n from"../../utils/StringUtils.js";import{StyledModal as s}from"../modals/styledModal.js";import{CHANNEL_TYPE as d}from"../template-preview/models/Channels.js";import{TemplateModalContext as c}from"./context/templateModalContext.js";import u from"./modalElements/Footer.js";import p from"./modalElements/TemplateSelectModalContent.js";import{convertPlaceholdersToBikDropdown as m}from"./utils/convertPlaceholdersToBikDropdown.js";const v=v=>{let{selectedTemplate:h,closeDialog:C,showVariableMapping:b,channel:g,htmlContent:f,templateVariables:x,onTemplateSelect:E,globalPlaceholders:P,showOnlyContent:S,whatsappSpecificPickerMeta:I,zIndex:T,showVariableModal:y,variableList:w,discountCode:M,setDiscountCode:L,onBackPress:V,enabledCustomText:j,variableListForImage:A,showSampleValues:D,disableEditVariable:k,pod:F,extras:O,pickerConf:W,selectedCarouselProducts:N,disableEditExpiry:H,cardWidth:z,onDeleteSelectedProducts:B,fileName:R,setFileName:U}=v;var $,_,q,G,J,K;t((()=>{le(f)}),[f]);const Q=g===d.WHATSAPP&&"CAROUSEL"===(null===(_=null===($=null==h?void 0:h.components)||void 0===$?void 0:$[1])||void 0===_?void 0:_.type),X=null==h?void 0:h.isProductCarouselType,[Y,Z]=i(g===d.EMAIL||Q?"desktop":"mobile"),[ee,le]=i(f),[oe,te]=i(!1),[ie,re]=i([]),[ae,ne]=i(h),[se,de]=i([]),[ce,ue]=i(!1),[pe,me]=i(null!=x?x:[]),[ve,he]=i(!1),[Ce,be]=i(-1),[ge,fe]=i([]),xe=r(null);t((()=>{N?fe(N):X&&fe([])}),[N]),t((()=>{var e;if(!ce&&X&&(!N||0===fe.length)){const l=null===(e=null==ae?void 0:ae.components)||void 0===e?void 0:e[1].cards,o=[];null==l||l.forEach((e=>{var l;null===(l=null==e?void 0:e.components)||void 0===l||l.forEach((e=>{var l,t,i;"HEADER"===e.type&&o.push(null!==(i=null===(t=null===(l=e.example)||void 0===l?void 0:l.header_handle)||void 0===t?void 0:t[0])&&void 0!==i?i:"")}))})),de(o),ue(!0)}}),[ce]);const Ee=a((()=>m(P)),[P]);return e(c.Provider,Object.assign({value:{template:ae,setTemplate:ne,device:Y,setDevice:Z,display_content:ee,setDisplayContent:le,originalVariableList:pe,setOriginalVariableList:me,isError:oe,setIsError:te,channel:g,globalNormalizedPlaceholders:Ee,templateSelectionTriggered:ve,setTemplateSelectionTriggered:he,enabledCustomText:j,disableEditVariable:k,pod:F,extras:O,isWhatsappCarousel:Q,selectedCarouselIndex:Ce,setSelectedCarouselIndex:be,isProductCarouselType:X,cardCount:Q?null===(G=null===(q=h.components)||void 0===q?void 0:q[1].cards)||void 0===G?void 0:G.length:void 0,errorIndexes:ie,setErrorIndexes:re,pickerConf:W,carouselProducts:ge,setCarouselProducts:fe,disableEditExpiry:H,cardWidth:z,cardImages:se,onDeleteSelectedProducts:B,sliderRef:xe}},{children:S?e(p,{channel:d.EMAIL,hideHeader:!0}):l(s,Object.assign({zIndex:T,centralContainerStyles:{width:Q?900:g===d.EMAIL&&b?1e3:800},open:!0,onClose:()=>{null==C||C()},headingTitle:null==ae?void 0:ae.label,headingSubtitle:g===d.WHATSAPP?`${n.capitaliseFirstLetterOfString(null!==(J=null==ae?void 0:ae.category)&&void 0!==J?J:"")} • ${null!==(K=null==ae?void 0:ae.templateCategory)&&void 0!==K?K:""}`:"",onBackPress:()=>{null==V||V()}},{children:[e(p,{showSampleValues:D,showVariableMapping:b,channel:g,whatsappSpecificPickerMeta:I,showVariableModal:y,variableList:w,discountCode:M,setDiscountCode:L,variableListForImage:A&&(null==A?void 0:A.length)>0?A:w,fileName:R,setFileName:e=>{null==U||U(e)}}),E?e(u,{isWhatsappCarousel:null!=Q&&Q,onSelect:function(){if((null==ge?void 0:ge.length)<1&&X)return void te(!0);const e=null==E?void 0:E(ae,pe,null!=ee?ee:"",ge);(null==e?void 0:e.errorIndexes)||(null==e?void 0:e.error)?((null==e?void 0:e.errorIndexes)&&re(e.errorIndexes),(null==e?void 0:e.error)&&te(!!(null==e?void 0:e.error))):he(!0)}}):e(o,{})]}))}))};export{v as TemplateContextMapper};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { LegacyRef } from 'react';
|
|
2
|
+
import Slider from 'react-slick';
|
|
2
3
|
import { CarouselProduct } from "../modalElements/EditWhatsAppCarouselTemplateV2";
|
|
3
4
|
import { CHANNEL_TYPE } from "../../template-preview/models/Channels";
|
|
4
5
|
import { EmailTemplateType } from "../../template-preview/models/EmailTemplate";
|
|
@@ -47,6 +48,7 @@ export declare const TemplateModalContext: React.Context<{
|
|
|
47
48
|
cardWidth?: number | undefined;
|
|
48
49
|
cardImages?: string[] | undefined;
|
|
49
50
|
onDeleteSelectedProducts?: (() => void) | undefined;
|
|
51
|
+
sliderRef?: LegacyRef<Slider> | undefined;
|
|
50
52
|
}>;
|
|
51
53
|
export declare const useTemplateModalContext: () => {
|
|
52
54
|
device: DEVICE_TYPES;
|
|
@@ -88,4 +90,5 @@ export declare const useTemplateModalContext: () => {
|
|
|
88
90
|
cardWidth?: number | undefined;
|
|
89
91
|
cardImages?: string[] | undefined;
|
|
90
92
|
onDeleteSelectedProducts?: (() => void) | undefined;
|
|
93
|
+
sliderRef?: LegacyRef<Slider> | undefined;
|
|
91
94
|
};
|
package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import o from"../../../assets/icons/arrow_back.svg.js";import i from"../../../assets/icons/chevronLeft.svg.js";import r from"../../../assets/icons/chevronRight.svg.js";import n from"../../../assets/icons/PlusIcon.js";import{cloneDeep as a}from"lodash";import{useState as s,useEffect as d}from"react";import{AddVariableV2SideModal as c}from"../../add-variableV2/AddVariableV2SideModal.js";import"../../../_virtual/_tslib.js";import"../../add-variableV2/AddVariableV2.styled.js";import{Button as u}from"../../button/Button.js";import{IconButton as p}from"../../icon-button/IconButton.js";import"../../input/Input.js";import"../../tooltips/Tooltip.js";import{COLORS as m}from"../../../constants/Theme.js";import"../../modals/modal.styled.js";import"../../switch/Switch.js";import{TitleMedium as h,TitleRegular as v,BodySecondary as g,BodyCaption as f}from"../../TypographyStyle.js";import{ProductPickerModal as y,ScreenName as b}from"../../product-picker-v2/modal.js";import{Badge as j}from"../Badge/index.js";import{useTemplateModalContext as x}from"../context/templateModalContext.js";import C from"./EditWhatsAppTemplateV2.js";import{ProductBox as I}from"./ProductBox.js";import"../../template-preview/TemplatePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import"../../curtain/CurtainHelper.js";import"../../template-preview/models/TemplateMeta.js";import{POD as w}from"../../template-preview/models/WhatsAppTemplate.js";const O=O=>{let{template:k,whatsappSpecificPickerMeta:P,showVariableModal:T,variableList:S,variableListForImage:L,discountCode:V,setDiscountCode:A}=O;var E,B;const{selectedCarouselIndex:M,setTemplate:R,pickerConf:D,isProductCarouselType:F,pod:W,cardCount:N,carouselProducts:$,setCarouselProducts:q,isError:_,cardImages:z,disableEditVariable:G,onDeleteSelectedProducts:H,setSelectedCarouselIndex:J,sliderRef:K}=x(),[Q,U]=s(-1==M?"First Message (Step 1/2)":F?"Product Carousel (Step 2/2)":"Carousel Cards (Step 2/2)"),[X,Y]=s(!1),[Z,ee]=s(!1),[te,le]=s(!1);d((()=>{U(-1==M?"First Message (Step 1/2)":F?"Product Carousel (Step 2/2)":"Carousel Cards (Step 2/2)")}),[M]);return e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"16px"}},{children:[e("div",Object.assign({style:{display:"flex",flexDirection:"row",alignItems:"center"}},{children:[null!=M&&M>=0&&t(p,{Icon:o,onClick:()=>{null==J||J(-1)}}),t(h,Object.assign({style:{marginLeft:10}},{children:Q})),M!==(null!=N?N:0)-1&&t(u,{buttonText:"Next",onClick:()=>{var e;console.log("sliderRef",K),null===(e=null==K?void 0:K.current)||void 0===e||e.slickNext(),null==J||J((e=>e+1))}})]})),F&&(null!==(E=null==$?void 0:$.length)&&void 0!==E?E:0)>0&&null!=M&&M>=0&&e("div",Object.assign({style:{display:"flex",rowGap:16,marginBottom:16,marginLeft:10,marginRight:10,flexDirection:"column"}},{children:[t(I,{editItem:()=>{1===(null==$?void 0:$.length)&&"variable"===$[0].name?le(!0):Y(!X)},cardBody:1===(null==$?void 0:$.length)&&"variable"===$[0].name?`${$[0].productName}`:`${null==$?void 0:$.length} Products Selected`,hideIcon:1===(null==$?void 0:$.length)&&"variable"===$[0].name,deleteItem:()=>{var e;if(1===(null==$?void 0:$.length)&&"variable"===$[0].name)return void(null==q||q([]));const t=a(Object.assign({},k));t&&(z&&z.length>0?null==z||z.forEach(((e,l)=>{var o;t.components[1].cards[l].components[0].example.header_handle=[null!==(o=z[l])&&void 0!==o?o:"https://res.cloudinary.com/drqhot9ot/image/upload/v1708753454/fake-product.png"]})):null===(e=null==t?void 0:t.components[1].cards)||void 0===e||e.forEach(((e,l)=>{t.components[1].cards[l].components[0].example.header_handle=["https://res.cloudinary.com/drqhot9ot/image/upload/v1708753454/fake-product.png"]})),null==R||R(t)),null==q||q([]),null==H||H()}}),$&&(null==$?void 0:$.length)>0&&"variable"!=$[0].name&&t(u,{disabled:(null!==(B=null==$?void 0:$.length)&&void 0!==B?B:0)<=1,style:{alignSelf:"flex-end"},onClick:()=>{ee(!0),Y(!0)},buttonText:"Rearrange Products",buttonType:"tertiary"})]})),!G&&F&&0===(null==$?void 0:$.length)&&null!=M&&M>=0&&e(l,{children:[e("div",Object.assign({style:{marginLeft:12}},{children:[t(v,{children:"Product(s)"}),t(g,{children:`Select ${null!=N?N:1} products`})]})),e("div",Object.assign({style:{marginTop:16,marginBottom:16,marginLeft:_?16:12,marginRight:_?16:12,flexDirection:"column",display:"flex",alignItems:"center"}},{children:[t(u,{matchParentWidth:!0,style:{flex:1,display:"flex",width:"100%",marginBottom:12,border:_?`2px dashed ${m.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s)",buttonType:_?"tertiaryGray":"dashBold",LeadingIcon:()=>t("div",Object.assign({style:{display:"flex",width:18,height:18}},{children:t(n,{width:18,height:18,color:m.content.secondary})})),onClick:e=>{Y(!0)}}),W===w.CHATBOT&&e(l,{children:[e("div",Object.assign({style:{display:"flex",flex:1,alignItems:"center",justifyContent:"space-between",flexDirection:"row",width:"100%"}},{children:[t("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginRight:8}}),t(f,Object.assign({style:{color:"#616161",overflow:"unset"}},{children:"OR"})),t("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginLeft:8}})]})),t(u,{matchParentWidth:!0,style:{flex:1,display:"flex",marginTop:12,width:"100%",border:_?`2px dashed ${m.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s) Variable",buttonType:_?"tertiaryGray":"dashBold",LeadingIcon:()=>t("div",Object.assign({style:{display:"flex"}},{children:t(n,{width:18,height:18,color:m.content.secondary})})),onClick:e=>{le(!0)}})]})]})),_&&t("div",Object.assign({style:{marginLeft:10,marginBottom:16}},{children:t(j,{padding:"8px",errorText:"Please add products"})}))]}),!F&&(null!=M?M:-1)>-1&&e("div",Object.assign({style:{display:"flex",background:m.surface.hovered,alignItems:"center"}},{children:[(null!=M?M:-1)>0&&t(p,{Icon:i,color:m.content.secondary,width:8,height:14,onClick:()=>{var e;null===(e=null==K?void 0:K.current)||void 0===e||e.slickPrev(),null==J||J((e=>e-1))}}),t(v,Object.assign({style:{flex:1,display:"flex",justifyContent:"center"},color:m.content.secondary},{children:`Card ${(null!=M?M:0)+1}/${N}`})),M!==(null!=N?N:0)-1&&t(p,{Icon:r,color:m.content.secondary,width:8,height:14,onClick:()=>{var e;null===(e=null==K?void 0:K.current)||void 0===e||e.slickNext(),null==J||J((e=>e+1))}})]})),t(C,{whatsappSpecificPickerMeta:P,template:k,onTemplateChange:e=>{null==R||R(e)},showVariableModal:T,variableList:S,variableListForImage:L,discountCode:V,setDiscountCode:A}),X&&D&&t(y,{zIndex:200,startupScreen:Z?b.RearrangeProducts:b.Collections,rearrangeEnabled:!0,storeId:D.storeId,selectedItems:(e=>{if(e.length>0){const t={};for(const l of e){const e=null==l?void 0:l.collectionId,o=l.productId,i=l.variantId;e in t||(t[e]={products:{},name:"",image:"",isSmartCollection:!1}),o in t[e].products||(t[e].products[o]={variants:{},name:(null==l?void 0:l.productName)||"",image:(null==l?void 0:l.productImage)||""}),t[e].products[o].variants[i]={name:(null==l?void 0:l.name)||"",price:"",image:(null==l?void 0:l.image)||"",quantity:l.quantity||0,displayOrder:l.displayOrder}}return t}return{}})(null!=$?$:[]),collectionFetcher:D.fetchCollections,productFetcher:D.fetchProducts,onAdd:(e,t)=>{var l,o,i,r,n,s;ee(!1);const d=[];delete e.isCustom;for(const t of Object.keys(e)){const a=e[t].products;if(void 0!==a&&Object.keys(a).length)for(const e of Object.keys(a)){const c=a[e].variants;if(void 0!==c&&Object.keys(c).length)for(const u of Object.keys(c)){const{name:p,image:m,quantity:h,displayOrder:v}=c[u],g={name:p,image:null!==(o=null!=m?m:null===(l=a[e])||void 0===l?void 0:l.image)&&void 0!==o?o:"",quantity:h,variantId:u,productId:e,displayOrder:v,collectionId:t,productName:null!==(r=null===(i=a[e])||void 0===i?void 0:i.name)&&void 0!==r?r:"",productImage:null!==(s=null===(n=a[e])||void 0===n?void 0:n.image)&&void 0!==s?s:""};d.push(g)}}}const c=d.sort(((e,t)=>e.displayOrder-t.displayOrder)),u=d.map((e=>e.image)),p=a(Object.assign({},k));p&&(u.forEach(((e,t)=>{var l;p.components[1].cards[t].components[0].example.header_handle=e?[e]:[null!==(l=null==z?void 0:z[t])&&void 0!==l?l:""]})),null==R||R(p)),null==q||q(c),Y(!1)},searchInCollectionFetcher:D.searchInCollection,searchFetcher:D.searchProducts,visible:X,onClose:()=>{Y(!1)},exactLimit:null!=N?N:1}),te&&t(c,{zIndex:2e3,data:null!=S?S:[],showVariable:te,setShowVariable:le,placeholder:"Add a variable",customTrigger:e=>{null==q||q([{name:"variable",productName:e.actualValue}])}})]}))};export{O as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bikdotai/bik-component-library",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.509-beta.1",
|
|
4
4
|
"description": "Bik Component Library",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"@popperjs/core": "^2.11.7",
|
|
53
53
|
"@tippyjs/react": "^4.2.6",
|
|
54
54
|
"@trendyol-js/react-carousel": "^3.0.2",
|
|
55
|
+
"@types/react-slick": "^0.23.13",
|
|
55
56
|
"bootstrap": "^5.1.3",
|
|
56
57
|
"browser-image-compression": "^2.0.2",
|
|
57
58
|
"chart.js": "^3.9.1",
|
|
@@ -68,7 +69,9 @@
|
|
|
68
69
|
"react-image-crop": "^10.0.9",
|
|
69
70
|
"react-lottie": "^1.2.3",
|
|
70
71
|
"react-popper": "^2.3.0",
|
|
72
|
+
"react-slick": "^0.30.2",
|
|
71
73
|
"react-toastify": "^9.1.2",
|
|
74
|
+
"slick-carousel": "^1.8.1",
|
|
72
75
|
"uuid": "^9.0.1"
|
|
73
76
|
},
|
|
74
77
|
"devDependencies": {
|