@bikdotai/bik-component-library 0.0.571 → 0.0.572-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.
Files changed (25) hide show
  1. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  2. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  3. package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  4. package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  5. package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  6. package/dist/cjs/components/bik-layout/MockMenus.d.ts +1 -0
  7. package/dist/cjs/components/product-picker-v2/modal.d.ts +2 -0
  8. package/dist/cjs/components/product-picker-v2/modal.js +1 -1
  9. package/dist/cjs/components/product-picker-v2/productInfoOverlay.js +9 -8
  10. package/dist/cjs/components/product-picker-v2/productScreen.js +1 -1
  11. package/dist/cjs/components/product-picker-v2/utility.d.ts +1 -0
  12. package/dist/cjs/components/product-picker-v2/utility.js +1 -1
  13. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  14. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  15. package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  16. package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  17. package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  18. package/dist/esm/components/bik-layout/MockMenus.d.ts +1 -0
  19. package/dist/esm/components/product-picker-v2/modal.d.ts +2 -0
  20. package/dist/esm/components/product-picker-v2/modal.js +1 -1
  21. package/dist/esm/components/product-picker-v2/productInfoOverlay.js +3 -2
  22. package/dist/esm/components/product-picker-v2/productScreen.js +1 -1
  23. package/dist/esm/components/product-picker-v2/utility.d.ts +1 -0
  24. package/dist/esm/components/product-picker-v2/utility.js +1 -1
  25. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default EventsTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default IGTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption } from "../../../dropdown/type";
3
- import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
4
- import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
3
+ import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
4
+ import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
5
5
  declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
6
6
  cacheKey: string;
7
7
  propertyAddBtnText: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -9,6 +9,7 @@ export interface ProductVariant {
9
9
  displayOrder?: number | null;
10
10
  fbStatus?: FbProductStatus;
11
11
  description?: string;
12
+ id?: string;
12
13
  }
13
14
  export interface Product {
14
15
  name: string;
@@ -17,6 +18,7 @@ export interface Product {
17
18
  variants?: {
18
19
  [key: string]: ProductVariant;
19
20
  };
21
+ id?: string;
20
22
  }
21
23
  export interface Collection {
22
24
  name: string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react/jsx-runtime"),o=require("../../assets/icons/search.svg.js"),c=require("react"),r=require("../../constants/Theme.js"),s=require("../../assets/icons/cross.svg.js"),n=require("../button/Button.js"),l=require("../input/Input.js"),i=require("../modals/styledModal.js"),a=require("../spinner/Spinner.js"),d=require("../tag/Tag.js"),u=require("./collectionScreen.js"),h=require("./productInfoOverlay.js"),p=require("./productScreen.js"),S=require("./rearrangeScreen.js"),C=require("./reducers.js"),x=require("./searchScreen.js"),g=require("./selectedScreen.js"),j=require("./style.js"),y=require("./type.js");exports.ScreenName=void 0,(e=exports.ScreenName||(exports.ScreenName={})).Collections="collections",e.RearrangeProducts="rearrange",e.SelectedProducts="view",e.SearchProducts="searchProducts",e.Products="products";exports.ProductPickerModal=e=>{const{storeId:f,selectedItems:b,onClose:m,visible:v,zIndex:P,exactLimit:k,limit:O,hideCollectionCheckbox:I,hideProductCheckbox:F,outOfStockAction:R=y.OUT_OF_STOCK_ACTION.BLUR,hideVariantCheckbox:T,selectProductsFromCustomCollection:q,hideSelectionCount:E,title:D,width:w,left:N,renderWithoutModal:A,onClickSave:B,pickerType:L,hideProductVariants:M=!1,startupScreen:V=exports.ScreenName.Collections,rearrangeEnabled:$,selectSingleItem:_=!1,showProductDetails:z,containerStyle:H,crossButtonInsideHeader:W=!1}=e,[G,K]=c.useReducer(C.collectionsReducer,{}),[U,Y]=c.useState([exports.ScreenName.Collections,exports.ScreenName.RearrangeProducts].includes(V)?V:exports.ScreenName.Collections),[J,Q]=c.useState("grid"),[X,Z]=c.useState(""),[ee,te]=c.useState(""),[oe,ce]=c.useState(0),[re,se]=c.useState(!1),[ne,le]=c.useState(0),[ie,ae]=c.useState(""),[de,ue]=c.useState(!1),[he,pe]=c.useState(!1),[Se,Ce]=c.useReducer(C.searchReducer,{collections:{},products:{}}),[xe,ge]=c.useReducer(C.selectedColectionsReducer,Object.keys(b).length>0?b:{}),je=c.useRef(null),[ye,fe]=c.useState(!1),[be,me]=c.useState();c.useEffect((()=>{se(!0),pe(!0),e.collectionFetcher(oe,f).then((e=>{K({type:"fetched",data:(null==e?void 0:e.collections)||{}}),se(!1),ce((e=>e+1)),pe(!1)})).catch()}),[]),c.useEffect((()=>{let e=0;M?Object.keys(xe||[]).forEach((t=>{var o;Object.keys((null===(o=xe[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c;"-1"!==t&&xe[-1]&&(null===(c=xe[-1].products)||void 0===c?void 0:c[o])||(e+=1)}))})):Object.keys(xe||[]).forEach((t=>{var o;Object.keys((null===(o=xe[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=xe[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),le(e)}),[G,xe,M]),c.useEffect((()=>{ee&&(se(!0),e.productFetcher(ee,f).then((e=>{Object.keys(e).length&&K({type:"productsFetched",data:{collectionId:ee,products:e}}),se(!1)})).catch())}),[ee]),c.useEffect((()=>{const t=setTimeout((()=>{"rearrange"!==U&&(ie.length||"collections"!==U)&&(ie.length?(ue(!0),e.searchFetcher(f,ie).then((e=>{"collections"in e&&"products"in e?(Ce({type:"set",data:e}),K({type:"searched",data:e.collections})):(Ce({type:"set",data:{collections:{},products:e}}),K({type:"searched",data:e})),Y("searchProducts"),se(!1),ue(!1)}))):Y("collections"))}),800);return()=>clearTimeout(t)}),[ie]),c.useEffect((()=>{B&&(e.onAdd(xe,ne),ve())}),[B]),c.useEffect((()=>{_&&Object.keys(xe||{}).length&&ne&&(e.onAdd(xe,ne),ve())}),[_,xe,ne]);const ve=()=>{ge({type:"reset",data:{}})},Pe=t.jsxs(j.ContainerStyle,Object.assign({style:null!=H?H:{}},{children:[e.postHeader&&t.jsx("div",Object.assign({style:{padding:"0 24px"}},{children:e.postHeader})),!e.hideGlobalSearch&&t.jsx(t.Fragment,{children:("collections"===U||"searchProducts"===U)&&t.jsx("div",Object.assign({style:{padding:A?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:t.jsx(l.Input,{placeholder:"Search Collections or Products",noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>de?t.jsx(a.Spinner,{size:"small",color:r.COLORS.content.primary}):t.jsx(o.default,{})},id:"listInput",height:"24px",type:"text",value:ie,onChangeText:e=>{e.length&&e.trim().length?ae(e):ae("")}})}))}),t.jsxs(j.ScrollContainerStyle,Object.assign({ref:je,screenName:U},{children:["collections"===U&&t.jsx(u.CollectionsScreen,{customCollectionRestriction:e.customCollectionRestriction,dataLoading:he,collections:G,selectedCollectionsDispatch:ge,setCollectionId:Z,setSelectedCollectionId:te,setScreen:Y,selectedCollections:xe,collectionFetcher:e.collectionFetcher,storeId:f,collectionsDispatch:K,setSaveDisabled:se,pagingControls:{curPage:oe,setCurPage:ce},hideCollectionCheckbox:I,renderWithoutModal:A,pickerType:L,scrollContainerRef:je}),"products"===U&&X&&t.jsx(C.CollectionIdContext.Provider,Object.assign({value:X},{children:t.jsx(p.ProductsScreen,{hideInCollectionSearch:e.hideInCollectionSearch,customCollectionRestriction:e.customCollectionRestriction,productFetcher:e.productFetcher,setScreen:Y,storeId:f,data:G[X],collectionsDispatch:K,selectedCollectionsDispatch:ge,selectedData:xe,setSaveDisabled:se,searchInCollectionFetcher:e.searchInCollectionFetcher,hideProductCheckbox:F,outOfStockAction:R,hideVariantCheckbox:T,selectProductsFromCustomCollection:q,renderWithoutModal:A,pickerType:L,hideProductVariants:M,fbStatusFetcher:e.fbStatusFetcher,onProductDetailClick:e=>{fe(!0),me(e)},showProductDetailInfoIcon:z,scrollContainerRef:je})})),"view"===U&&t.jsx(g.SelectedScreen,{selectedCollections:xe||{},selectedCollectionsDispatch:ge,setScreen:Y,collections:G,hideProductVariants:M,outOfStockAction:R,storeId:f,fbStatusFetcher:e.fbStatusFetcher}),"rearrange"===U&&t.jsx(S.RearrangeScreen,{selectedCollections:xe||{},selectedCollectionsDispatch:ge,setScreen:Y,outOfStockAction:R,rearrangeViewType:"grid"===J?"list":"grid",scrollContainerRef:je,storeId:f,fbStatusFetcher:e.fbStatusFetcher}),"searchProducts"===U&&t.jsx(x.SearchScreen,{customCollectionRestriction:e.customCollectionRestriction,selectedCollections:xe||{},searchedCollections:Se||{},searchedCollectionsDispatch:Ce,selectedCollectionsDispatch:ge,setScreen:Y,collections:G,onBackPress:()=>{ae(""),Ce({type:"set",data:{collections:{},products:{}}})},pickerType:L,hideProductCheckbox:F,hideProductVariants:M,hideVariantCheckbox:T,storeId:f,fbStatusFetcher:e.fbStatusFetcher,setCollectionId:Z,setSelectedCollectionId:te,renderWithoutModal:A,hideCollectionCheckbox:I,outOfStockAction:R})]}))]}));return t.jsx(t.Fragment,{children:A?Pe:t.jsxs(i.StyledModal,Object.assign({zIndex:P,open:v,onClose:()=>{null==m||m(),ve()},headingTitle:D||("collections"===U||"products"===U?"Select Products":"view"===U?"Selected Products":"searchProducts"===U?"Searched Results":"rearrange"===U?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:w||"600px",left:N||"auto"},headerRightCustomElement:W?t.jsx("div",Object.assign({style:{cursor:"pointer",display:"flex"},onClick:m},{children:t.jsx(s.default,{width:20,height:20,color:r.COLORS.content.secondary})})):t.jsx(t.Fragment,{}),footerContainerStyle:e.stickyFooter?{position:"absolute",bottom:0,left:0,width:"100%",zIndex:9,background:r.COLORS.surface.standard}:void 0,primaryButton:{buttonText:re?"Loading...":U===exports.ScreenName.RearrangeProducts?"Done":"Add",disabled:re||ne<1||k&&ne<k||!k&&O&&ne>O||!1,onClick:()=>{e.onAdd(xe,ne),ve()}},wrapperStyle:e.stickyFooter?{height:"calc(100vh - 168px)"}:void 0,footerLeftCustomElement:E?t.jsx(t.Fragment,{}):k&&ne>k?t.jsx(d.Tag,{tagText:`You can only select ${k} products`,type:"negative"}):O&&ne>O?t.jsx(d.Tag,{tagText:`You can only select ${O} products`,type:"negative"}):ne>0?t.jsx(n.Button,{onClick:()=>{Y($?exports.ScreenName.RearrangeProducts:exports.ScreenName.SelectedProducts)},buttonText:k?`${ne}/${k} products selected`:`${ne} products selected`,buttonType:["rearrange","view"].includes(U)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(U)}):t.jsx(n.Button,{disabled:!0,buttonText:k?`${ne}/${k} products selected`:`${ne} products selected`,buttonType:"tertiaryGray"}),hideCrossButton:ye||W},{children:[Pe,ye&&be?t.jsx(h.ProductInfoOverlay,{productData:be,outOfStockAction:R,onClose:()=>{fe(!1)}}):t.jsx(t.Fragment,{})]}))})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react/jsx-runtime"),o=require("../../assets/icons/search.svg.js"),c=require("react"),r=require("../../constants/Theme.js"),s=require("../../assets/icons/cross.svg.js"),n=require("../button/Button.js"),l=require("../input/Input.js"),i=require("../modals/styledModal.js"),a=require("../spinner/Spinner.js"),d=require("../tag/Tag.js"),u=require("./collectionScreen.js"),h=require("./productInfoOverlay.js"),p=require("./productScreen.js"),S=require("./rearrangeScreen.js"),C=require("./reducers.js"),x=require("./searchScreen.js"),g=require("./selectedScreen.js"),j=require("./style.js"),y=require("./type.js"),f=require("./utility.js");exports.ScreenName=void 0,(e=exports.ScreenName||(exports.ScreenName={})).Collections="collections",e.RearrangeProducts="rearrange",e.SelectedProducts="view",e.SearchProducts="searchProducts",e.Products="products";exports.ProductPickerModal=e=>{const{storeId:b,selectedItems:m,onClose:v,visible:P,zIndex:k,exactLimit:O,limit:I,hideCollectionCheckbox:F,hideProductCheckbox:R,outOfStockAction:T=y.OUT_OF_STOCK_ACTION.BLUR,hideVariantCheckbox:q,selectProductsFromCustomCollection:D,hideSelectionCount:E,title:w,width:A,left:N,renderWithoutModal:B,onClickSave:V,pickerType:L,hideProductVariants:M=!1,startupScreen:$=exports.ScreenName.Collections,rearrangeEnabled:_,selectSingleItem:z=!1,showProductDetails:H,containerStyle:W,crossButtonInsideHeader:G=!1}=e,[K,U]=c.useReducer(C.collectionsReducer,{}),[Y,J]=c.useState([exports.ScreenName.Collections,exports.ScreenName.RearrangeProducts].includes($)?$:exports.ScreenName.Collections),[Q,X]=c.useState("grid"),[Z,ee]=c.useState(""),[te,oe]=c.useState(""),[ce,re]=c.useState(0),[se,ne]=c.useState(!1),[le,ie]=c.useState(0),[ae,de]=c.useState(""),[ue,he]=c.useState(!1),[pe,Se]=c.useState(!1),[Ce,xe]=c.useReducer(C.searchReducer,{collections:{},products:{}}),[ge,je]=c.useReducer(C.selectedColectionsReducer,Object.keys(m).length>0?m:{}),ye=c.useRef(null),[fe,be]=c.useState(!1),[me,ve]=c.useState();c.useEffect((()=>{ne(!0),Se(!0),e.collectionFetcher(ce,b).then((e=>{U({type:"fetched",data:(null==e?void 0:e.collections)||{}}),ne(!1),re((e=>e+1)),Se(!1)})).catch()}),[]),c.useEffect((()=>{let e=0;M?Object.keys(ge||[]).forEach((t=>{var o;Object.keys((null===(o=ge[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c;"-1"!==t&&ge[-1]&&(null===(c=ge[-1].products)||void 0===c?void 0:c[o])||(e+=1)}))})):Object.keys(ge||[]).forEach((t=>{var o;Object.keys((null===(o=ge[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=ge[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),ie(e)}),[K,ge,M]),c.useEffect((()=>{te&&(ne(!0),e.productFetcher(te,b).then((e=>{const t=f.addIdToProductsAndVariants(e);Object.keys(e).length&&U({type:"productsFetched",data:{collectionId:te,products:t}}),ne(!1)})).catch())}),[te]),c.useEffect((()=>{const t=setTimeout((()=>{"rearrange"!==Y&&(ae.length||"collections"!==Y)&&(ae.length?(he(!0),e.searchFetcher(b,ae).then((e=>{"collections"in e&&"products"in e?(xe({type:"set",data:e}),U({type:"searched",data:e.collections})):(xe({type:"set",data:{collections:{},products:e}}),U({type:"searched",data:e})),J("searchProducts"),ne(!1),he(!1)}))):J("collections"))}),800);return()=>clearTimeout(t)}),[ae]),c.useEffect((()=>{V&&(e.onAdd(ge,le),Pe())}),[V]),c.useEffect((()=>{z&&Object.keys(ge||{}).length&&le&&(e.onAdd(ge,le),Pe())}),[z,ge,le]);const Pe=()=>{je({type:"reset",data:{}})},ke=t.jsxs(j.ContainerStyle,Object.assign({style:null!=W?W:{}},{children:[e.postHeader&&t.jsx("div",Object.assign({style:{padding:"0 24px"}},{children:e.postHeader})),!e.hideGlobalSearch&&t.jsx(t.Fragment,{children:("collections"===Y||"searchProducts"===Y)&&t.jsx("div",Object.assign({style:{padding:B?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:t.jsx(l.Input,{placeholder:"Search for collections and products, or type a product ID",noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>ue?t.jsx(a.Spinner,{size:"small",color:r.COLORS.content.primary}):t.jsx(o.default,{})},id:"listInput",height:"24px",type:"text",value:ae,onChangeText:e=>{e.length&&e.trim().length?de(e):de("")}})}))}),t.jsxs(j.ScrollContainerStyle,Object.assign({ref:ye,screenName:Y},{children:["collections"===Y&&t.jsx(u.CollectionsScreen,{customCollectionRestriction:e.customCollectionRestriction,dataLoading:pe,collections:K,selectedCollectionsDispatch:je,setCollectionId:ee,setSelectedCollectionId:oe,setScreen:J,selectedCollections:ge,collectionFetcher:e.collectionFetcher,storeId:b,collectionsDispatch:U,setSaveDisabled:ne,pagingControls:{curPage:ce,setCurPage:re},hideCollectionCheckbox:F,renderWithoutModal:B,pickerType:L,scrollContainerRef:ye}),"products"===Y&&Z&&t.jsx(C.CollectionIdContext.Provider,Object.assign({value:Z},{children:t.jsx(p.ProductsScreen,{hideInCollectionSearch:e.hideInCollectionSearch,customCollectionRestriction:e.customCollectionRestriction,productFetcher:e.productFetcher,setScreen:J,storeId:b,data:K[Z],collectionsDispatch:U,selectedCollectionsDispatch:je,selectedData:ge,setSaveDisabled:ne,searchInCollectionFetcher:e.searchInCollectionFetcher,hideProductCheckbox:R,outOfStockAction:T,hideVariantCheckbox:q,selectProductsFromCustomCollection:D,renderWithoutModal:B,pickerType:L,hideProductVariants:M,fbStatusFetcher:e.fbStatusFetcher,onProductDetailClick:e=>{be(!0),ve(e)},showProductDetailInfoIcon:H,scrollContainerRef:ye})})),"view"===Y&&t.jsx(g.SelectedScreen,{selectedCollections:ge||{},selectedCollectionsDispatch:je,setScreen:J,collections:K,hideProductVariants:M,outOfStockAction:T,storeId:b,fbStatusFetcher:e.fbStatusFetcher}),"rearrange"===Y&&t.jsx(S.RearrangeScreen,{selectedCollections:ge||{},selectedCollectionsDispatch:je,setScreen:J,outOfStockAction:T,rearrangeViewType:"grid"===Q?"list":"grid",scrollContainerRef:ye,storeId:b,fbStatusFetcher:e.fbStatusFetcher}),"searchProducts"===Y&&t.jsx(x.SearchScreen,{customCollectionRestriction:e.customCollectionRestriction,selectedCollections:ge||{},searchedCollections:Ce||{},searchedCollectionsDispatch:xe,selectedCollectionsDispatch:je,setScreen:J,collections:K,onBackPress:()=>{de(""),xe({type:"set",data:{collections:{},products:{}}})},pickerType:L,hideProductCheckbox:R,hideProductVariants:M,hideVariantCheckbox:q,storeId:b,fbStatusFetcher:e.fbStatusFetcher,setCollectionId:ee,setSelectedCollectionId:oe,renderWithoutModal:B,hideCollectionCheckbox:F,outOfStockAction:T})]}))]}));return t.jsx(t.Fragment,{children:B?ke:t.jsxs(i.StyledModal,Object.assign({zIndex:k,open:P,onClose:()=>{null==v||v(),Pe()},headingTitle:w||("collections"===Y||"products"===Y?"Select Products":"view"===Y?"Selected Products":"searchProducts"===Y?"Searched Results":"rearrange"===Y?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:A||"600px",left:N||"auto"},headerRightCustomElement:G?t.jsx("div",Object.assign({style:{cursor:"pointer",display:"flex"},onClick:v},{children:t.jsx(s.default,{width:20,height:20,color:r.COLORS.content.secondary})})):t.jsx(t.Fragment,{}),footerContainerStyle:e.stickyFooter?{position:"absolute",bottom:0,left:0,width:"100%",zIndex:9,background:r.COLORS.surface.standard}:void 0,primaryButton:{buttonText:se?"Loading...":Y===exports.ScreenName.RearrangeProducts?"Done":"Add",disabled:se||le<1||O&&le<O||!O&&I&&le>I||!1,onClick:()=>{e.onAdd(ge,le),Pe()}},wrapperStyle:e.stickyFooter?{height:"calc(100vh - 168px)"}:void 0,footerLeftCustomElement:E?t.jsx(t.Fragment,{}):O&&le>O?t.jsx(d.Tag,{tagText:`You can only select ${O} products`,type:"negative"}):I&&le>I?t.jsx(d.Tag,{tagText:`You can only select ${I} products`,type:"negative"}):le>0?t.jsx(n.Button,{onClick:()=>{J(_?exports.ScreenName.RearrangeProducts:exports.ScreenName.SelectedProducts)},buttonText:O?`${le}/${O} products selected`:`${le} products selected`,buttonType:["rearrange","view"].includes(Y)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(Y)}):t.jsx(n.Button,{disabled:!0,buttonText:O?`${le}/${O} products selected`:`${le} products selected`,buttonType:"tertiaryGray"}),hideCrossButton:fe||G},{children:[ke,fe&&me?t.jsx(h.ProductInfoOverlay,{productData:me,outOfStockAction:T,onClose:()=>{be(!1)}}):t.jsx(t.Fragment,{})]}))})};
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("styled-components"),o=require("../../constants/Theme.js"),r=require("../../assets/icons/cross.svg.js"),i=require("../icon-button/IconButton.js"),a=require("../shimmer-image/ShimmerImage.js"),s=require("../TypographyStyle.js"),d=require("./ProductPickerTag.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=n(t);const c=t=>{var o;const r=void 0===t.productData.variants;return e.jsxs(f,{children:[e.jsx(g,{children:e.jsx(a.ShimmerImage,{imageUrl:t.productData.image,width:"200px",height:200,borderRadius:4})}),e.jsxs(h,{children:[e.jsx(s.TitleSmall,Object.assign({style:{display:"flex"}},{children:t.productData.name})),e.jsx(s.BodyCaption,{className:"overlay-description",dangerouslySetInnerHTML:{__html:null!==(o=t.productData.description)&&void 0!==o?o:""}}),e.jsx(d.ProductPickerTag,{isVariant:r,data:t.productData,outOfStockAction:t.outOfStockAction})]})]})},u=l.default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("styled-components"),o=require("../../constants/Theme.js"),r=require("../../assets/icons/cross.svg.js"),i=require("../icon-button/IconButton.js"),a=require("../shimmer-image/ShimmerImage.js"),d=require("../TypographyStyle.js"),s=require("./ProductPickerTag.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=n(t);const l=t=>{var r;const i=void 0===t.productData.variants;return e.jsxs(f,{children:[e.jsx(g,{children:e.jsx(a.ShimmerImage,{imageUrl:t.productData.image,width:"200px",height:200,borderRadius:4})}),e.jsxs(h,{children:[e.jsx(d.TitleRegular,Object.assign({style:{display:"flex"}},{children:t.productData.name})),e.jsx(d.BodyCaption,Object.assign({color:o.COLORS.content.secondary},{children:`Product ID: ${t.productData.id}`})),e.jsx(d.BodyCaption,{className:"overlay-description",dangerouslySetInnerHTML:{__html:null!==(r=t.productData.description)&&void 0!==r?r:""}}),e.jsx(s.ProductPickerTag,{isVariant:i,data:t.productData,outOfStockAction:t.outOfStockAction})]})]})},u=c.default.div`
2
2
  display: flex;
3
3
  flex: 1;
4
4
  background: rgba(0, 0, 0, 0.5);
@@ -15,12 +15,13 @@
15
15
  max-height: 300px;
16
16
  overflow-y: auto;
17
17
  word-break: break-word;
18
+ margin-top: 8px;
18
19
  }
19
- `,p=l.default.div`
20
+ `,p=c.default.div`
20
21
  display: flex;
21
22
  flex: 1;
22
23
  background: rgba(0, 0, 0, 0.5);
23
- `,x=l.default.div`
24
+ `,x=c.default.div`
24
25
  position: relative;
25
26
 
26
27
  .close-button {
@@ -31,17 +32,17 @@
31
32
  background: ${o.COLORS.surface.standard};
32
33
  border-radius: 50%;
33
34
  }
34
- `,f=l.default.div`
35
+ `,f=c.default.div`
35
36
  display: flex;
36
37
  background: white;
37
38
  padding: 24px;
38
39
  gap: 24px;
39
40
  border-radius: 8px 8px 0px 0px;
40
- `,g=l.default.div`
41
+ `,g=c.default.div`
41
42
  display: flex;
42
- `,h=l.default.div`
43
+ `,h=c.default.div`
43
44
  display: flex;
44
45
  flex: 1;
45
46
  flex-direction: column;
46
- gap: 10px;
47
- `;exports.ProductInfoCard=c,exports.ProductInfoOverlay=t=>e.jsxs(u,{children:[e.jsx(p,{}),e.jsx(x,{children:e.jsx(i.IconButton,{className:"close-button",onClick:t.onClose,Icon:r.default,width:20,height:20})}),e.jsx(c,{productData:t.productData,outOfStockAction:t.outOfStockAction})]});
47
+ gap: 4px;
48
+ `;exports.ProductInfoCard=l,exports.ProductInfoOverlay=t=>e.jsxs(u,{children:[e.jsx(p,{}),e.jsx(x,{children:e.jsx(i.IconButton,{className:"close-button",onClick:t.onClose,Icon:r.default,width:20,height:20})}),e.jsx(l,{productData:t.productData,outOfStockAction:t.outOfStockAction})]});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),c=require("../../assets/icons/box.svg.js"),o=require("../../assets/icons/search.svg.js"),r=require("lodash"),s=require("react"),n=require("../../constants/Theme.js"),i=require("../checkBox/CheckBox.js"),l=require("../icon-button/IconButton.js"),d=require("../InfiniteScroll/InfiniteScroll.js"),u=require("../input/Input.js"),a=require("../spinner/Spinner.js"),h=require("../TypographyStyle.js"),p=require("./emptyState.js"),j=require("./product.js"),v=require("./ProductPickerShimmer.js"),g=require("./reducers.js"),y=require("./style.js"),O=require("./type.js"),b=require("./utility.js");exports.ProductsScreen=f=>{var k,C;const{data:P,collectionsDispatch:x,selectedData:S,selectedCollectionsDispatch:I,productFetcher:m,storeId:q,setScreen:A,setSaveDisabled:E,hideInCollectionSearch:T,customCollectionRestriction:D,hideProductCheckbox:R,outOfStockAction:V=O.OUT_OF_STOCK_ACTION.BLUR,hideVariantCheckbox:L=!1,selectProductsFromCustomCollection:F=!1,pickerType:w,hideProductVariants:B,fbStatusFetcher:_,onProductDetailClick:M,showProductDetailInfoIcon:U,scrollContainerRef:H}=f,J=s.useContext(g.CollectionIdContext),K=s.useRef(0),N=s.useRef(!1),[W,z]=s.useState(""),[G,Q]=s.useState(!1),[X,Y]=s.useState(P),Z=s.useRef(!0),$=s.useRef(!1);s.useEffect((()=>{if(Z.current)return void(Z.current=!1);const e=setTimeout((()=>{W.length?(Q(!0),f.searchInCollectionFetcher(q,J,W).then((e=>{const t=r.cloneDeep(P);t.products=e,Y(t);const c=b.getVariantIdsToFetchAtProductLevel(null!=e?e:{});te(c,null!=e?e:{},!0),E(!1),Q(!1)}))):Y(P)}),800);return()=>clearTimeout(e)}),[W]);s.useEffect((()=>{var e,t,c,o;$.current=!1,K.current=Math.floor((null===(t=Object.keys(null!==(e=P.products)&&void 0!==e?e:{}))||void 0===t?void 0:t.length)/10);const r=b.getVariantIdsToFetchAtProductLevel(null!==(c=P.products)&&void 0!==c?c:{});te(r,null!==(o=P.products)&&void 0!==o?o:{})}),[J]);const ee=!!D&&P.isSmartCollection;s.useEffect((()=>{(null==P?void 0:P.products)||ce(10)}),[]);const te=(e,t,c)=>{_||(c?b.markVariantsAsApprovedProductsLevel(t,x,J,X,Y):b.markVariantsAsApprovedProductsLevel(t,x,J)),e.length>0&&_&&_(q,e).then((e=>{const o=Object.assign({},t);Object.keys(t).forEach((c=>{var r,s;Object.keys(null!==(s=null===(r=null==t?void 0:t[c])||void 0===r?void 0:r.variants)&&void 0!==s?s:{}).forEach((r=>{var s,n;const i=null===(s=null==t?void 0:t[c].variants)||void 0===s?void 0:s[r];i&&"REJECTED"===e[r]?i.fbStatus="REJECTED":i&&"APPROVED"===e[r]&&(i.fbStatus="APPROVED");const l=null===(n=null==o?void 0:o[c])||void 0===n?void 0:n.variants;l&&l[r]&&(l[r]=i)}))})),c?(Y((e=>{const t=Object.assign({},e);return t.products=o,t})),x({type:"productsPaged",data:{collectionId:J,products:o}})):x({type:"productsPaged",data:{collectionId:J,products:o}})})).catch((e=>{c?b.markVariantsAsApprovedProductsLevel(t,x,J,X,Y):b.markVariantsAsApprovedProductsLevel(t,x,J)}))},ce=e=>{E(!0),Q(!0),m(J,q,e,0).then((t=>{if(Object.keys(t).length||($.current=!0),Object.keys(t).length){Y(Object.assign(Object.assign({},X),{products:t}));const e=b.getVariantIdsToFetchAtProductLevel(t);te(e,t),K.current=1}e||I({type:"selected",data:{id:J,val:Object.assign(Object.assign({},P),{products:t})}}),E(!1),Q(!1)})).catch()},oe=(e,t)=>{const c=b.liftTheStateUp(t,P);I({type:e,data:Object.assign(Object.assign({},c),{isRestricted:D})})},re=!!(null==S?void 0:S[J])&&!!Object.keys(null!==(C=null===(k=null==S?void 0:S[J])||void 0===k?void 0:k.products)&&void 0!==C?C:{}).length;return e.jsxs("div",{children:[e.jsxs(y.ProductScreenHeader,{children:[e.jsx(l.IconButton,{Icon:t.default,height:16,onClick:()=>{A("collections")}}),e.jsx(h.BodyCaption,Object.assign({style:{color:n.COLORS.content.secondary}},{children:P.name}))]}),!T&&e.jsx("div",Object.assign({style:{padding:16,height:"76px",borderBottom:"1px solid #E0E0E0"}},{children:e.jsx(u.Input,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>G&&W.length?e.jsx(a.Spinner,{size:"small",color:n.COLORS.content.primary}):e.jsx(o.default,{})},id:"listInput",height:"24px",type:"text",value:W,onChangeText:e=>{e.length&&e.trim().length?z(e):z("")},placeholder:"Search products in this collection..."})})),Object.keys((null==X?void 0:X.products)||[]).length>0&&!ee&&!W.length&&!R&&"-1"!==J&&e.jsxs(y.ProductScreenCollectionCardStyle,{children:[e.jsx(i.CheckBox,{isChecked:re,isPartiallyChecked:b.isCollectionPartiallyChecked(J,X,S,B),onValueChange:function(e){e?ce():I({type:"unselected",data:{id:J}})}}),e.jsx("div",Object.assign({style:{width:40,height:40}},{children:e.jsx(c.default,{})})),e.jsx(h.TitleRegular,{children:"All Products"})]}),e.jsx(d.InfiniteScroll,Object.assign({hasData:!(Object.keys((null==X?void 0:X.products)||[]).length<10)&&!!Object.keys((null==X?void 0:X.products)||[]).length,fetchMore:()=>(N.current=!0,m(J,q,10,K.current).then((e=>{let t=!1;if(Object.keys(e).length||(t=!0),Object.keys(e).length){const t=X;t.products=Object.assign(Object.assign({},X.products),e),Y(Object.assign({},t));const c=b.getVariantIdsToFetchAtProductLevel(e);te(c,e)}return E(!1),N.current=!1,K.current+=1,t}))),containerRef:H},{children:Object.keys((null==X?void 0:X.products)||[]).length?Object.keys(X.products||[]).map((t=>e.jsx(j.ProductGroup,{outOfStockAction:V,collectionId:J,isProductPartiallyChecked:b.isProductPartiallyChecked(J,t,S,X,B),productId:t,data:X.products[t],selectedData:S,selectedCollectionsDispatch:I,viewOnly:!F&&!!ee,upliftAdditions:oe,hideProductCheckbox:R,hideVariantCheckbox:L,hideProductVariants:B,pickerType:w,onProductDetailClick:M,showProductDetailInfoIcon:U},t))):G?e.jsx(v.ProductPickerShimmer,{limit:10}):e.jsx(p.EmptyState,{title:"No products to show",subtitle:W.length?"We couldn't find the product you were looking for":"We couldn’t find any product in this collection."})}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),o=require("../../assets/icons/box.svg.js"),r=require("../../assets/icons/search.svg.js"),c=require("lodash"),s=require("react"),n=require("../../constants/Theme.js"),i=require("../checkBox/CheckBox.js"),l=require("../icon-button/IconButton.js"),d=require("../InfiniteScroll/InfiniteScroll.js"),u=require("../input/Input.js"),a=require("../spinner/Spinner.js"),h=require("../TypographyStyle.js"),p=require("./emptyState.js"),j=require("./product.js"),v=require("./ProductPickerShimmer.js"),g=require("./reducers.js"),y=require("./style.js"),O=require("./type.js"),b=require("./utility.js");exports.ProductsScreen=f=>{var P,k;const{data:C,collectionsDispatch:x,selectedData:S,selectedCollectionsDispatch:I,productFetcher:m,storeId:q,setScreen:A,setSaveDisabled:T,hideInCollectionSearch:D,customCollectionRestriction:E,hideProductCheckbox:R,outOfStockAction:V=O.OUT_OF_STOCK_ACTION.BLUR,hideVariantCheckbox:L=!1,selectProductsFromCustomCollection:F=!1,pickerType:w,hideProductVariants:B,fbStatusFetcher:_,onProductDetailClick:M,showProductDetailInfoIcon:U,scrollContainerRef:H}=f,J=s.useContext(g.CollectionIdContext),K=s.useRef(0),N=s.useRef(!1),[W,z]=s.useState(""),[G,Q]=s.useState(!1),[X,Y]=s.useState(C),Z=s.useRef(!0),$=s.useRef(!1);s.useEffect((()=>{if(Z.current)return void(Z.current=!1);const e=setTimeout((()=>{W.length?(Q(!0),f.searchInCollectionFetcher(q,J,W).then((e=>{const t=c.cloneDeep(C);t.products=e,Y(t);const o=b.getVariantIdsToFetchAtProductLevel(null!=e?e:{});te(o,null!=e?e:{},!0),T(!1),Q(!1)}))):Y(C)}),800);return()=>clearTimeout(e)}),[W]);s.useEffect((()=>{var e,t,o,r;$.current=!1,K.current=Math.floor((null===(t=Object.keys(null!==(e=C.products)&&void 0!==e?e:{}))||void 0===t?void 0:t.length)/10);const c=b.getVariantIdsToFetchAtProductLevel(null!==(o=C.products)&&void 0!==o?o:{});te(c,null!==(r=C.products)&&void 0!==r?r:{})}),[J]);const ee=!!E&&C.isSmartCollection;s.useEffect((()=>{(null==C?void 0:C.products)||oe(10)}),[]);const te=(e,t,o)=>{_||(o?b.markVariantsAsApprovedProductsLevel(t,x,J,X,Y):b.markVariantsAsApprovedProductsLevel(t,x,J)),e.length>0&&_&&_(q,e).then((e=>{const r=Object.assign({},t);Object.keys(t).forEach((o=>{var c,s;Object.keys(null!==(s=null===(c=null==t?void 0:t[o])||void 0===c?void 0:c.variants)&&void 0!==s?s:{}).forEach((c=>{var s,n;const i=null===(s=null==t?void 0:t[o].variants)||void 0===s?void 0:s[c];i&&"REJECTED"===e[c]?i.fbStatus="REJECTED":i&&"APPROVED"===e[c]&&(i.fbStatus="APPROVED");const l=null===(n=null==r?void 0:r[o])||void 0===n?void 0:n.variants;l&&l[c]&&(l[c]=i)}))})),o?(Y((e=>{const t=Object.assign({},e);return t.products=r,t})),x({type:"productsPaged",data:{collectionId:J,products:r}})):x({type:"productsPaged",data:{collectionId:J,products:r}})})).catch((e=>{o?b.markVariantsAsApprovedProductsLevel(t,x,J,X,Y):b.markVariantsAsApprovedProductsLevel(t,x,J)}))},oe=e=>{T(!0),Q(!0),m(J,q,e,0).then((t=>{const o=b.addIdToProductsAndVariants(t);if(Object.keys(t).length||($.current=!0),Object.keys(t).length){Y(Object.assign(Object.assign({},X),{products:o}));const e=b.getVariantIdsToFetchAtProductLevel(o);te(e,o),K.current=1}e||I({type:"selected",data:{id:J,val:Object.assign(Object.assign({},C),{products:o})}}),T(!1),Q(!1)})).catch()},re=(e,t)=>{const o=b.liftTheStateUp(t,C);I({type:e,data:Object.assign(Object.assign({},o),{isRestricted:E})})},ce=!!(null==S?void 0:S[J])&&!!Object.keys(null!==(k=null===(P=null==S?void 0:S[J])||void 0===P?void 0:P.products)&&void 0!==k?k:{}).length;return e.jsxs("div",{children:[e.jsxs(y.ProductScreenHeader,{children:[e.jsx(l.IconButton,{Icon:t.default,height:16,onClick:()=>{A("collections")}}),e.jsx(h.BodyCaption,Object.assign({style:{color:n.COLORS.content.secondary}},{children:C.name}))]}),!D&&e.jsx("div",Object.assign({style:{padding:16,height:"76px",borderBottom:"1px solid #E0E0E0"}},{children:e.jsx(u.Input,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>G&&W.length?e.jsx(a.Spinner,{size:"small",color:n.COLORS.content.primary}):e.jsx(r.default,{})},id:"listInput",height:"24px",type:"text",value:W,onChangeText:e=>{e.length&&e.trim().length?z(e):z("")},placeholder:"Search for a product or type a product ID"})})),Object.keys((null==X?void 0:X.products)||[]).length>0&&!ee&&!W.length&&!R&&"-1"!==J&&e.jsxs(y.ProductScreenCollectionCardStyle,{children:[e.jsx(i.CheckBox,{isChecked:ce,isPartiallyChecked:b.isCollectionPartiallyChecked(J,X,S,B),onValueChange:function(e){e?oe():I({type:"unselected",data:{id:J}})}}),e.jsx("div",Object.assign({style:{width:40,height:40}},{children:e.jsx(o.default,{})})),e.jsx(h.TitleRegular,{children:"All Products"})]}),e.jsx(d.InfiniteScroll,Object.assign({hasData:!(Object.keys((null==X?void 0:X.products)||[]).length<10)&&!!Object.keys((null==X?void 0:X.products)||[]).length,fetchMore:()=>(N.current=!0,m(J,q,10,K.current).then((e=>{let t=!1;if(Object.keys(e).length||(t=!0),Object.keys(e).length){const t=X;t.products=Object.assign(Object.assign({},X.products),e),Y(Object.assign({},t));const o=b.getVariantIdsToFetchAtProductLevel(e);te(o,e)}return T(!1),N.current=!1,K.current+=1,t}))),containerRef:H},{children:Object.keys((null==X?void 0:X.products)||[]).length?Object.keys(X.products||[]).map((t=>e.jsx(j.ProductGroup,{outOfStockAction:V,collectionId:J,isProductPartiallyChecked:b.isProductPartiallyChecked(J,t,S,X,B),productId:t,data:X.products[t],selectedData:S,selectedCollectionsDispatch:I,viewOnly:!F&&!!ee,upliftAdditions:re,hideProductCheckbox:R,hideVariantCheckbox:L,hideProductVariants:B,pickerType:w,onProductDetailClick:M,showProductDetailInfoIcon:U},t))):G?e.jsx(v.ProductPickerShimmer,{limit:10}):e.jsx(p.EmptyState,{title:"No products to show",subtitle:W.length?"We couldn't find the product you were looking for":"We couldn’t find any product in this collection."})}))]})};
@@ -36,3 +36,4 @@ export declare const markVariantsAsApprovedProductsLevel: (products: {
36
36
  export declare const shouldShowVariant: (data: Product) => boolean;
37
37
  export declare const isProductPartiallyChecked: (collectionId: string, productId: string, selectedData: SelectedItems, currentCollection: Collection, hideProductVariants?: boolean) => boolean;
38
38
  export declare const isCollectionPartiallyChecked: (collectionId: string, collection: Collection, selectedCollections: SelectedItems, hideProductVariants?: boolean) => boolean;
39
+ export declare const addIdToProductsAndVariants: (productData: any) => {};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("lodash");function t(o,t,l){if(!o)return{};const i=Object.keys(o).slice(l,l+t),n={};return i.forEach((t=>{n[t]=o[t]})),n}const l=(o,t,l)=>{Object.keys(o).forEach((t=>{var l,i;const n=null!==(i=null===(l=o[t])||void 0===l?void 0:l.products)&&void 0!==i?i:{};Object.keys(n).forEach((l=>{var i,n,d,v;const s=null!==(v=null===(d=null===(n=null===(i=o[t])||void 0===i?void 0:i.products)||void 0===n?void 0:n[l])||void 0===d?void 0:d.variants)&&void 0!==v?v:{};Object.keys(s).forEach((i=>{var n,d,v,s;const e=null===(s=null===(v=null===(d=null===(n=o[t])||void 0===n?void 0:n.products)||void 0===d?void 0:d[l])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[i];e&&!e.fbStatus&&(e.fbStatus="APPROVED")}))}))})),t({type:l,data:o})};exports.fetchFbStatusCollection=function(o,t,i,n){let d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"paged";n||l(o,i,d);const v=(o=>{const t=[];return Object.keys(o).forEach((l=>{var i,n;const d=null!==(n=null===(i=o[l])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(d).forEach((i=>{var n,d,v,s;const e=null!==(s=null===(v=null===(d=null===(n=o[l])||void 0===n?void 0:n.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(e).forEach((n=>{var d,v,s,e;const u=null===(e=null===(s=null===(v=null===(d=o[l])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===e?void 0:e[n];(null==u?void 0:u.fbStatus)||t.push(n)}))}))})),t})(o);v.length>0&&n&&n(t,v).then((t=>{const l=Object.assign({},o);Object.keys(l).forEach((o=>{var i,n;const d=null!==(n=null===(i=l[o])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(d).forEach((i=>{var n,d,v,s;const e=null!==(s=null===(v=null===(d=null===(n=l[o])||void 0===n?void 0:n.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(e).forEach((n=>{var d,v,s,e;const u=null===(e=null===(s=null===(v=null===(d=l[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===e?void 0:e[n];u&&"REJECTED"===t[n]?u.fbStatus="REJECTED":u&&"APPROVED"===t[n]&&(u.fbStatus="APPROVED")}))}))})),i({type:d,data:l})})).catch((t=>{console.error("Error in fbStatusFetcher",t),l(o,i,d)}))},exports.getVariantIdsToFetchAtProductLevel=(o,t)=>{const l=[];return Object.keys(null!=o?o:{}).forEach((i=>{var n,d;const v=null!==(d=null===(n=null==o?void 0:o[i])||void 0===n?void 0:n.variants)&&void 0!==d?d:{};Object.keys(v).forEach((n=>{var d,v,s,e,u;let r;r=t?null===(s=null===(v=null===(d=null==t?void 0:t.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[n]:null===(u=null===(e=null==o?void 0:o[i])||void 0===e?void 0:e.variants)||void 0===u?void 0:u[n],(null==r?void 0:r.fbStatus)||l.push(n)}))})),l},exports.isCollectionPartiallyChecked=function(o,t,l){var i,n,d,v;let s=0,e=0;if(arguments.length>3&&void 0!==arguments[3]&&arguments[3]){const v=null!==(i=null==t?void 0:t.products)&&void 0!==i?i:{};s=Object.keys(v).length;const u=null!==(d=null===(n=l[o])||void 0===n?void 0:n.products)&&void 0!==d?d:{};e=Object.keys(u).length}else if(l[o]){const i=null==t?void 0:t.products;i&&Object.keys(i).forEach((o=>{var t;const l=null===(t=i[o])||void 0===t?void 0:t.variants;l&&Object.keys(l).forEach((o=>s+=1))}));const n=null===(v=l[o])||void 0===v?void 0:v.products;if(n&&Object.keys(n).forEach((o=>{var t;const l=null===(t=n[o])||void 0===t?void 0:t.variants;l&&Object.keys(l).forEach((o=>e+=1))})),s<=0&&e>0)return!1}return e>0&&s!==e},exports.isProductPartiallyChecked=(o,t,l,i,n)=>{var d,v,s,e,u,r,c,a,p,f,b,O,h,y,j,E,k,g,P;let S=0,D=0;if(null===(v=null===(d=null==l?void 0:l[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[t]){if(n)return!1;const d=(null===(u=null===(e=null===(s=null==l?void 0:l[o])||void 0===s?void 0:s.products)||void 0===e?void 0:e[t])||void 0===u?void 0:u.variants)||[];if(1===Object.keys(d).length)for(const i in d){const n=null===(c=null===(r=null==l?void 0:l[o])||void 0===r?void 0:r.products)||void 0===c?void 0:c[t],d=null===(b=null===(f=null===(p=null===(a=null==l?void 0:l[o])||void 0===a?void 0:a.products)||void 0===p?void 0:p[t])||void 0===f?void 0:f.variants)||void 0===b?void 0:b[i];if(null===(O=null==d?void 0:d.name)||void 0===O?void 0:O.includes(null!==(h=null==n?void 0:n.name)&&void 0!==h?h:""))return!1}if(null===(E=Object.keys((null===(j=null===(y=null==i?void 0:i.products)||void 0===y?void 0:y[t])||void 0===j?void 0:j.variants)||[]))||void 0===E||E.forEach((()=>D++)),Object.keys((null===(P=null===(g=null===(k=null==l?void 0:l[o])||void 0===k?void 0:k.products)||void 0===g?void 0:g[t])||void 0===P?void 0:P.variants)||[]).forEach((()=>S++)),S>0&&D!==S)return!0}return!1},exports.liftTheStateUp=(t,l)=>{const i=o.cloneDeep(l);if(delete i.products,(t=Object.assign(Object.assign({},t),{catalogOnlyData:i})).productId&&l.products){const n=o.cloneDeep(l.products[t.productId]);(null==n?void 0:n.variants)&&delete n.variants,t=Object.assign(Object.assign({},t),{catalogOnlyData:i,productOnlyData:n})}return t},exports.markVariantsAsApprovedProductsLevel=(o,t,l,i,n)=>{const d=Object.assign({},o);if(Object.keys(o).forEach((t=>{var l,i;Object.keys(null!==(i=null===(l=null==o?void 0:o[t])||void 0===l?void 0:l.variants)&&void 0!==i?i:{}).forEach((l=>{var i,n;const v=null===(i=null==o?void 0:o[t].variants)||void 0===i?void 0:i[l];v&&(v.fbStatus="APPROVED");const s=null===(n=null==d?void 0:d[t])||void 0===n?void 0:n.variants;s&&s[l]&&(s[l]=v)}))})),i&&n){const o=Object.assign({},i);o.products=d,n(o),t({type:"productsPaged",data:{collectionId:l,products:d}})}else t({type:"productsPaged",data:{collectionId:l,products:d}})},exports.paginateSelectedItems=function(o,l,i){var n;const d={};let v=0;for(const s in o)if(Object.prototype.hasOwnProperty.call(o,s)){const e=o[s],u=t(e.products,l,i-v);u&&Object.keys(u).length>0&&(d[s]=Object.assign(Object.assign({},e),{products:u})),v+=Object.keys(null!==(n=e.products)&&void 0!==n?n:{}).length}return d},exports.shouldShowVariant=o=>{const t=Object.keys(o.variants||[]);let l=!1;return!(t.length<=1)||(t.forEach((t=>{var i,n;l=null!==(n=null===(i=o.variants)||void 0===i?void 0:i[t].name.includes(o.name))&&void 0!==n&&n})),!l)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("lodash");function t(o,t,l){if(!o)return{};const i=Object.keys(o).slice(l,l+t),n={};return i.forEach((t=>{n[t]=o[t]})),n}const l=(o,t,l)=>{Object.keys(o).forEach((t=>{var l,i;const n=null!==(i=null===(l=o[t])||void 0===l?void 0:l.products)&&void 0!==i?i:{};Object.keys(n).forEach((l=>{var i,n,d,s;const v=null!==(s=null===(d=null===(n=null===(i=o[t])||void 0===i?void 0:i.products)||void 0===n?void 0:n[l])||void 0===d?void 0:d.variants)&&void 0!==s?s:{};Object.keys(v).forEach((i=>{var n,d,s,v;const e=null===(v=null===(s=null===(d=null===(n=o[t])||void 0===n?void 0:n.products)||void 0===d?void 0:d[l])||void 0===s?void 0:s.variants)||void 0===v?void 0:v[i];e&&!e.fbStatus&&(e.fbStatus="APPROVED")}))}))})),t({type:l,data:o})};exports.addIdToProductsAndVariants=o=>{const t={};return Object.keys(o).length?(Object.keys(o).map((l=>{var i,n;const d=null===(i=o[l])||void 0===i?void 0:i.variants,s={};Object.keys(d).length&&Object.keys(null===(n=o[l])||void 0===n?void 0:n.variants).map((o=>{s[o]=Object.assign(Object.assign({},d[o]),{id:o})})),t[l]=Object.assign(Object.assign({},o[l]),{variants:s,id:l})})),t):{}},exports.fetchFbStatusCollection=function(o,t,i,n){let d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"paged";n||l(o,i,d);const s=(o=>{const t=[];return Object.keys(o).forEach((l=>{var i,n;const d=null!==(n=null===(i=o[l])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(d).forEach((i=>{var n,d,s,v;const e=null!==(v=null===(s=null===(d=null===(n=o[l])||void 0===n?void 0:n.products)||void 0===d?void 0:d[i])||void 0===s?void 0:s.variants)&&void 0!==v?v:{};Object.keys(e).forEach((n=>{var d,s,v,e;const c=null===(e=null===(v=null===(s=null===(d=o[l])||void 0===d?void 0:d.products)||void 0===s?void 0:s[i])||void 0===v?void 0:v.variants)||void 0===e?void 0:e[n];(null==c?void 0:c.fbStatus)||t.push(n)}))}))})),t})(o);s.length>0&&n&&n(t,s).then((t=>{const l=Object.assign({},o);Object.keys(l).forEach((o=>{var i,n;const d=null!==(n=null===(i=l[o])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(d).forEach((i=>{var n,d,s,v;const e=null!==(v=null===(s=null===(d=null===(n=l[o])||void 0===n?void 0:n.products)||void 0===d?void 0:d[i])||void 0===s?void 0:s.variants)&&void 0!==v?v:{};Object.keys(e).forEach((n=>{var d,s,v,e;const c=null===(e=null===(v=null===(s=null===(d=l[o])||void 0===d?void 0:d.products)||void 0===s?void 0:s[i])||void 0===v?void 0:v.variants)||void 0===e?void 0:e[n];c&&"REJECTED"===t[n]?c.fbStatus="REJECTED":c&&"APPROVED"===t[n]&&(c.fbStatus="APPROVED")}))}))})),i({type:d,data:l})})).catch((t=>{console.error("Error in fbStatusFetcher",t),l(o,i,d)}))},exports.getVariantIdsToFetchAtProductLevel=(o,t)=>{const l=[];return Object.keys(null!=o?o:{}).forEach((i=>{var n,d;const s=null!==(d=null===(n=null==o?void 0:o[i])||void 0===n?void 0:n.variants)&&void 0!==d?d:{};Object.keys(s).forEach((n=>{var d,s,v,e,c;let r;r=t?Object.assign(Object.assign({},null===(v=null===(s=null===(d=null==t?void 0:t.products)||void 0===d?void 0:d[i])||void 0===s?void 0:s.variants)||void 0===v?void 0:v[n]),{id:n}):Object.assign(Object.assign({},null===(c=null===(e=null==o?void 0:o[i])||void 0===e?void 0:e.variants)||void 0===c?void 0:c[n]),{id:n}),(null==r?void 0:r.fbStatus)||l.push(n)}))})),l},exports.isCollectionPartiallyChecked=function(o,t,l){var i,n,d,s;let v=0,e=0;if(arguments.length>3&&void 0!==arguments[3]&&arguments[3]){const s=null!==(i=null==t?void 0:t.products)&&void 0!==i?i:{};v=Object.keys(s).length;const c=null!==(d=null===(n=l[o])||void 0===n?void 0:n.products)&&void 0!==d?d:{};e=Object.keys(c).length}else if(l[o]){const i=null==t?void 0:t.products;i&&Object.keys(i).forEach((o=>{var t;const l=null===(t=i[o])||void 0===t?void 0:t.variants;l&&Object.keys(l).forEach((o=>v+=1))}));const n=null===(s=l[o])||void 0===s?void 0:s.products;if(n&&Object.keys(n).forEach((o=>{var t;const l=null===(t=n[o])||void 0===t?void 0:t.variants;l&&Object.keys(l).forEach((o=>e+=1))})),v<=0&&e>0)return!1}return e>0&&v!==e},exports.isProductPartiallyChecked=(o,t,l,i,n)=>{var d,s,v,e,c,r,a,u,p,b,O,f,j,h,y,g,k,E,P;let S=0,D=0;if(null===(s=null===(d=null==l?void 0:l[o])||void 0===d?void 0:d.products)||void 0===s?void 0:s[t]){if(n)return!1;const d=(null===(c=null===(e=null===(v=null==l?void 0:l[o])||void 0===v?void 0:v.products)||void 0===e?void 0:e[t])||void 0===c?void 0:c.variants)||[];if(1===Object.keys(d).length)for(const i in d){const n=null===(a=null===(r=null==l?void 0:l[o])||void 0===r?void 0:r.products)||void 0===a?void 0:a[t],d=null===(O=null===(b=null===(p=null===(u=null==l?void 0:l[o])||void 0===u?void 0:u.products)||void 0===p?void 0:p[t])||void 0===b?void 0:b.variants)||void 0===O?void 0:O[i];if(null===(f=null==d?void 0:d.name)||void 0===f?void 0:f.includes(null!==(j=null==n?void 0:n.name)&&void 0!==j?j:""))return!1}if(null===(g=Object.keys((null===(y=null===(h=null==i?void 0:i.products)||void 0===h?void 0:h[t])||void 0===y?void 0:y.variants)||[]))||void 0===g||g.forEach((()=>D++)),Object.keys((null===(P=null===(E=null===(k=null==l?void 0:l[o])||void 0===k?void 0:k.products)||void 0===E?void 0:E[t])||void 0===P?void 0:P.variants)||[]).forEach((()=>S++)),S>0&&D!==S)return!0}return!1},exports.liftTheStateUp=(t,l)=>{const i=o.cloneDeep(l);if(delete i.products,(t=Object.assign(Object.assign({},t),{catalogOnlyData:i})).productId&&l.products){const n=o.cloneDeep(l.products[t.productId]);(null==n?void 0:n.variants)&&delete n.variants,t=Object.assign(Object.assign({},t),{catalogOnlyData:i,productOnlyData:n})}return t},exports.markVariantsAsApprovedProductsLevel=(o,t,l,i,n)=>{const d=Object.assign({},o);if(Object.keys(o).forEach((t=>{var l,i;Object.keys(null!==(i=null===(l=null==o?void 0:o[t])||void 0===l?void 0:l.variants)&&void 0!==i?i:{}).forEach((l=>{var i,n;const s=null===(i=null==o?void 0:o[t].variants)||void 0===i?void 0:i[l];s&&(s.fbStatus="APPROVED");const v=null===(n=null==d?void 0:d[t])||void 0===n?void 0:n.variants;v&&v[l]&&(v[l]=s)}))})),i&&n){const o=Object.assign({},i);o.products=d,n(o),t({type:"productsPaged",data:{collectionId:l,products:d}})}else t({type:"productsPaged",data:{collectionId:l,products:d}})},exports.paginateSelectedItems=function(o,l,i){var n;const d={};let s=0;for(const v in o)if(Object.prototype.hasOwnProperty.call(o,v)){const e=o[v],c=t(e.products,l,i-s);c&&Object.keys(c).length>0&&(d[v]=Object.assign(Object.assign({},e),{products:c})),s+=Object.keys(null!==(n=e.products)&&void 0!==n?n:{}).length}return d},exports.shouldShowVariant=o=>{const t=Object.keys(o.variants||[]);let l=!1;return!(t.length<=1)||(t.forEach((t=>{var i,n;l=null!==(n=null===(i=o.variants)||void 0===i?void 0:i[t].name.includes(o.name))&&void 0!==n&&n})),!l)};
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default EventsTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default IGTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption } from "../../../dropdown/type";
3
- import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
4
- import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
3
+ import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
4
+ import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
5
5
  declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
6
6
  cacheKey: string;
7
7
  propertyAddBtnText: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -9,6 +9,7 @@ export interface ProductVariant {
9
9
  displayOrder?: number | null;
10
10
  fbStatus?: FbProductStatus;
11
11
  description?: string;
12
+ id?: string;
12
13
  }
13
14
  export interface Product {
14
15
  name: string;
@@ -17,6 +18,7 @@ export interface Product {
17
18
  variants?: {
18
19
  [key: string]: ProductVariant;
19
20
  };
21
+ id?: string;
20
22
  }
21
23
  export interface Collection {
22
24
  name: string;
@@ -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 d from"../../assets/icons/cross.svg.js";import{Button as a}from"../button/Button.js";import{Input as u}from"../input/Input.js";import{StyledModal as h}from"../modals/styledModal.js";import{Spinner as p}from"../spinner/Spinner.js";import{Tag as m}from"../tag/Tag.js";import{CollectionsScreen as C}from"./collectionScreen.js";import{ProductInfoOverlay as g}from"./productInfoOverlay.js";import{ProductsScreen as f}from"./productScreen.js";import{RearrangeScreen as y}from"./rearrangeScreen.js";import{collectionsReducer as b,searchReducer as S,selectedColectionsReducer as v,CollectionIdContext as k}from"./reducers.js";import{SearchScreen as j}from"./searchScreen.js";import{SelectedScreen as P}from"./selectedScreen.js";import{ContainerStyle as x,ScrollContainerStyle as I}from"./style.js";import{OUT_OF_STOCK_ACTION as F}from"./type.js";var O;!function(e){e.Collections="collections",e.RearrangeProducts="rearrange",e.SelectedProducts="view",e.SearchProducts="searchProducts",e.Products="products"}(O||(O={}));const T=T=>{const{storeId:D,selectedItems:R,onClose:w,visible:E,zIndex:A,exactLimit:V,limit:$,hideCollectionCheckbox:B,hideProductCheckbox:L,outOfStockAction:M=F.BLUR,hideVariantCheckbox:z,selectProductsFromCustomCollection:H,hideSelectionCount:W,title:G,width:Y,left:K,renderWithoutModal:N,onClickSave:U,pickerType:q,hideProductVariants:J=!1,startupScreen:Q=O.Collections,rearrangeEnabled:X,selectSingleItem:Z=!1,showProductDetails:_,containerStyle:ee,crossButtonInsideHeader:te=!1}=T,[oe,ce]=r(b,{}),[re,se]=s([O.Collections,O.RearrangeProducts].includes(Q)?Q:O.Collections),[ie,le]=s("grid"),[ne,de]=s(""),[ae,ue]=s(""),[he,pe]=s(0),[me,Ce]=s(!1),[ge,fe]=s(0),[ye,be]=s(""),[Se,ve]=s(!1),[ke,je]=s(!1),[Pe,xe]=r(S,{collections:{},products:{}}),[Ie,Fe]=r(v,Object.keys(R).length>0?R:{}),Oe=i(null),[Te,De]=s(!1),[Re,we]=s();l((()=>{Ce(!0),je(!0),T.collectionFetcher(he,D).then((e=>{ce({type:"fetched",data:(null==e?void 0:e.collections)||{}}),Ce(!1),pe((e=>e+1)),je(!1)})).catch()}),[]),l((()=>{let e=0;J?Object.keys(Ie||[]).forEach((t=>{var o;Object.keys((null===(o=Ie[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c;"-1"!==t&&Ie[-1]&&(null===(c=Ie[-1].products)||void 0===c?void 0:c[o])||(e+=1)}))})):Object.keys(Ie||[]).forEach((t=>{var o;Object.keys((null===(o=Ie[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=Ie[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),fe(e)}),[oe,Ie,J]),l((()=>{ae&&(Ce(!0),T.productFetcher(ae,D).then((e=>{Object.keys(e).length&&ce({type:"productsFetched",data:{collectionId:ae,products:e}}),Ce(!1)})).catch())}),[ae]),l((()=>{const e=setTimeout((()=>{"rearrange"!==re&&(ye.length||"collections"!==re)&&(ye.length?(ve(!0),T.searchFetcher(D,ye).then((e=>{"collections"in e&&"products"in e?(xe({type:"set",data:e}),ce({type:"searched",data:e.collections})):(xe({type:"set",data:{collections:{},products:e}}),ce({type:"searched",data:e})),se("searchProducts"),Ce(!1),ve(!1)}))):se("collections"))}),800);return()=>clearTimeout(e)}),[ye]),l((()=>{U&&(T.onAdd(Ie,ge),Ee())}),[U]),l((()=>{Z&&Object.keys(Ie||{}).length&&ge&&(T.onAdd(Ie,ge),Ee())}),[Z,Ie,ge]);const Ee=()=>{Fe({type:"reset",data:{}})},Ae=e(x,Object.assign({style:null!=ee?ee:{}},{children:[T.postHeader&&t("div",Object.assign({style:{padding:"0 24px"}},{children:T.postHeader})),!T.hideGlobalSearch&&t(o,{children:("collections"===re||"searchProducts"===re)&&t("div",Object.assign({style:{padding:N?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:t(u,{placeholder:"Search Collections or Products",noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>Se?t(p,{size:"small",color:n.content.primary}):t(c,{})},id:"listInput",height:"24px",type:"text",value:ye,onChangeText:e=>{e.length&&e.trim().length?be(e):be("")}})}))}),e(I,Object.assign({ref:Oe,screenName:re},{children:["collections"===re&&t(C,{customCollectionRestriction:T.customCollectionRestriction,dataLoading:ke,collections:oe,selectedCollectionsDispatch:Fe,setCollectionId:de,setSelectedCollectionId:ue,setScreen:se,selectedCollections:Ie,collectionFetcher:T.collectionFetcher,storeId:D,collectionsDispatch:ce,setSaveDisabled:Ce,pagingControls:{curPage:he,setCurPage:pe},hideCollectionCheckbox:B,renderWithoutModal:N,pickerType:q,scrollContainerRef:Oe}),"products"===re&&ne&&t(k.Provider,Object.assign({value:ne},{children:t(f,{hideInCollectionSearch:T.hideInCollectionSearch,customCollectionRestriction:T.customCollectionRestriction,productFetcher:T.productFetcher,setScreen:se,storeId:D,data:oe[ne],collectionsDispatch:ce,selectedCollectionsDispatch:Fe,selectedData:Ie,setSaveDisabled:Ce,searchInCollectionFetcher:T.searchInCollectionFetcher,hideProductCheckbox:L,outOfStockAction:M,hideVariantCheckbox:z,selectProductsFromCustomCollection:H,renderWithoutModal:N,pickerType:q,hideProductVariants:J,fbStatusFetcher:T.fbStatusFetcher,onProductDetailClick:e=>{De(!0),we(e)},showProductDetailInfoIcon:_,scrollContainerRef:Oe})})),"view"===re&&t(P,{selectedCollections:Ie||{},selectedCollectionsDispatch:Fe,setScreen:se,collections:oe,hideProductVariants:J,outOfStockAction:M,storeId:D,fbStatusFetcher:T.fbStatusFetcher}),"rearrange"===re&&t(y,{selectedCollections:Ie||{},selectedCollectionsDispatch:Fe,setScreen:se,outOfStockAction:M,rearrangeViewType:"grid"===ie?"list":"grid",scrollContainerRef:Oe,storeId:D,fbStatusFetcher:T.fbStatusFetcher}),"searchProducts"===re&&t(j,{customCollectionRestriction:T.customCollectionRestriction,selectedCollections:Ie||{},searchedCollections:Pe||{},searchedCollectionsDispatch:xe,selectedCollectionsDispatch:Fe,setScreen:se,collections:oe,onBackPress:()=>{be(""),xe({type:"set",data:{collections:{},products:{}}})},pickerType:q,hideProductCheckbox:L,hideProductVariants:J,hideVariantCheckbox:z,storeId:D,fbStatusFetcher:T.fbStatusFetcher,setCollectionId:de,setSelectedCollectionId:ue,renderWithoutModal:N,hideCollectionCheckbox:B,outOfStockAction:M})]}))]}));return t(o,{children:N?Ae:e(h,Object.assign({zIndex:A,open:E,onClose:()=>{null==w||w(),Ee()},headingTitle:G||("collections"===re||"products"===re?"Select Products":"view"===re?"Selected Products":"searchProducts"===re?"Searched Results":"rearrange"===re?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:Y||"600px",left:K||"auto"},headerRightCustomElement:te?t("div",Object.assign({style:{cursor:"pointer",display:"flex"},onClick:w},{children:t(d,{width:20,height:20,color:n.content.secondary})})):t(o,{}),footerContainerStyle:T.stickyFooter?{position:"absolute",bottom:0,left:0,width:"100%",zIndex:9,background:n.surface.standard}:void 0,primaryButton:{buttonText:me?"Loading...":re===O.RearrangeProducts?"Done":"Add",disabled:me||ge<1||V&&ge<V||!V&&$&&ge>$||!1,onClick:()=>{T.onAdd(Ie,ge),Ee()}},wrapperStyle:T.stickyFooter?{height:"calc(100vh - 168px)"}:void 0,footerLeftCustomElement:W?t(o,{}):V&&ge>V?t(m,{tagText:`You can only select ${V} products`,type:"negative"}):$&&ge>$?t(m,{tagText:`You can only select ${$} products`,type:"negative"}):t(a,ge>0?{onClick:()=>{se(X?O.RearrangeProducts:O.SelectedProducts)},buttonText:V?`${ge}/${V} products selected`:`${ge} products selected`,buttonType:["rearrange","view"].includes(re)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(re)}:{disabled:!0,buttonText:V?`${ge}/${V} products selected`:`${ge} products selected`,buttonType:"tertiaryGray"}),hideCrossButton:Te||te},{children:[Ae,Te&&Re?t(g,{productData:Re,outOfStockAction:M,onClose:()=>{De(!1)}}):t(o,{})]}))})};export{T as ProductPickerModal,O 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 d from"../../assets/icons/cross.svg.js";import{Button as a}from"../button/Button.js";import{Input as u}from"../input/Input.js";import{StyledModal as h}from"../modals/styledModal.js";import{Spinner as p}from"../spinner/Spinner.js";import{Tag as m}from"../tag/Tag.js";import{CollectionsScreen as C}from"./collectionScreen.js";import{ProductInfoOverlay as f}from"./productInfoOverlay.js";import{ProductsScreen as g}from"./productScreen.js";import{RearrangeScreen as y}from"./rearrangeScreen.js";import{collectionsReducer as b,searchReducer as S,selectedColectionsReducer as v,CollectionIdContext as k}from"./reducers.js";import{SearchScreen as j}from"./searchScreen.js";import{SelectedScreen as x}from"./selectedScreen.js";import{ContainerStyle as P,ScrollContainerStyle as I}from"./style.js";import{OUT_OF_STOCK_ACTION as F}from"./type.js";import{addIdToProductsAndVariants as O}from"./utility.js";var D;!function(e){e.Collections="collections",e.RearrangeProducts="rearrange",e.SelectedProducts="view",e.SearchProducts="searchProducts",e.Products="products"}(D||(D={}));const T=T=>{const{storeId:R,selectedItems:w,onClose:E,visible:A,zIndex:V,exactLimit:$,limit:B,hideCollectionCheckbox:L,hideProductCheckbox:M,outOfStockAction:z=F.BLUR,hideVariantCheckbox:H,selectProductsFromCustomCollection:W,hideSelectionCount:G,title:Y,width:K,left:N,renderWithoutModal:U,onClickSave:q,pickerType:J,hideProductVariants:Q=!1,startupScreen:X=D.Collections,rearrangeEnabled:Z,selectSingleItem:_=!1,showProductDetails:ee,containerStyle:te,crossButtonInsideHeader:oe=!1}=T,[ce,re]=r(b,{}),[se,ie]=s([D.Collections,D.RearrangeProducts].includes(X)?X:D.Collections),[le,ne]=s("grid"),[de,ae]=s(""),[ue,he]=s(""),[pe,me]=s(0),[Ce,fe]=s(!1),[ge,ye]=s(0),[be,Se]=s(""),[ve,ke]=s(!1),[je,xe]=s(!1),[Pe,Ie]=r(S,{collections:{},products:{}}),[Fe,Oe]=r(v,Object.keys(w).length>0?w:{}),De=i(null),[Te,Re]=s(!1),[we,Ee]=s();l((()=>{fe(!0),xe(!0),T.collectionFetcher(pe,R).then((e=>{re({type:"fetched",data:(null==e?void 0:e.collections)||{}}),fe(!1),me((e=>e+1)),xe(!1)})).catch()}),[]),l((()=>{let e=0;Q?Object.keys(Fe||[]).forEach((t=>{var o;Object.keys((null===(o=Fe[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c;"-1"!==t&&Fe[-1]&&(null===(c=Fe[-1].products)||void 0===c?void 0:c[o])||(e+=1)}))})):Object.keys(Fe||[]).forEach((t=>{var o;Object.keys((null===(o=Fe[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=Fe[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),ye(e)}),[ce,Fe,Q]),l((()=>{ue&&(fe(!0),T.productFetcher(ue,R).then((e=>{const t=O(e);Object.keys(e).length&&re({type:"productsFetched",data:{collectionId:ue,products:t}}),fe(!1)})).catch())}),[ue]),l((()=>{const e=setTimeout((()=>{"rearrange"!==se&&(be.length||"collections"!==se)&&(be.length?(ke(!0),T.searchFetcher(R,be).then((e=>{"collections"in e&&"products"in e?(Ie({type:"set",data:e}),re({type:"searched",data:e.collections})):(Ie({type:"set",data:{collections:{},products:e}}),re({type:"searched",data:e})),ie("searchProducts"),fe(!1),ke(!1)}))):ie("collections"))}),800);return()=>clearTimeout(e)}),[be]),l((()=>{q&&(T.onAdd(Fe,ge),Ae())}),[q]),l((()=>{_&&Object.keys(Fe||{}).length&&ge&&(T.onAdd(Fe,ge),Ae())}),[_,Fe,ge]);const Ae=()=>{Oe({type:"reset",data:{}})},Ve=e(P,Object.assign({style:null!=te?te:{}},{children:[T.postHeader&&t("div",Object.assign({style:{padding:"0 24px"}},{children:T.postHeader})),!T.hideGlobalSearch&&t(o,{children:("collections"===se||"searchProducts"===se)&&t("div",Object.assign({style:{padding:U?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:t(u,{placeholder:"Search for collections and products, or type a product ID",noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>ve?t(p,{size:"small",color:n.content.primary}):t(c,{})},id:"listInput",height:"24px",type:"text",value:be,onChangeText:e=>{e.length&&e.trim().length?Se(e):Se("")}})}))}),e(I,Object.assign({ref:De,screenName:se},{children:["collections"===se&&t(C,{customCollectionRestriction:T.customCollectionRestriction,dataLoading:je,collections:ce,selectedCollectionsDispatch:Oe,setCollectionId:ae,setSelectedCollectionId:he,setScreen:ie,selectedCollections:Fe,collectionFetcher:T.collectionFetcher,storeId:R,collectionsDispatch:re,setSaveDisabled:fe,pagingControls:{curPage:pe,setCurPage:me},hideCollectionCheckbox:L,renderWithoutModal:U,pickerType:J,scrollContainerRef:De}),"products"===se&&de&&t(k.Provider,Object.assign({value:de},{children:t(g,{hideInCollectionSearch:T.hideInCollectionSearch,customCollectionRestriction:T.customCollectionRestriction,productFetcher:T.productFetcher,setScreen:ie,storeId:R,data:ce[de],collectionsDispatch:re,selectedCollectionsDispatch:Oe,selectedData:Fe,setSaveDisabled:fe,searchInCollectionFetcher:T.searchInCollectionFetcher,hideProductCheckbox:M,outOfStockAction:z,hideVariantCheckbox:H,selectProductsFromCustomCollection:W,renderWithoutModal:U,pickerType:J,hideProductVariants:Q,fbStatusFetcher:T.fbStatusFetcher,onProductDetailClick:e=>{Re(!0),Ee(e)},showProductDetailInfoIcon:ee,scrollContainerRef:De})})),"view"===se&&t(x,{selectedCollections:Fe||{},selectedCollectionsDispatch:Oe,setScreen:ie,collections:ce,hideProductVariants:Q,outOfStockAction:z,storeId:R,fbStatusFetcher:T.fbStatusFetcher}),"rearrange"===se&&t(y,{selectedCollections:Fe||{},selectedCollectionsDispatch:Oe,setScreen:ie,outOfStockAction:z,rearrangeViewType:"grid"===le?"list":"grid",scrollContainerRef:De,storeId:R,fbStatusFetcher:T.fbStatusFetcher}),"searchProducts"===se&&t(j,{customCollectionRestriction:T.customCollectionRestriction,selectedCollections:Fe||{},searchedCollections:Pe||{},searchedCollectionsDispatch:Ie,selectedCollectionsDispatch:Oe,setScreen:ie,collections:ce,onBackPress:()=>{Se(""),Ie({type:"set",data:{collections:{},products:{}}})},pickerType:J,hideProductCheckbox:M,hideProductVariants:Q,hideVariantCheckbox:H,storeId:R,fbStatusFetcher:T.fbStatusFetcher,setCollectionId:ae,setSelectedCollectionId:he,renderWithoutModal:U,hideCollectionCheckbox:L,outOfStockAction:z})]}))]}));return t(o,{children:U?Ve:e(h,Object.assign({zIndex:V,open:A,onClose:()=>{null==E||E(),Ae()},headingTitle:Y||("collections"===se||"products"===se?"Select Products":"view"===se?"Selected Products":"searchProducts"===se?"Searched Results":"rearrange"===se?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:K||"600px",left:N||"auto"},headerRightCustomElement:oe?t("div",Object.assign({style:{cursor:"pointer",display:"flex"},onClick:E},{children:t(d,{width:20,height:20,color:n.content.secondary})})):t(o,{}),footerContainerStyle:T.stickyFooter?{position:"absolute",bottom:0,left:0,width:"100%",zIndex:9,background:n.surface.standard}:void 0,primaryButton:{buttonText:Ce?"Loading...":se===D.RearrangeProducts?"Done":"Add",disabled:Ce||ge<1||$&&ge<$||!$&&B&&ge>B||!1,onClick:()=>{T.onAdd(Fe,ge),Ae()}},wrapperStyle:T.stickyFooter?{height:"calc(100vh - 168px)"}:void 0,footerLeftCustomElement:G?t(o,{}):$&&ge>$?t(m,{tagText:`You can only select ${$} products`,type:"negative"}):B&&ge>B?t(m,{tagText:`You can only select ${B} products`,type:"negative"}):t(a,ge>0?{onClick:()=>{ie(Z?D.RearrangeProducts:D.SelectedProducts)},buttonText:$?`${ge}/${$} products selected`:`${ge} products selected`,buttonType:["rearrange","view"].includes(se)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(se)}:{disabled:!0,buttonText:$?`${ge}/${$} products selected`:`${ge} products selected`,buttonType:"tertiaryGray"}),hideCrossButton:Te||oe},{children:[Ve,Te&&we?t(f,{productData:we,outOfStockAction:z,onClose:()=>{Re(!1)}}):t(o,{})]}))})};export{T as ProductPickerModal,D as ScreenName};
@@ -1,4 +1,4 @@
1
- import{jsxs as o,jsx as t}from"react/jsx-runtime";import i from"styled-components";import{COLORS as r}from"../../constants/Theme.js";import e from"../../assets/icons/cross.svg.js";import{IconButton as a}from"../icon-button/IconButton.js";import{ShimmerImage as d}from"../shimmer-image/ShimmerImage.js";import{TitleSmall as n,BodyCaption as s}from"../TypographyStyle.js";import{ProductPickerTag as c}from"./ProductPickerTag.js";const l=i=>o(m,{children:[t(u,{}),t(x,{children:t(a,{className:"close-button",onClick:i.onClose,Icon:e,width:20,height:20})}),t(p,{productData:i.productData,outOfStockAction:i.outOfStockAction})]}),p=i=>{var r;const e=void 0===i.productData.variants;return o(f,{children:[t(g,{children:t(d,{imageUrl:i.productData.image,width:"200px",height:200,borderRadius:4})}),o(h,{children:[t(n,Object.assign({style:{display:"flex"}},{children:i.productData.name})),t(s,{className:"overlay-description",dangerouslySetInnerHTML:{__html:null!==(r=i.productData.description)&&void 0!==r?r:""}}),t(c,{isVariant:e,data:i.productData,outOfStockAction:i.outOfStockAction})]})]})},m=i.div`
1
+ import{jsxs as o,jsx as t}from"react/jsx-runtime";import i from"styled-components";import{COLORS as r}from"../../constants/Theme.js";import e from"../../assets/icons/cross.svg.js";import{IconButton as a}from"../icon-button/IconButton.js";import{ShimmerImage as d}from"../shimmer-image/ShimmerImage.js";import{TitleRegular as n,BodyCaption as c}from"../TypographyStyle.js";import{ProductPickerTag as s}from"./ProductPickerTag.js";const l=i=>o(m,{children:[t(u,{}),t(x,{children:t(a,{className:"close-button",onClick:i.onClose,Icon:e,width:20,height:20})}),t(p,{productData:i.productData,outOfStockAction:i.outOfStockAction})]}),p=i=>{var e;const a=void 0===i.productData.variants;return o(f,{children:[t(g,{children:t(d,{imageUrl:i.productData.image,width:"200px",height:200,borderRadius:4})}),o(h,{children:[t(n,Object.assign({style:{display:"flex"}},{children:i.productData.name})),t(c,Object.assign({color:r.content.secondary},{children:`Product ID: ${i.productData.id}`})),t(c,{className:"overlay-description",dangerouslySetInnerHTML:{__html:null!==(e=i.productData.description)&&void 0!==e?e:""}}),t(s,{isVariant:a,data:i.productData,outOfStockAction:i.outOfStockAction})]})]})},m=i.div`
2
2
  display: flex;
3
3
  flex: 1;
4
4
  background: rgba(0, 0, 0, 0.5);
@@ -15,6 +15,7 @@ import{jsxs as o,jsx as t}from"react/jsx-runtime";import i from"styled-component
15
15
  max-height: 300px;
16
16
  overflow-y: auto;
17
17
  word-break: break-word;
18
+ margin-top: 8px;
18
19
  }
19
20
  `,u=i.div`
20
21
  display: flex;
@@ -43,5 +44,5 @@ import{jsxs as o,jsx as t}from"react/jsx-runtime";import i from"styled-component
43
44
  display: flex;
44
45
  flex: 1;
45
46
  flex-direction: column;
46
- gap: 10px;
47
+ gap: 4px;
47
48
  `;export{p as ProductInfoCard,l as ProductInfoOverlay};
@@ -1 +1 @@
1
- import{jsxs as t,jsx as e}from"react/jsx-runtime";import o from"../../assets/icons/arrow_left.svg.js";import c from"../../assets/icons/box.svg.js";import n from"../../assets/icons/search.svg.js";import{cloneDeep as r}from"lodash";import{useContext as i,useRef as s,useState as l,useEffect as d}from"react";import{COLORS as a}from"../../constants/Theme.js";import{CheckBox as u}from"../checkBox/CheckBox.js";import{IconButton as h}from"../icon-button/IconButton.js";import{InfiniteScroll as p}from"../InfiniteScroll/InfiniteScroll.js";import{Input as m}from"../input/Input.js";import{Spinner as g}from"../spinner/Spinner.js";import{BodyCaption as j,TitleRegular as f}from"../TypographyStyle.js";import{EmptyState as v}from"./emptyState.js";import{ProductGroup as b}from"./product.js";import{ProductPickerShimmer as y}from"./ProductPickerShimmer.js";import{CollectionIdContext as O}from"./reducers.js";import{ProductScreenHeader as k,ProductScreenCollectionCardStyle as C}from"./style.js";import{OUT_OF_STOCK_ACTION as P}from"./type.js";import{getVariantIdsToFetchAtProductLevel as I,markVariantsAsApprovedProductsLevel as D,isCollectionPartiallyChecked as S,isProductPartiallyChecked as x,liftTheStateUp as E}from"./utility.js";const R=R=>{var T,w;const{data:V,collectionsDispatch:A,selectedData:B,selectedCollectionsDispatch:F,productFetcher:J,storeId:M,setScreen:W,setSaveDisabled:z,hideInCollectionSearch:H,customCollectionRestriction:K,hideProductCheckbox:L,outOfStockAction:N=P.BLUR,hideVariantCheckbox:U=!1,selectProductsFromCustomCollection:_=!1,pickerType:q,hideProductVariants:G,fbStatusFetcher:Q,onProductDetailClick:X,showProductDetailInfoIcon:Y,scrollContainerRef:Z}=R,$=i(O),tt=s(0),et=s(!1),[ot,ct]=l(""),[nt,rt]=l(!1),[it,st]=l(V),lt=s(!0),dt=s(!1);d((()=>{if(lt.current)return void(lt.current=!1);const t=setTimeout((()=>{ot.length?(rt(!0),R.searchInCollectionFetcher(M,$,ot).then((t=>{const e=r(V);e.products=t,st(e);const o=I(null!=t?t:{});ut(o,null!=t?t:{},!0),z(!1),rt(!1)}))):st(V)}),800);return()=>clearTimeout(t)}),[ot]);d((()=>{var t,e,o,c;dt.current=!1,tt.current=Math.floor((null===(e=Object.keys(null!==(t=V.products)&&void 0!==t?t:{}))||void 0===e?void 0:e.length)/10);const n=I(null!==(o=V.products)&&void 0!==o?o:{});ut(n,null!==(c=V.products)&&void 0!==c?c:{})}),[$]);const at=!!K&&V.isSmartCollection;d((()=>{(null==V?void 0:V.products)||ht(10)}),[]);const ut=(t,e,o)=>{Q||(o?D(e,A,$,it,st):D(e,A,$)),t.length>0&&Q&&Q(M,t).then((t=>{const c=Object.assign({},e);Object.keys(e).forEach((o=>{var n,r;Object.keys(null!==(r=null===(n=null==e?void 0:e[o])||void 0===n?void 0:n.variants)&&void 0!==r?r:{}).forEach((n=>{var r,i;const s=null===(r=null==e?void 0:e[o].variants)||void 0===r?void 0:r[n];s&&"REJECTED"===t[n]?s.fbStatus="REJECTED":s&&"APPROVED"===t[n]&&(s.fbStatus="APPROVED");const l=null===(i=null==c?void 0:c[o])||void 0===i?void 0:i.variants;l&&l[n]&&(l[n]=s)}))})),o?(st((t=>{const e=Object.assign({},t);return e.products=c,e})),A({type:"productsPaged",data:{collectionId:$,products:c}})):A({type:"productsPaged",data:{collectionId:$,products:c}})})).catch((t=>{o?D(e,A,$,it,st):D(e,A,$)}))},ht=t=>{z(!0),rt(!0),J($,M,t,0).then((e=>{if(Object.keys(e).length||(dt.current=!0),Object.keys(e).length){st(Object.assign(Object.assign({},it),{products:e}));const t=I(e);ut(t,e),tt.current=1}t||F({type:"selected",data:{id:$,val:Object.assign(Object.assign({},V),{products:e})}}),z(!1),rt(!1)})).catch()},pt=(t,e)=>{const o=E(e,V);F({type:t,data:Object.assign(Object.assign({},o),{isRestricted:K})})},mt=!!(null==B?void 0:B[$])&&!!Object.keys(null!==(w=null===(T=null==B?void 0:B[$])||void 0===T?void 0:T.products)&&void 0!==w?w:{}).length;return t("div",{children:[t(k,{children:[e(h,{Icon:o,height:16,onClick:()=>{W("collections")}}),e(j,Object.assign({style:{color:a.content.secondary}},{children:V.name}))]}),!H&&e("div",Object.assign({style:{padding:16,height:"76px",borderBottom:"1px solid #E0E0E0"}},{children:e(m,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>nt&&ot.length?e(g,{size:"small",color:a.content.primary}):e(n,{})},id:"listInput",height:"24px",type:"text",value:ot,onChangeText:t=>{t.length&&t.trim().length?ct(t):ct("")},placeholder:"Search products in this collection..."})})),Object.keys((null==it?void 0:it.products)||[]).length>0&&!at&&!ot.length&&!L&&"-1"!==$&&t(C,{children:[e(u,{isChecked:mt,isPartiallyChecked:S($,it,B,G),onValueChange:function(t){t?ht():F({type:"unselected",data:{id:$}})}}),e("div",Object.assign({style:{width:40,height:40}},{children:e(c,{})})),e(f,{children:"All Products"})]}),e(p,Object.assign({hasData:!(Object.keys((null==it?void 0:it.products)||[]).length<10)&&!!Object.keys((null==it?void 0:it.products)||[]).length,fetchMore:()=>(et.current=!0,J($,M,10,tt.current).then((t=>{let e=!1;if(Object.keys(t).length||(e=!0),Object.keys(t).length){const e=it;e.products=Object.assign(Object.assign({},it.products),t),st(Object.assign({},e));const o=I(t);ut(o,t)}return z(!1),et.current=!1,tt.current+=1,e}))),containerRef:Z},{children:Object.keys((null==it?void 0:it.products)||[]).length?Object.keys(it.products||[]).map((t=>e(b,{outOfStockAction:N,collectionId:$,isProductPartiallyChecked:x($,t,B,it,G),productId:t,data:it.products[t],selectedData:B,selectedCollectionsDispatch:F,viewOnly:!_&&!!at,upliftAdditions:pt,hideProductCheckbox:L,hideVariantCheckbox:U,hideProductVariants:G,pickerType:q,onProductDetailClick:X,showProductDetailInfoIcon:Y},t))):nt?e(y,{limit:10}):e(v,{title:"No products to show",subtitle:ot.length?"We couldn't find the product you were looking for":"We couldn’t find any product in this collection."})}))]})};export{R as ProductsScreen};
1
+ import{jsxs as t,jsx as e}from"react/jsx-runtime";import o from"../../assets/icons/arrow_left.svg.js";import c from"../../assets/icons/box.svg.js";import n from"../../assets/icons/search.svg.js";import{cloneDeep as r}from"lodash";import{useContext as i,useRef as s,useState as l,useEffect as d}from"react";import{COLORS as a}from"../../constants/Theme.js";import{CheckBox as u}from"../checkBox/CheckBox.js";import{IconButton as h}from"../icon-button/IconButton.js";import{InfiniteScroll as p}from"../InfiniteScroll/InfiniteScroll.js";import{Input as m}from"../input/Input.js";import{Spinner as g}from"../spinner/Spinner.js";import{BodyCaption as j,TitleRegular as f}from"../TypographyStyle.js";import{EmptyState as v}from"./emptyState.js";import{ProductGroup as b}from"./product.js";import{ProductPickerShimmer as y}from"./ProductPickerShimmer.js";import{CollectionIdContext as O}from"./reducers.js";import{ProductScreenHeader as k,ProductScreenCollectionCardStyle as C}from"./style.js";import{OUT_OF_STOCK_ACTION as P}from"./type.js";import{getVariantIdsToFetchAtProductLevel as I,markVariantsAsApprovedProductsLevel as D,addIdToProductsAndVariants as S,isCollectionPartiallyChecked as x,isProductPartiallyChecked as E,liftTheStateUp as R}from"./utility.js";const T=T=>{var w,V;const{data:A,collectionsDispatch:B,selectedData:F,selectedCollectionsDispatch:J,productFetcher:M,storeId:W,setScreen:z,setSaveDisabled:H,hideInCollectionSearch:K,customCollectionRestriction:L,hideProductCheckbox:N,outOfStockAction:U=P.BLUR,hideVariantCheckbox:_=!1,selectProductsFromCustomCollection:q=!1,pickerType:G,hideProductVariants:Q,fbStatusFetcher:X,onProductDetailClick:Y,showProductDetailInfoIcon:Z,scrollContainerRef:$}=T,tt=i(O),et=s(0),ot=s(!1),[ct,nt]=l(""),[rt,it]=l(!1),[st,lt]=l(A),dt=s(!0),at=s(!1);d((()=>{if(dt.current)return void(dt.current=!1);const t=setTimeout((()=>{ct.length?(it(!0),T.searchInCollectionFetcher(W,tt,ct).then((t=>{const e=r(A);e.products=t,lt(e);const o=I(null!=t?t:{});ht(o,null!=t?t:{},!0),H(!1),it(!1)}))):lt(A)}),800);return()=>clearTimeout(t)}),[ct]);d((()=>{var t,e,o,c;at.current=!1,et.current=Math.floor((null===(e=Object.keys(null!==(t=A.products)&&void 0!==t?t:{}))||void 0===e?void 0:e.length)/10);const n=I(null!==(o=A.products)&&void 0!==o?o:{});ht(n,null!==(c=A.products)&&void 0!==c?c:{})}),[tt]);const ut=!!L&&A.isSmartCollection;d((()=>{(null==A?void 0:A.products)||pt(10)}),[]);const ht=(t,e,o)=>{X||(o?D(e,B,tt,st,lt):D(e,B,tt)),t.length>0&&X&&X(W,t).then((t=>{const c=Object.assign({},e);Object.keys(e).forEach((o=>{var n,r;Object.keys(null!==(r=null===(n=null==e?void 0:e[o])||void 0===n?void 0:n.variants)&&void 0!==r?r:{}).forEach((n=>{var r,i;const s=null===(r=null==e?void 0:e[o].variants)||void 0===r?void 0:r[n];s&&"REJECTED"===t[n]?s.fbStatus="REJECTED":s&&"APPROVED"===t[n]&&(s.fbStatus="APPROVED");const l=null===(i=null==c?void 0:c[o])||void 0===i?void 0:i.variants;l&&l[n]&&(l[n]=s)}))})),o?(lt((t=>{const e=Object.assign({},t);return e.products=c,e})),B({type:"productsPaged",data:{collectionId:tt,products:c}})):B({type:"productsPaged",data:{collectionId:tt,products:c}})})).catch((t=>{o?D(e,B,tt,st,lt):D(e,B,tt)}))},pt=t=>{H(!0),it(!0),M(tt,W,t,0).then((e=>{const o=S(e);if(Object.keys(e).length||(at.current=!0),Object.keys(e).length){lt(Object.assign(Object.assign({},st),{products:o}));const t=I(o);ht(t,o),et.current=1}t||J({type:"selected",data:{id:tt,val:Object.assign(Object.assign({},A),{products:o})}}),H(!1),it(!1)})).catch()},mt=(t,e)=>{const o=R(e,A);J({type:t,data:Object.assign(Object.assign({},o),{isRestricted:L})})},gt=!!(null==F?void 0:F[tt])&&!!Object.keys(null!==(V=null===(w=null==F?void 0:F[tt])||void 0===w?void 0:w.products)&&void 0!==V?V:{}).length;return t("div",{children:[t(k,{children:[e(h,{Icon:o,height:16,onClick:()=>{z("collections")}}),e(j,Object.assign({style:{color:a.content.secondary}},{children:A.name}))]}),!K&&e("div",Object.assign({style:{padding:16,height:"76px",borderBottom:"1px solid #E0E0E0"}},{children:e(m,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>rt&&ct.length?e(g,{size:"small",color:a.content.primary}):e(n,{})},id:"listInput",height:"24px",type:"text",value:ct,onChangeText:t=>{t.length&&t.trim().length?nt(t):nt("")},placeholder:"Search for a product or type a product ID"})})),Object.keys((null==st?void 0:st.products)||[]).length>0&&!ut&&!ct.length&&!N&&"-1"!==tt&&t(C,{children:[e(u,{isChecked:gt,isPartiallyChecked:x(tt,st,F,Q),onValueChange:function(t){t?pt():J({type:"unselected",data:{id:tt}})}}),e("div",Object.assign({style:{width:40,height:40}},{children:e(c,{})})),e(f,{children:"All Products"})]}),e(p,Object.assign({hasData:!(Object.keys((null==st?void 0:st.products)||[]).length<10)&&!!Object.keys((null==st?void 0:st.products)||[]).length,fetchMore:()=>(ot.current=!0,M(tt,W,10,et.current).then((t=>{let e=!1;if(Object.keys(t).length||(e=!0),Object.keys(t).length){const e=st;e.products=Object.assign(Object.assign({},st.products),t),lt(Object.assign({},e));const o=I(t);ht(o,t)}return H(!1),ot.current=!1,et.current+=1,e}))),containerRef:$},{children:Object.keys((null==st?void 0:st.products)||[]).length?Object.keys(st.products||[]).map((t=>e(b,{outOfStockAction:U,collectionId:tt,isProductPartiallyChecked:E(tt,t,F,st,Q),productId:t,data:st.products[t],selectedData:F,selectedCollectionsDispatch:J,viewOnly:!q&&!!ut,upliftAdditions:mt,hideProductCheckbox:N,hideVariantCheckbox:_,hideProductVariants:Q,pickerType:G,onProductDetailClick:Y,showProductDetailInfoIcon:Z},t))):rt?e(y,{limit:10}):e(v,{title:"No products to show",subtitle:ct.length?"We couldn't find the product you were looking for":"We couldn’t find any product in this collection."})}))]})};export{T as ProductsScreen};
@@ -36,3 +36,4 @@ export declare const markVariantsAsApprovedProductsLevel: (products: {
36
36
  export declare const shouldShowVariant: (data: Product) => boolean;
37
37
  export declare const isProductPartiallyChecked: (collectionId: string, productId: string, selectedData: SelectedItems, currentCollection: Collection, hideProductVariants?: boolean) => boolean;
38
38
  export declare const isCollectionPartiallyChecked: (collectionId: string, collection: Collection, selectedCollections: SelectedItems, hideProductVariants?: boolean) => boolean;
39
+ export declare const addIdToProductsAndVariants: (productData: any) => {};
@@ -1 +1 @@
1
- import{cloneDeep as o}from"lodash";const l=(l,n)=>{const i=o(n);if(delete i.products,(l=Object.assign(Object.assign({},l),{catalogOnlyData:i})).productId&&n.products){const t=o(n.products[l.productId]);(null==t?void 0:t.variants)&&delete t.variants,l=Object.assign(Object.assign({},l),{catalogOnlyData:i,productOnlyData:t})}return l};function n(o,l,n){var t;const d={};let v=0;for(const u in o)if(Object.prototype.hasOwnProperty.call(o,u)){const s=o[u],c=i(s.products,l,n-v);c&&Object.keys(c).length>0&&(d[u]=Object.assign(Object.assign({},s),{products:c})),v+=Object.keys(null!==(t=s.products)&&void 0!==t?t:{}).length}return d}function i(o,l,n){if(!o)return{};const i=Object.keys(o).slice(n,n+l),t={};return i.forEach((l=>{t[l]=o[l]})),t}const t=(o,l,n)=>{Object.keys(o).forEach((l=>{var n,i;const t=null!==(i=null===(n=o[l])||void 0===n?void 0:n.products)&&void 0!==i?i:{};Object.keys(t).forEach((n=>{var i,t,d,v;const u=null!==(v=null===(d=null===(t=null===(i=o[l])||void 0===i?void 0:i.products)||void 0===t?void 0:t[n])||void 0===d?void 0:d.variants)&&void 0!==v?v:{};Object.keys(u).forEach((i=>{var t,d,v,u;const s=null===(u=null===(v=null===(d=null===(t=o[l])||void 0===t?void 0:t.products)||void 0===d?void 0:d[n])||void 0===v?void 0:v.variants)||void 0===u?void 0:u[i];s&&!s.fbStatus&&(s.fbStatus="APPROVED")}))}))})),l({type:n,data:o})},d=function(o,l,n,i){let d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"paged";i||t(o,n,d);const v=(o=>{const l=[];return Object.keys(o).forEach((n=>{var i,t;const d=null!==(t=null===(i=o[n])||void 0===i?void 0:i.products)&&void 0!==t?t:{};Object.keys(d).forEach((i=>{var t,d,v,u;const s=null!==(u=null===(v=null===(d=null===(t=o[n])||void 0===t?void 0:t.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==u?u:{};Object.keys(s).forEach((t=>{var d,v,u,s;const c=null===(s=null===(u=null===(v=null===(d=o[n])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===u?void 0:u.variants)||void 0===s?void 0:s[t];(null==c?void 0:c.fbStatus)||l.push(t)}))}))})),l})(o);v.length>0&&i&&i(l,v).then((l=>{const i=Object.assign({},o);Object.keys(i).forEach((o=>{var n,t;const d=null!==(t=null===(n=i[o])||void 0===n?void 0:n.products)&&void 0!==t?t:{};Object.keys(d).forEach((n=>{var t,d,v,u;const s=null!==(u=null===(v=null===(d=null===(t=i[o])||void 0===t?void 0:t.products)||void 0===d?void 0:d[n])||void 0===v?void 0:v.variants)&&void 0!==u?u:{};Object.keys(s).forEach((t=>{var d,v,u,s;const c=null===(s=null===(u=null===(v=null===(d=i[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[n])||void 0===u?void 0:u.variants)||void 0===s?void 0:s[t];c&&"REJECTED"===l[t]?c.fbStatus="REJECTED":c&&"APPROVED"===l[t]&&(c.fbStatus="APPROVED")}))}))})),n({type:d,data:i})})).catch((l=>{console.error("Error in fbStatusFetcher",l),t(o,n,d)}))},v=(o,l)=>{const n=[];return Object.keys(null!=o?o:{}).forEach((i=>{var t,d;const v=null!==(d=null===(t=null==o?void 0:o[i])||void 0===t?void 0:t.variants)&&void 0!==d?d:{};Object.keys(v).forEach((t=>{var d,v,u,s,c;let r;r=l?null===(u=null===(v=null===(d=null==l?void 0:l.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)||void 0===u?void 0:u[t]:null===(c=null===(s=null==o?void 0:o[i])||void 0===s?void 0:s.variants)||void 0===c?void 0:c[t],(null==r?void 0:r.fbStatus)||n.push(t)}))})),n},u=(o,l,n,i,t)=>{const d=Object.assign({},o);if(Object.keys(o).forEach((l=>{var n,i;Object.keys(null!==(i=null===(n=null==o?void 0:o[l])||void 0===n?void 0:n.variants)&&void 0!==i?i:{}).forEach((n=>{var i,t;const v=null===(i=null==o?void 0:o[l].variants)||void 0===i?void 0:i[n];v&&(v.fbStatus="APPROVED");const u=null===(t=null==d?void 0:d[l])||void 0===t?void 0:t.variants;u&&u[n]&&(u[n]=v)}))})),i&&t){const o=Object.assign({},i);o.products=d,t(o),l({type:"productsPaged",data:{collectionId:n,products:d}})}else l({type:"productsPaged",data:{collectionId:n,products:d}})},s=o=>{const l=Object.keys(o.variants||[]);let n=!1;return!(l.length<=1)||(l.forEach((l=>{var i,t;n=null!==(t=null===(i=o.variants)||void 0===i?void 0:i[l].name.includes(o.name))&&void 0!==t&&t})),!n)},c=(o,l,n,i,t)=>{var d,v,u,s,c,r,a,e,f,p,b,O,h,j,y,E,k,g,P;let D=0,S=0;if(null===(v=null===(d=null==n?void 0:n[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[l]){if(t)return!1;const d=(null===(c=null===(s=null===(u=null==n?void 0:n[o])||void 0===u?void 0:u.products)||void 0===s?void 0:s[l])||void 0===c?void 0:c.variants)||[];if(1===Object.keys(d).length)for(const i in d){const t=null===(a=null===(r=null==n?void 0:n[o])||void 0===r?void 0:r.products)||void 0===a?void 0:a[l],d=null===(b=null===(p=null===(f=null===(e=null==n?void 0:n[o])||void 0===e?void 0:e.products)||void 0===f?void 0:f[l])||void 0===p?void 0:p.variants)||void 0===b?void 0:b[i];if(null===(O=null==d?void 0:d.name)||void 0===O?void 0:O.includes(null!==(h=null==t?void 0:t.name)&&void 0!==h?h:""))return!1}if(null===(E=Object.keys((null===(y=null===(j=null==i?void 0:i.products)||void 0===j?void 0:j[l])||void 0===y?void 0:y.variants)||[]))||void 0===E||E.forEach((()=>S++)),Object.keys((null===(P=null===(g=null===(k=null==n?void 0:n[o])||void 0===k?void 0:k.products)||void 0===g?void 0:g[l])||void 0===P?void 0:P.variants)||[]).forEach((()=>D++)),D>0&&S!==D)return!0}return!1},r=function(o,l,n){var i,t,d,v;let u=0,s=0;if(arguments.length>3&&void 0!==arguments[3]&&arguments[3]){const v=null!==(i=null==l?void 0:l.products)&&void 0!==i?i:{};u=Object.keys(v).length;const c=null!==(d=null===(t=n[o])||void 0===t?void 0:t.products)&&void 0!==d?d:{};s=Object.keys(c).length}else if(n[o]){const i=null==l?void 0:l.products;i&&Object.keys(i).forEach((o=>{var l;const n=null===(l=i[o])||void 0===l?void 0:l.variants;n&&Object.keys(n).forEach((o=>u+=1))}));const t=null===(v=n[o])||void 0===v?void 0:v.products;if(t&&Object.keys(t).forEach((o=>{var l;const n=null===(l=t[o])||void 0===l?void 0:l.variants;n&&Object.keys(n).forEach((o=>s+=1))})),u<=0&&s>0)return!1}return s>0&&u!==s};export{d as fetchFbStatusCollection,v as getVariantIdsToFetchAtProductLevel,r as isCollectionPartiallyChecked,c as isProductPartiallyChecked,l as liftTheStateUp,u as markVariantsAsApprovedProductsLevel,n as paginateSelectedItems,s as shouldShowVariant};
1
+ import{cloneDeep as o}from"lodash";const n=(n,t)=>{const i=o(t);if(delete i.products,(n=Object.assign(Object.assign({},n),{catalogOnlyData:i})).productId&&t.products){const l=o(t.products[n.productId]);(null==l?void 0:l.variants)&&delete l.variants,n=Object.assign(Object.assign({},n),{catalogOnlyData:i,productOnlyData:l})}return n};function t(o,n,t){var l;const d={};let v=0;for(const s in o)if(Object.prototype.hasOwnProperty.call(o,s)){const c=o[s],u=i(c.products,n,t-v);u&&Object.keys(u).length>0&&(d[s]=Object.assign(Object.assign({},c),{products:u})),v+=Object.keys(null!==(l=c.products)&&void 0!==l?l:{}).length}return d}function i(o,n,t){if(!o)return{};const i=Object.keys(o).slice(t,t+n),l={};return i.forEach((n=>{l[n]=o[n]})),l}const l=(o,n,t)=>{Object.keys(o).forEach((n=>{var t,i;const l=null!==(i=null===(t=o[n])||void 0===t?void 0:t.products)&&void 0!==i?i:{};Object.keys(l).forEach((t=>{var i,l,d,v;const s=null!==(v=null===(d=null===(l=null===(i=o[n])||void 0===i?void 0:i.products)||void 0===l?void 0:l[t])||void 0===d?void 0:d.variants)&&void 0!==v?v:{};Object.keys(s).forEach((i=>{var l,d,v,s;const c=null===(s=null===(v=null===(d=null===(l=o[n])||void 0===l?void 0:l.products)||void 0===d?void 0:d[t])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[i];c&&!c.fbStatus&&(c.fbStatus="APPROVED")}))}))})),n({type:t,data:o})},d=function(o,n,t,i){let d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"paged";i||l(o,t,d);const v=(o=>{const n=[];return Object.keys(o).forEach((t=>{var i,l;const d=null!==(l=null===(i=o[t])||void 0===i?void 0:i.products)&&void 0!==l?l:{};Object.keys(d).forEach((i=>{var l,d,v,s;const c=null!==(s=null===(v=null===(d=null===(l=o[t])||void 0===l?void 0:l.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(c).forEach((l=>{var d,v,s,c;const u=null===(c=null===(s=null===(v=null===(d=o[t])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===c?void 0:c[l];(null==u?void 0:u.fbStatus)||n.push(l)}))}))})),n})(o);v.length>0&&i&&i(n,v).then((n=>{const i=Object.assign({},o);Object.keys(i).forEach((o=>{var t,l;const d=null!==(l=null===(t=i[o])||void 0===t?void 0:t.products)&&void 0!==l?l:{};Object.keys(d).forEach((t=>{var l,d,v,s;const c=null!==(s=null===(v=null===(d=null===(l=i[o])||void 0===l?void 0:l.products)||void 0===d?void 0:d[t])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(c).forEach((l=>{var d,v,s,c;const u=null===(c=null===(s=null===(v=null===(d=i[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[t])||void 0===s?void 0:s.variants)||void 0===c?void 0:c[l];u&&"REJECTED"===n[l]?u.fbStatus="REJECTED":u&&"APPROVED"===n[l]&&(u.fbStatus="APPROVED")}))}))})),t({type:d,data:i})})).catch((n=>{console.error("Error in fbStatusFetcher",n),l(o,t,d)}))},v=(o,n)=>{const t=[];return Object.keys(null!=o?o:{}).forEach((i=>{var l,d;const v=null!==(d=null===(l=null==o?void 0:o[i])||void 0===l?void 0:l.variants)&&void 0!==d?d:{};Object.keys(v).forEach((l=>{var d,v,s,c,u;let a;a=n?Object.assign(Object.assign({},null===(s=null===(v=null===(d=null==n?void 0:n.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[l]),{id:l}):Object.assign(Object.assign({},null===(u=null===(c=null==o?void 0:o[i])||void 0===c?void 0:c.variants)||void 0===u?void 0:u[l]),{id:l}),(null==a?void 0:a.fbStatus)||t.push(l)}))})),t},s=(o,n,t,i,l)=>{const d=Object.assign({},o);if(Object.keys(o).forEach((n=>{var t,i;Object.keys(null!==(i=null===(t=null==o?void 0:o[n])||void 0===t?void 0:t.variants)&&void 0!==i?i:{}).forEach((t=>{var i,l;const v=null===(i=null==o?void 0:o[n].variants)||void 0===i?void 0:i[t];v&&(v.fbStatus="APPROVED");const s=null===(l=null==d?void 0:d[n])||void 0===l?void 0:l.variants;s&&s[t]&&(s[t]=v)}))})),i&&l){const o=Object.assign({},i);o.products=d,l(o),n({type:"productsPaged",data:{collectionId:t,products:d}})}else n({type:"productsPaged",data:{collectionId:t,products:d}})},c=o=>{const n=Object.keys(o.variants||[]);let t=!1;return!(n.length<=1)||(n.forEach((n=>{var i,l;t=null!==(l=null===(i=o.variants)||void 0===i?void 0:i[n].name.includes(o.name))&&void 0!==l&&l})),!t)},u=(o,n,t,i,l)=>{var d,v,s,c,u,a,e,r,b,O,f,j,p,h,y,g,E,k,P;let D=0,m=0;if(null===(v=null===(d=null==t?void 0:t[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[n]){if(l)return!1;const d=(null===(u=null===(c=null===(s=null==t?void 0:t[o])||void 0===s?void 0:s.products)||void 0===c?void 0:c[n])||void 0===u?void 0:u.variants)||[];if(1===Object.keys(d).length)for(const i in d){const l=null===(e=null===(a=null==t?void 0:t[o])||void 0===a?void 0:a.products)||void 0===e?void 0:e[n],d=null===(f=null===(O=null===(b=null===(r=null==t?void 0:t[o])||void 0===r?void 0:r.products)||void 0===b?void 0:b[n])||void 0===O?void 0:O.variants)||void 0===f?void 0:f[i];if(null===(j=null==d?void 0:d.name)||void 0===j?void 0:j.includes(null!==(p=null==l?void 0:l.name)&&void 0!==p?p:""))return!1}if(null===(g=Object.keys((null===(y=null===(h=null==i?void 0:i.products)||void 0===h?void 0:h[n])||void 0===y?void 0:y.variants)||[]))||void 0===g||g.forEach((()=>m++)),Object.keys((null===(P=null===(k=null===(E=null==t?void 0:t[o])||void 0===E?void 0:E.products)||void 0===k?void 0:k[n])||void 0===P?void 0:P.variants)||[]).forEach((()=>D++)),D>0&&m!==D)return!0}return!1},a=function(o,n,t){var i,l,d,v;let s=0,c=0;if(arguments.length>3&&void 0!==arguments[3]&&arguments[3]){const v=null!==(i=null==n?void 0:n.products)&&void 0!==i?i:{};s=Object.keys(v).length;const u=null!==(d=null===(l=t[o])||void 0===l?void 0:l.products)&&void 0!==d?d:{};c=Object.keys(u).length}else if(t[o]){const i=null==n?void 0:n.products;i&&Object.keys(i).forEach((o=>{var n;const t=null===(n=i[o])||void 0===n?void 0:n.variants;t&&Object.keys(t).forEach((o=>s+=1))}));const l=null===(v=t[o])||void 0===v?void 0:v.products;if(l&&Object.keys(l).forEach((o=>{var n;const t=null===(n=l[o])||void 0===n?void 0:n.variants;t&&Object.keys(t).forEach((o=>c+=1))})),s<=0&&c>0)return!1}return c>0&&s!==c},e=o=>{const n={};return Object.keys(o).length?(Object.keys(o).map((t=>{var i,l;const d=null===(i=o[t])||void 0===i?void 0:i.variants,v={};Object.keys(d).length&&Object.keys(null===(l=o[t])||void 0===l?void 0:l.variants).map((o=>{v[o]=Object.assign(Object.assign({},d[o]),{id:o})})),n[t]=Object.assign(Object.assign({},o[t]),{variants:v,id:t})})),n):{}};export{e as addIdToProductsAndVariants,d as fetchFbStatusCollection,v as getVariantIdsToFetchAtProductLevel,a as isCollectionPartiallyChecked,u as isProductPartiallyChecked,n as liftTheStateUp,s as markVariantsAsApprovedProductsLevel,t as paginateSelectedItems,c as shouldShowVariant};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.571",
3
+ "version": "0.0.572-1",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",