@bikdotai/bik-component-library 0.0.399-beta-new → 0.0.399-beta.2

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 (131) hide show
  1. package/dist/cjs/components/add-variableV2/AddVariableV2.d.ts +1 -0
  2. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
  3. package/dist/cjs/components/bik-layout/BikSidebar.d.ts +0 -1
  4. package/dist/cjs/components/bik-layout/BikSidebar.js +1 -1
  5. package/dist/cjs/components/bik-layout/SidebarStyles.js +1 -1
  6. package/dist/cjs/components/input-with-vars/InputWithVariables.d.ts +14 -6
  7. package/dist/cjs/components/input-with-vars/InputWithVariables.js +3 -3
  8. package/dist/cjs/components/plans/SubscriptionPlanStyled.js +1 -1
  9. package/dist/cjs/components/plans/SubscriptionPlansCollected.js +1 -1
  10. package/dist/cjs/components/product-picker-v2/collectionScreen.d.ts +2 -0
  11. package/dist/cjs/components/product-picker-v2/collectionScreen.js +1 -1
  12. package/dist/cjs/components/product-picker-v2/modal.d.ts +5 -1
  13. package/dist/cjs/components/product-picker-v2/modal.js +1 -1
  14. package/dist/cjs/components/product-picker-v2/productScreen.d.ts +7 -0
  15. package/dist/cjs/components/product-picker-v2/productScreen.js +1 -1
  16. package/dist/cjs/components/product-picker-v2/searchScreen.d.ts +4 -0
  17. package/dist/cjs/components/product-picker-v2/searchScreen.js +1 -1
  18. package/dist/cjs/components/product-picker-v2/style.d.ts +2 -0
  19. package/dist/cjs/components/product-picker-v2/style.js +24 -16
  20. package/dist/cjs/components/shimmer-image/ShimmerImage.d.ts +1 -0
  21. package/dist/cjs/components/shimmer-image/ShimmerImage.js +1 -1
  22. package/dist/cjs/components/side-modal/SideModal.d.ts +4 -2
  23. package/dist/cjs/components/side-modal/SideModal.js +1 -1
  24. package/dist/cjs/components/side-modal/SideModal.style.d.ts +4 -1
  25. package/dist/cjs/components/side-modal/SideModal.style.js +4 -1
  26. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.d.ts +7 -3
  27. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
  28. package/dist/cjs/components/template-context-mapper/context/templateModalContext.d.ts +5 -1
  29. package/dist/cjs/components/template-context-mapper/modalElements/BackTrackComponent.d.ts +4 -0
  30. package/dist/cjs/components/template-context-mapper/modalElements/BackTrackComponent.js +1 -0
  31. package/dist/cjs/components/template-context-mapper/modalElements/Body.d.ts +2 -0
  32. package/dist/cjs/components/template-context-mapper/modalElements/Body.js +5 -5
  33. package/dist/cjs/components/template-context-mapper/modalElements/DesktopPreview.d.ts +1 -0
  34. package/dist/cjs/components/template-context-mapper/modalElements/DesktopPreview.js +4 -4
  35. package/dist/cjs/components/template-context-mapper/modalElements/DiscountCodeComponent.d.ts +6 -0
  36. package/dist/cjs/components/template-context-mapper/modalElements/DiscountCodeComponent.js +1 -0
  37. package/dist/cjs/components/template-context-mapper/modalElements/EditMediaModal.d.ts +11 -0
  38. package/dist/cjs/components/template-context-mapper/modalElements/EditMediaModal.js +1 -0
  39. package/dist/cjs/components/template-context-mapper/modalElements/EditMediaV2.d.ts +3 -0
  40. package/dist/cjs/components/template-context-mapper/modalElements/EditMediaV2.js +2 -2
  41. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.d.ts +2 -0
  42. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.js +1 -1
  43. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.d.ts +4 -1
  44. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
  45. package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.d.ts +1 -0
  46. package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.js +4 -4
  47. package/dist/cjs/components/template-context-mapper/modalElements/TemplateSelectModalContent.d.ts +3 -1
  48. package/dist/cjs/components/template-context-mapper/modalElements/TemplateSelectModalContent.js +1 -1
  49. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.d.ts +3 -1
  50. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.js +3 -3
  51. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
  52. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorsPanel.js +4 -3
  53. package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  54. package/dist/cjs/components/template-preview/TemplatePreview.d.ts +2 -1
  55. package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
  56. package/dist/cjs/components/template-preview/WhatsApp/ChatUI.style.js +5 -5
  57. package/dist/cjs/components/template-preview/WhatsAppTemplatePreview.d.ts +1 -0
  58. package/dist/cjs/components/template-preview/WhatsAppTemplatePreview.js +1 -1
  59. package/dist/cjs/components/template-preview/constants/regexPatterns.js +1 -1
  60. package/dist/cjs/components/template-preview/helpers/TemplateCreatorHelper.d.ts +6 -1
  61. package/dist/cjs/components/template-preview/helpers/TemplateCreatorHelper.js +1 -1
  62. package/dist/cjs/components/template-preview/index.d.ts +1 -0
  63. package/dist/cjs/components/template-preview/models/WhatsAppTemplate.d.ts +21 -0
  64. package/dist/cjs/components/template-preview/models/WhatsAppTemplate.js +1 -1
  65. package/dist/cjs/index.js +1 -1
  66. package/dist/esm/components/add-variableV2/AddVariableV2.d.ts +1 -0
  67. package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
  68. package/dist/esm/components/bik-layout/BikSidebar.d.ts +0 -1
  69. package/dist/esm/components/bik-layout/BikSidebar.js +1 -1
  70. package/dist/esm/components/bik-layout/SidebarStyles.js +1 -1
  71. package/dist/esm/components/input-with-vars/InputWithVariables.d.ts +14 -6
  72. package/dist/esm/components/input-with-vars/InputWithVariables.js +3 -3
  73. package/dist/esm/components/plans/SubscriptionPlanStyled.js +1 -1
  74. package/dist/esm/components/plans/SubscriptionPlansCollected.js +1 -1
  75. package/dist/esm/components/product-picker-v2/collectionScreen.d.ts +2 -0
  76. package/dist/esm/components/product-picker-v2/collectionScreen.js +1 -1
  77. package/dist/esm/components/product-picker-v2/modal.d.ts +5 -1
  78. package/dist/esm/components/product-picker-v2/modal.js +1 -1
  79. package/dist/esm/components/product-picker-v2/productScreen.d.ts +7 -0
  80. package/dist/esm/components/product-picker-v2/productScreen.js +1 -1
  81. package/dist/esm/components/product-picker-v2/searchScreen.d.ts +4 -0
  82. package/dist/esm/components/product-picker-v2/searchScreen.js +1 -1
  83. package/dist/esm/components/product-picker-v2/style.d.ts +2 -0
  84. package/dist/esm/components/product-picker-v2/style.js +20 -12
  85. package/dist/esm/components/shimmer-image/ShimmerImage.d.ts +1 -0
  86. package/dist/esm/components/shimmer-image/ShimmerImage.js +1 -1
  87. package/dist/esm/components/side-modal/SideModal.d.ts +4 -2
  88. package/dist/esm/components/side-modal/SideModal.js +1 -1
  89. package/dist/esm/components/side-modal/SideModal.style.d.ts +4 -1
  90. package/dist/esm/components/side-modal/SideModal.style.js +15 -12
  91. package/dist/esm/components/template-context-mapper/TemplateContextMapper.d.ts +7 -3
  92. package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
  93. package/dist/esm/components/template-context-mapper/context/templateModalContext.d.ts +5 -1
  94. package/dist/esm/components/template-context-mapper/modalElements/BackTrackComponent.d.ts +4 -0
  95. package/dist/esm/components/template-context-mapper/modalElements/BackTrackComponent.js +1 -0
  96. package/dist/esm/components/template-context-mapper/modalElements/Body.d.ts +2 -0
  97. package/dist/esm/components/template-context-mapper/modalElements/Body.js +4 -4
  98. package/dist/esm/components/template-context-mapper/modalElements/DesktopPreview.d.ts +1 -0
  99. package/dist/esm/components/template-context-mapper/modalElements/DesktopPreview.js +7 -7
  100. package/dist/esm/components/template-context-mapper/modalElements/DiscountCodeComponent.d.ts +6 -0
  101. package/dist/esm/components/template-context-mapper/modalElements/DiscountCodeComponent.js +1 -0
  102. package/dist/esm/components/template-context-mapper/modalElements/EditMediaModal.d.ts +11 -0
  103. package/dist/esm/components/template-context-mapper/modalElements/EditMediaModal.js +1 -0
  104. package/dist/esm/components/template-context-mapper/modalElements/EditMediaV2.d.ts +3 -0
  105. package/dist/esm/components/template-context-mapper/modalElements/EditMediaV2.js +2 -2
  106. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.d.ts +2 -0
  107. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.js +1 -1
  108. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.d.ts +4 -1
  109. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
  110. package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.d.ts +1 -0
  111. package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.js +3 -3
  112. package/dist/esm/components/template-context-mapper/modalElements/TemplateSelectModalContent.d.ts +3 -1
  113. package/dist/esm/components/template-context-mapper/modalElements/TemplateSelectModalContent.js +1 -1
  114. package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.d.ts +3 -1
  115. package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.js +2 -2
  116. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
  117. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorsPanel.js +4 -3
  118. package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  119. package/dist/esm/components/template-preview/TemplatePreview.d.ts +2 -1
  120. package/dist/esm/components/template-preview/TemplatePreview.js +1 -1
  121. package/dist/esm/components/template-preview/WhatsApp/ChatUI.style.js +1 -1
  122. package/dist/esm/components/template-preview/WhatsAppTemplatePreview.d.ts +1 -0
  123. package/dist/esm/components/template-preview/WhatsAppTemplatePreview.js +1 -1
  124. package/dist/esm/components/template-preview/constants/regexPatterns.js +1 -1
  125. package/dist/esm/components/template-preview/helpers/TemplateCreatorHelper.d.ts +6 -1
  126. package/dist/esm/components/template-preview/helpers/TemplateCreatorHelper.js +1 -1
  127. package/dist/esm/components/template-preview/index.d.ts +1 -0
  128. package/dist/esm/components/template-preview/models/WhatsAppTemplate.d.ts +21 -0
  129. package/dist/esm/components/template-preview/models/WhatsAppTemplate.js +1 -1
  130. package/dist/esm/index.js +1 -1
  131. package/package.json +1 -1
@@ -3,4 +3,4 @@ import{jsx as e}from"react/jsx-runtime";import{useState as t,createElement as l}
3
3
  column-gap: 22px;
4
4
  align-items: stretch;
5
5
  overflow-x: auto;
6
- `,s=o=>{var s;const[a,r]=t(null!==(s=o.selectedPlan)&&void 0!==s?s:"");return e(i,Object.assign({style:{padding:"28px 0px"}},{children:o.plans.map(((t,i)=>{var s,c,d;return e("div",Object.assign({style:{minWidth:null!==(s=o.staticWidth)&&void 0!==s?s:300,maxWidth:null!==(c=o.staticWidth)&&void 0!==c?c:300}},{children:l(n,Object.assign({},t,{showMonthly:!0,showMonthlyOptions:null!==(d="monthly"==o.selectedTab)&&void 0!==d&&d,showTrialOptions:o.showTrialOptions||!1,onPlanSelect:e=>{o.onPlanSelect(e),r(e)},key:t.planName,isPlanSelected:a==("monthly"==o.selectedTab?t.code:t.yearlyCode),onClickShowAllFeatures:o.onClickShowAllFeatures,showSelectedPlanChip:o.currentPlan==("monthly"==o.selectedTab?t.code:t.yearlyCode)}))}),i)}))}))};export{s as SubscriptionPlansCollected};
6
+ `,s=o=>{var s;const[a,r]=t(null!==(s=o.selectedPlan)&&void 0!==s?s:"");return e(i,Object.assign({style:{padding:"28px 0px"}},{children:o.plans.map(((t,i)=>{var s,c,d;return e("div",Object.assign({style:{minWidth:null!==(s=o.staticWidth)&&void 0!==s?s:280,maxWidth:null!==(c=o.staticWidth)&&void 0!==c?c:280}},{children:l(n,Object.assign({},t,{showMonthly:!0,showMonthlyOptions:null!==(d="monthly"==o.selectedTab)&&void 0!==d&&d,showTrialOptions:o.showTrialOptions||!1,onPlanSelect:e=>{o.onPlanSelect(e),r(e)},key:t.planName,isPlanSelected:a==("monthly"==o.selectedTab?t.code:t.yearlyCode),onClickShowAllFeatures:o.onClickShowAllFeatures,showSelectedPlanChip:o.currentPlan==("monthly"==o.selectedTab?t.code:t.yearlyCode)}))}),i)}))}))};export{s as SubscriptionPlansCollected};
@@ -21,6 +21,8 @@ interface CollectionsScreenInterface {
21
21
  setCurPage: React.Dispatch<React.SetStateAction<number>>;
22
22
  };
23
23
  hideCollectionCheckbox?: boolean;
24
+ renderWithoutModal?: boolean;
25
+ pickerType?: 'COLLECTION' | 'PRODUCT';
24
26
  }
25
27
  export declare const CollectionsScreen: (props: CollectionsScreenInterface) => import("react/jsx-runtime").JSX.Element;
26
28
  export {};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import i from"../../assets/icons/chevronRight.svg.js";import{useRef as c,useState as s,useEffect as r}from"react";import{CheckBox as n}from"../checkBox/CheckBox.js";import{IconButton as l}from"../icon-button/IconButton.js";import{BikShimmer as d}from"../shimmer/ShimmerComponent/BikShimmer.js";import{Tag as a}from"../tag/Tag.js";import{TitleRegular as h}from"../TypographyStyle.js";import{EmptyState as u}from"./emptyState.js";import{CollectionCardStyle as m,CollectionCardInfoStyle as p,CollectionCardDetailStyle as C,CollectionNameHolder as g}from"./style.js";const v=(e,t,o)=>{if(e.length<=t)return e;const i=e.slice(0,t-1);return(o?i.slice(0,i.lastIndexOf(" ")):i)+"..."},b=o=>{const{customCollectionRestriction:i,dataLoading:n,collections:l,selectedCollectionsDispatch:a,setCollectionId:h,selectedCollections:m,setScreen:p,collectionFetcher:C,collectionsDispatch:g,pagingControls:v,storeId:b,setSaveDisabled:f,hideCollectionCheckbox:k}=o,j=c(null),x=c(v.curPage),O=!!i&&(null==m?void 0:m.isCustom),[E,S]=s(!1);r((()=>{x.current=v.curPage}),[v.curPage]),r((()=>{const e=new IntersectionObserver((e=>{e[0].isIntersecting&&x.current>0&&(f(!0),S(!0),C(x.current,b).then((e=>{g({type:"paged",data:(null==e?void 0:e.collections)||{}}),v.setCurPage(x.current+1),S(!1),f(!1)})).catch())}),{threshold:1});return j.current&&e.observe(j.current),()=>{j.current&&e.unobserve(j.current)}}),[j]);const D=e=>{var t,o;let i=0,c=0;if(m[e]){const s=null===(t=l[e])||void 0===t?void 0:t.products;s&&Object.keys(s).forEach((e=>{var t;const o=null===(t=s[e])||void 0===t?void 0:t.variants;o&&Object.keys(o).forEach((e=>i+=1))}));const r=null===(o=m[e])||void 0===o?void 0:o.products;return r&&Object.keys(r).forEach((e=>{var t;const o=null===(t=r[e])||void 0===t?void 0:t.variants;o&&Object.keys(o).forEach((e=>c+=1))})),!(i<=0&&c>0)&&(c>0&&i!==c)}return!1};return e("div",{children:[Object.keys(l).length?Object.keys(l).map((e=>t(y,{customCollectionRestriction:i,data:l[e],isDisabled:O&&!(null==m?void 0:m[e]),isChecked:!!(null==m?void 0:m[e]),isPartiallyChecked:D(e),selectedCollectionsDispatch:a,setCollectionId:h,setScreen:p,id:e,hideCollectionCheckbox:k},e))):n?[1,2,3,4,5,6,7,8,9,10].map(((e,o)=>t("div",Object.assign({style:{borderBottom:"1px solid #E0E0E0"}},{children:t(d,{boxes:[{height:"64px",width:"100%",marginTop:"0px"}]})}),o))):t(u,{title:"No collections to show",subtitle:"We couldn’t find any collection."}),t("div",{ref:j}),E&&[1,2,3,4,5].map(((e,o)=>t("div",Object.assign({style:{borderBottom:"1px solid #E0E0E0"}},{children:t(d,{boxes:[{height:"64px",width:"100%",marginTop:"0px"}]})}),o)))]})},y=c=>{const{customCollectionRestriction:s,data:r,selectedCollectionsDispatch:d,setCollectionId:u,isPartiallyChecked:b,setScreen:y,id:f,isChecked:k,isDisabled:j,hideCollectionCheckbox:x}=c;return e(m,Object.assign({isDisabled:j,onClick:()=>{j||(u(f),y("products"))}},{children:[e(p,{children:[!x&&t(n,{isDisabled:j,isChecked:k,isPartiallyChecked:b,onValueChange:function(e,t,o){null==o||o.stopPropagation(),d(e?{type:"selected",data:{id:f,val:r,isRestricted:s}}:{type:"unselected",data:{id:f}}),u(e?f:"")}}),t(C,{children:e(g,{children:[t(h,{children:v(r.name,40,!0)}),r.isSmartCollection?t(a,{tagText:"Smart Collection",type:"warning"}):t(o,{})]})})]}),t(l,{height:12,width:12,disabled:j,Icon:i})]}))};export{b as CollectionsScreen,v as truncate};
1
+ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import i from"../../assets/icons/chevronRight.svg.js";import{useRef as c,useState as s,useEffect as r}from"react";import{CheckBox as n}from"../checkBox/CheckBox.js";import{IconButton as l}from"../icon-button/IconButton.js";import{BikShimmer as d}from"../shimmer/ShimmerComponent/BikShimmer.js";import{Tag as a}from"../tag/Tag.js";import{TitleRegular as h}from"../TypographyStyle.js";import{EmptyState as p}from"./emptyState.js";import{CollectionCardStyle as u,CollectionCardInfoStyle as m,CollectionCardDetailStyle as C,CollectionNameHolder as v}from"./style.js";const g=(e,t,o)=>{if(e.length<=t)return e;const i=e.slice(0,t-1);return(o?i.slice(0,i.lastIndexOf(" ")):i)+"..."},b=o=>{const{customCollectionRestriction:i,dataLoading:n,collections:l,selectedCollectionsDispatch:a,setCollectionId:h,selectedCollections:u,setScreen:m,collectionFetcher:C,collectionsDispatch:v,pagingControls:g,storeId:b,setSaveDisabled:f,hideCollectionCheckbox:k,renderWithoutModal:j,pickerType:x}=o,O=c(null),E=c(g.curPage),I=!!i&&(null==u?void 0:u.isCustom),[S,T]=s(!1);r((()=>{E.current=g.curPage}),[g.curPage]),r((()=>{const e=new IntersectionObserver((e=>{e[0].isIntersecting&&E.current>0&&(f(!0),T(!0),C(E.current,b).then((e=>{v({type:"paged",data:(null==e?void 0:e.collections)||{}}),g.setCurPage(E.current+1),T(!1),f(!1)})).catch())}),{threshold:1});return O.current&&e.observe(O.current),()=>{O.current&&e.unobserve(O.current)}}),[O]);const D=e=>{var t,o;let i=0,c=0;if(u[e]){const s=null===(t=l[e])||void 0===t?void 0:t.products;s&&Object.keys(s).forEach((e=>{var t;const o=null===(t=s[e])||void 0===t?void 0:t.variants;o&&Object.keys(o).forEach((e=>i+=1))}));const r=null===(o=u[e])||void 0===o?void 0:o.products;return r&&Object.keys(r).forEach((e=>{var t;const o=null===(t=r[e])||void 0===t?void 0:t.variants;o&&Object.keys(o).forEach((e=>c+=1))})),!(i<=0&&c>0)&&(c>0&&i!==c)}return!1};return e("div",{children:[Object.keys(l).length?Object.keys(l).map((e=>t(y,{customCollectionRestriction:i,data:l[e],isDisabled:I&&!(null==u?void 0:u[e]),isChecked:!!(null==u?void 0:u[e]),isPartiallyChecked:D(e),selectedCollectionsDispatch:a,setCollectionId:h,setScreen:m,id:e,hideCollectionCheckbox:k,selectedCollections:u,renderWithoutModal:j,pickerType:x},e))):n?[1,2,3,4,5,6,7,8,9,10].map(((e,o)=>t("div",Object.assign({style:{borderBottom:"1px solid #E0E0E0"}},{children:t(d,{boxes:[{height:"64px",width:"100%",marginTop:"0px"}]})}),o))):t(p,{title:"No collections to show",subtitle:"We couldn’t find any collection."}),t("div",{ref:O}),S&&[1,2,3,4,5].map(((e,o)=>t("div",Object.assign({style:{borderBottom:"1px solid #E0E0E0"}},{children:t(d,{boxes:[{height:"64px",width:"100%",marginTop:"0px"}]})}),o)))]})},y=c=>{const{customCollectionRestriction:s,data:r,selectedCollectionsDispatch:d,setCollectionId:p,isPartiallyChecked:b,setScreen:y,id:f,isChecked:k,isDisabled:j,hideCollectionCheckbox:x,pickerType:O,selectedCollections:E}=c;return e(u,Object.assign({isDisabled:j,onClick:e=>{if(!j){if("COLLECTION"===O)return e.stopPropagation(),d({type:"reset",data:{}}),d({type:"selected",data:{id:f,val:r,isRestricted:s}}),void p(f);p(f),y("products")}},isActive:!!E[f]},{children:[e(m,{children:[!x&&t(n,{isDisabled:j,isChecked:k,isPartiallyChecked:b,onValueChange:function(e,t,o){null==o||o.stopPropagation(),d(e?{type:"selected",data:{id:f,val:r,isRestricted:s}}:{type:"unselected",data:{id:f}}),p(e?f:"")}}),t(C,{children:e(v,{children:[t(h,{children:g(r.name,40,!0)}),r.isSmartCollection?t(a,{tagText:"Smart Collection",type:"warning"}):t(o,{})]})})]}),"COLLECTION"!==O&&t(l,{height:12,width:12,disabled:j,Icon:i})]}))};export{b as CollectionsScreen,g as truncate};
@@ -56,7 +56,7 @@ export type ProductPickerInterface = {
56
56
  storeId: string;
57
57
  selectedItems: SelectedItems;
58
58
  onAdd: (items: SelectedItems, total: number) => void;
59
- onClose: () => void;
59
+ onClose?: () => void;
60
60
  visible: boolean;
61
61
  zIndex?: number;
62
62
  limit?: number;
@@ -69,6 +69,10 @@ export type ProductPickerInterface = {
69
69
  title?: string;
70
70
  postHeader?: React.ReactNode;
71
71
  width?: string;
72
+ renderWithoutModal?: boolean;
73
+ onClickSave?: number;
74
+ pickerType?: 'COLLECTION' | 'PRODUCT';
75
+ hideProductVariants?: boolean;
72
76
  rearrangeEnabled?: boolean;
73
77
  } & ({
74
78
  startupScreen: ScreenName.RearrangeProducts;
@@ -1 +1 @@
1
- import{jsx as e,Fragment as t,jsxs as o}from"react/jsx-runtime";import c from"../../assets/icons/search.svg.js";import{useReducer as r,useState as s,useEffect as i}from"react";import{COLORS as n}from"../../constants/Theme.js";import{Button as l}from"../button/Button.js";import{Input as d}from"../input/Input.js";import{StyledModal as a}from"../modals/styledModal.js";import{Spinner as u}from"../spinner/Spinner.js";import{Tag as h}from"../tag/Tag.js";import{CollectionsScreen as p}from"./collectionScreen.js";import{ProductsScreen as m}from"./productScreen.js";import{RearrangeScreen as g}from"./rearrangeScreen.js";import{collectionsReducer as C,selectedColectionsReducer as b,CollectionIdContext as v}from"./reducers.js";import{SearchScreen as S}from"./searchScreen.js";import{SelectedScreen as f}from"./selectedScreen.js";import{ContainerStyle as y,ScrollContainerStyle as j}from"./style.js";import{OUT_OF_STOCK_ACTION as P}from"./type.js";var x;!function(e){e.Collections="collections",e.RearrangeProducts="rearrange",e.SelectedProducts="view",e.SearchProducts="searchProducts",e.Products="products"}(x||(x={}));const k=k=>{const{storeId:I,selectedItems:O,onClose:R,visible:T,zIndex:D,limit:F,hideCollectionCheckbox:w,hideProductCheckbox:E,outOfStockAction:A=P.BLUR,hideVariantCheckbox:B,selectProductsFromCustomCollection:L,hideSelectionCount:z,title:G,width:H,startupScreen:V=x.Collections,rearrangeEnabled:$}=k,[K,M]=r(C,{}),[U,Y]=s([x.Collections,x.RearrangeProducts].includes(V)?V:x.Collections),[q,J]=s("grid"),[N,Q]=s(""),[W,X]=s(0),[Z,_]=s(!1),[ee,te]=s(0),[oe,ce]=s(""),[re,se]=s(!1),[ie,ne]=s(!1),[le,de]=s(),[ae,ue]=r(b,Object.keys(O).length>0?O:{});i((()=>{_(!0),ne(!0),k.collectionFetcher(W,I).then((e=>{M({type:"fetched",data:(null==e?void 0:e.collections)||{}}),_(!1),X((e=>e+1)),ne(!1)})).catch()}),[]),i((()=>{let e=0;Object.keys(ae||[]).forEach((t=>{var o;Object.keys((null===(o=ae[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=ae[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),te(e)})),i((()=>{var e;N&&!(null===(e=null==K?void 0:K[N])||void 0===e?void 0:e.products)&&(_(!0),k.productFetcher(N,I).then((e=>{Object.keys(e).length&&M({type:"productsFetched",data:{collectionId:N,products:e}}),_(!1)})).catch())}),[N]),i((()=>{const e=setTimeout((()=>{"rearrange"!==U&&(oe.length?(se(!0),k.searchFetcher(I,oe).then((e=>{de(Object.assign({},e)),Y("searchProducts"),_(!1),se(!1)}))):Y("collections"))}),800);return()=>clearTimeout(e)}),[oe]);const he=()=>{ue({type:"reset",data:{}})};return e(a,Object.assign({zIndex:D,open:T,onClose:()=>{R(),he()},headingTitle:G||("collections"===U||"products"===U?"Select Products":"view"===U?"Selected Products":"searchProducts"===U?"Searched Products":"rearrange"===U?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:H||"480px"},headerRightCustomElement:"rearrange"===U?(console.log("ignore:",J),e(t,{})):e(t,{}),primaryButton:{buttonText:Z?"Loading...":U===x.RearrangeProducts?"Done":"Add",disabled:Z||ee<1||F&&ee>F||!1,onClick:()=>{k.onAdd(ae,ee),he()}},footerLeftCustomElement:z?e(t,{}):F&&ee>F?e(h,{tagText:`You can only select ${F} products`,type:"negative"}):e(l,ee>0?{onClick:()=>{Y($?x.RearrangeProducts:x.SelectedProducts)},buttonText:`${ee} products selected`,buttonType:["rearrange","view"].includes(U)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(U)}:{disabled:!0,buttonText:`${ee} products selected`,buttonType:"tertiaryGray"})},{children:o(y,{children:[k.postHeader&&e("div",Object.assign({style:{padding:"0 24px"}},{children:k.postHeader})),!k.hideGlobalSearch&&e(t,{children:("collections"===U||"searchProducts"===U)&&e("div",Object.assign({style:{padding:"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:e(d,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>re?e(u,{size:"small",color:n.content.primary}):e(c,{})},id:"listInput",height:"24px",type:"text",value:oe,onChangeText:e=>{e.length&&e.trim().length?ce(e):ce("")}})}))}),o(j,{children:["collections"===U&&e(p,{customCollectionRestriction:k.customCollectionRestriction,dataLoading:ie,collections:K,selectedCollectionsDispatch:ue,setCollectionId:Q,setScreen:Y,selectedCollections:ae,collectionFetcher:k.collectionFetcher,storeId:I,collectionsDispatch:M,setSaveDisabled:_,pagingControls:{curPage:W,setCurPage:X},hideCollectionCheckbox:w}),"products"===U&&N&&e(v.Provider,Object.assign({value:N},{children:e(m,{hideInCollectionSearch:k.hideInCollectionSearch,customCollectionRestriction:k.customCollectionRestriction,productFetcher:k.productFetcher,setScreen:Y,storeId:I,data:K[N],collectionsDispatch:M,selectedCollectionsDispatch:ue,selectedData:ae,setSaveDisabled:_,searchInCollectionFetcher:k.searchInCollectionFetcher,hideProductCheckbox:E,outOfStockAction:A,hideVariantCheckbox:B,selectProductsFromCustomCollection:L})})),"view"===U&&e(f,{selectedCollections:ae||{},selectedCollectionsDispatch:ue,setScreen:Y,collections:K}),"rearrange"===U&&e(g,{selectedCollections:ae||{},selectedCollectionsDispatch:ue,setScreen:Y,outOfStockAction:A,rearrangeViewType:"grid"===q?"list":"grid"}),"searchProducts"===U&&e(S,{customCollectionRestriction:k.customCollectionRestriction,selectedCollections:ae||{},searchedCollections:le||{},selectedCollectionsDispatch:ue,setScreen:Y,collections:K,onBackPress:()=>{ce(""),de({})}})]})]})}))};export{k as ProductPickerModal,x 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 i,useEffect as s}from"react";import{COLORS as n}from"../../constants/Theme.js";import{Button as l}from"../button/Button.js";import{Input as d}from"../input/Input.js";import{StyledModal as a}from"../modals/styledModal.js";import{Spinner as h}from"../spinner/Spinner.js";import{Tag as u}from"../tag/Tag.js";import{CollectionsScreen as p}from"./collectionScreen.js";import{ProductsScreen as m}from"./productScreen.js";import{RearrangeScreen as C}from"./rearrangeScreen.js";import{collectionsReducer as g,selectedColectionsReducer as b,CollectionIdContext as v}from"./reducers.js";import{SearchScreen as y}from"./searchScreen.js";import{SelectedScreen as S}from"./selectedScreen.js";import{ContainerStyle as P,ScrollContainerStyle as f}from"./style.js";import{OUT_OF_STOCK_ACTION as j}from"./type.js";var x;!function(e){e.Collections="collections",e.RearrangeProducts="rearrange",e.SelectedProducts="view",e.SearchProducts="searchProducts",e.Products="products"}(x||(x={}));const k=k=>{const{storeId:T,selectedItems:I,onClose:O,visible:R,zIndex:D,limit:F,hideCollectionCheckbox:w,hideProductCheckbox:E,outOfStockAction:V=j.BLUR,hideVariantCheckbox:A,selectProductsFromCustomCollection:B,hideSelectionCount:L,title:M,width:z,renderWithoutModal:G,onClickSave:H,pickerType:W,hideProductVariants:$=!1,startupScreen:K=x.Collections,rearrangeEnabled:U}=k,[Y,q]=r(g,{}),[J,N]=i([x.Collections,x.RearrangeProducts].includes(K)?K:x.Collections),[Q,X]=i("grid"),[Z,_]=i(""),[ee,te]=i(0),[oe,ce]=i(!1),[re,ie]=i(0),[se,ne]=i(""),[le,de]=i(!1),[ae,he]=i(!1),[ue,pe]=i(),[me,Ce]=r(b,Object.keys(I).length>0?I:{});s((()=>{ce(!0),he(!0),k.collectionFetcher(ee,T).then((e=>{q({type:"fetched",data:(null==e?void 0:e.collections)||{}}),ce(!1),te((e=>e+1)),he(!1)})).catch()}),[]),s((()=>{let e=0;Object.keys(me||[]).forEach((t=>{var o;Object.keys((null===(o=me[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=me[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),ie(e)})),s((()=>{var e;Z&&!(null===(e=null==Y?void 0:Y[Z])||void 0===e?void 0:e.products)&&(ce(!0),k.productFetcher(Z,T).then((e=>{Object.keys(e).length&&q({type:"productsFetched",data:{collectionId:Z,products:e}}),ce(!1)})).catch())}),[Z]),s((()=>{const e=setTimeout((()=>{"rearrange"!==J&&(se.length?(de(!0),k.searchFetcher(T,se).then((e=>{pe(Object.assign({},e)),N("searchProducts"),ce(!1),de(!1)}))):N("collections"))}),800);return()=>clearTimeout(e)}),[se]),s((()=>{H&&(k.onAdd(me,re),ge())}),[H]);const ge=()=>{Ce({type:"reset",data:{}})},be=e(P,{children:[k.postHeader&&t("div",Object.assign({style:{padding:"0 24px"}},{children:k.postHeader})),!k.hideGlobalSearch&&t(o,{children:("collections"===J||"searchProducts"===J)&&t("div",Object.assign({style:{padding:G?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:t(d,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>le?t(h,{size:"small",color:n.content.primary}):t(c,{})},id:"listInput",height:"24px",type:"text",value:se,onChangeText:e=>{e.length&&e.trim().length?ne(e):ne("")}})}))}),e(f,{children:["collections"===J&&t(p,{customCollectionRestriction:k.customCollectionRestriction,dataLoading:ae,collections:Y,selectedCollectionsDispatch:Ce,setCollectionId:_,setScreen:N,selectedCollections:me,collectionFetcher:k.collectionFetcher,storeId:T,collectionsDispatch:q,setSaveDisabled:ce,pagingControls:{curPage:ee,setCurPage:te},hideCollectionCheckbox:w,renderWithoutModal:G,pickerType:W}),"products"===J&&Z&&t(v.Provider,Object.assign({value:Z},{children:t(m,{hideInCollectionSearch:k.hideInCollectionSearch,customCollectionRestriction:k.customCollectionRestriction,productFetcher:k.productFetcher,setScreen:N,storeId:T,data:Y[Z],collectionsDispatch:q,selectedCollectionsDispatch:Ce,selectedData:me,setSaveDisabled:ce,searchInCollectionFetcher:k.searchInCollectionFetcher,hideProductCheckbox:E,outOfStockAction:V,hideVariantCheckbox:A,selectProductsFromCustomCollection:B,renderWithoutModal:G,pickerType:W,hideProductVariants:$})})),"view"===J&&t(S,{selectedCollections:me||{},selectedCollectionsDispatch:Ce,setScreen:N,collections:Y}),"rearrange"===J&&t(C,{selectedCollections:me||{},selectedCollectionsDispatch:Ce,setScreen:N,outOfStockAction:V,rearrangeViewType:"grid"===Q?"list":"grid"}),"searchProducts"===J&&t(y,{customCollectionRestriction:k.customCollectionRestriction,selectedCollections:me||{},searchedCollections:ue||{},selectedCollectionsDispatch:Ce,setScreen:N,collections:Y,onBackPress:()=>{ne(""),pe({})},pickerType:W,hideProductCheckbox:E,hideProductVariants:$,hideVariantCheckbox:A})]})]});return t(o,{children:G?be:t(a,Object.assign({zIndex:D,open:R,onClose:()=>{null==O||O(),ge()},headingTitle:M||("collections"===J||"products"===J?"Select Products":"view"===J?"Selected Products":"searchProducts"===J?"Searched Products":"rearrange"===J?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:z||"480px"},headerRightCustomElement:"rearrange"===J?(console.log("ignore:",X),t(o,{})):t(o,{}),primaryButton:{buttonText:oe?"Loading...":J===x.RearrangeProducts?"Done":"Add",disabled:oe||re<1||F&&re>F||!1,onClick:()=>{k.onAdd(me,re),ge()}},footerLeftCustomElement:L?t(o,{}):F&&re>F?t(u,{tagText:`You can only select ${F} products`,type:"negative"}):t(l,re>0?{onClick:()=>{N(U?x.RearrangeProducts:x.SelectedProducts)},buttonText:`${re} products selected`,buttonType:["rearrange","view"].includes(J)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(J)}:{disabled:!0,buttonText:`${re} products selected`,buttonType:"tertiaryGray"})},{children:be}))})};export{k as ProductPickerModal,x as ScreenName};
@@ -18,6 +18,9 @@ interface ProductsScreenInterface {
18
18
  outOfStockAction?: OUT_OF_STOCK_ACTION;
19
19
  hideVariantCheckbox?: boolean;
20
20
  selectProductsFromCustomCollection?: boolean;
21
+ renderWithoutModal?: boolean;
22
+ pickerType?: 'COLLECTION' | 'PRODUCT';
23
+ hideProductVariants?: boolean;
21
24
  }
22
25
  export declare const ProductsScreen: (props: ProductsScreenInterface) => import("react/jsx-runtime").JSX.Element;
23
26
  interface ProductGroupInterface {
@@ -32,6 +35,8 @@ interface ProductGroupInterface {
32
35
  hideProductCheckbox?: boolean;
33
36
  outOfStockAction?: OUT_OF_STOCK_ACTION;
34
37
  hideVariantCheckbox?: boolean;
38
+ hideProductVariants?: boolean;
39
+ pickerType?: 'COLLECTION' | 'PRODUCT';
35
40
  }
36
41
  export declare const ProductGroup: (props: ProductGroupInterface) => import("react/jsx-runtime").JSX.Element;
37
42
  interface ProductCardInterface {
@@ -48,6 +53,8 @@ interface ProductCardInterface {
48
53
  hideProductCheckbox?: boolean;
49
54
  outOfStockAction?: OUT_OF_STOCK_ACTION;
50
55
  hideVariantCheckbox?: boolean;
56
+ hideProductVariants?: boolean;
57
+ pickerType?: 'COLLECTION' | 'PRODUCT';
51
58
  }
52
59
  export declare const ProductCard: (props: ProductCardInterface) => import("react/jsx-runtime").JSX.Element;
53
60
  export {};
@@ -1 +1 @@
1
- import{jsxs as t,jsx as e,Fragment as o}from"react/jsx-runtime";import i from"../../assets/icons/arrow_left.svg.js";import c from"../../assets/icons/box.svg.js";import d from"../../assets/icons/search.svg.js";import{cloneDeep as l}from"lodash";import{useContext as n,useState as r,useEffect as s}from"react";import{Tag as a}from"../tag/Tag.js";import{COLORS as u}from"../../constants/Theme.js";import{CheckBox as h}from"../checkBox/CheckBox.js";import{IconButton as p}from"../icon-button/IconButton.js";import{Input as v}from"../input/Input.js";import{BikShimmer as m}from"../shimmer/ShimmerComponent/BikShimmer.js";import{ShimmerImage as f}from"../shimmer-image/ShimmerImage.js";import{Spinner as y}from"../spinner/Spinner.js";import{BodyCaption as g,TitleRegular as b}from"../TypographyStyle.js";import{truncate as j}from"./collectionScreen.js";import{EmptyState as k}from"./emptyState.js";import{ProductHelper as C}from"./helpers/ProductHelper.js";import{CollectionIdContext as I}from"./reducers.js";import{ProductScreenHeader as O,ProductScreenCollectionCardStyle as x,ProductCardStyle as S}from"./style.js";import{OUT_OF_STOCK_ACTION as P}from"./type.js";import{liftTheStateUp as w}from"./utility.js";const D=o=>{const a=n(I),{data:f,collectionsDispatch:j,selectedData:C,selectedCollectionsDispatch:S,productFetcher:D,storeId:V,setScreen:A,setSaveDisabled:T,hideInCollectionSearch:B,customCollectionRestriction:F,hideProductCheckbox:R,outOfStockAction:U=P.BLUR,hideVariantCheckbox:H=!1,selectProductsFromCustomCollection:L=!1}=o,[W,z]=r(""),[K,N]=r(!1),[_,q]=r(f);s((()=>{const t=setTimeout((()=>{W.length?(N(!0),o.searchInCollectionFetcher(V,a,W).then((t=>{var e;const o=l(f);o.products={};for(const i of t)(null===(e=null==f?void 0:f.products)||void 0===e?void 0:e[i])&&(o.products[i]=f.products[i]);q(o),T(!1),N(!1)}))):q(f)}),800);return()=>clearTimeout(t)}),[W]);const G=!!F&&f.isSmartCollection,J=t=>{var e,o,i,c,d,l,n,r;let s=0,u=0;return!!((null===(o=null===(e=null==C?void 0:C[a])||void 0===e?void 0:e.products)||void 0===o?void 0:o[t])&&(null===(d=Object.keys((null===(c=null===(i=null==f?void 0:f.products)||void 0===i?void 0:i[t])||void 0===c?void 0:c.variants)||[]))||void 0===d||d.forEach((()=>u++)),Object.keys((null===(r=null===(n=null===(l=null==C?void 0:C[a])||void 0===l?void 0:l.products)||void 0===n?void 0:n[t])||void 0===r?void 0:r.variants)||[]).forEach((()=>s++)),s>0&&u!==s))};s((()=>{(null==f?void 0:f.products)||M()}),[]);const M=()=>{T(!0),N(!0),D(a,V).then((t=>{Object.keys(t).length&&(j({type:"productsFetched",data:{collectionId:a,products:t}}),q(Object.assign(Object.assign({},_),{products:t}))),T(!1),N(!1)})).catch()},Q=(t,e)=>{const o=w(e,f);S({type:t,data:Object.assign(Object.assign({},o),{isRestricted:F})})};return t("div",{children:[t(O,{children:[e(p,{Icon:i,height:16,onClick:()=>{A("collections")}}),e(g,Object.assign({style:{color:u.content.secondary}},{children:f.name}))]}),!B&&e("div",Object.assign({style:{padding:16,height:"76px",borderBottom:"1px solid #E0E0E0"}},{children:e(v,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>K&&W.length?e(y,{size:"small",color:u.content.primary}):e(d,{})},id:"listInput",height:"24px",type:"text",value:W,onChangeText:t=>{t.length&&t.trim().length?z(t):z("")},placeholder:"Search products in this collection..."})})),t("div",{children:[Object.keys((null==_?void 0:_.products)||[]).length>0&&!G&&!W.length&&!R&&t(x,{children:[e(h,{isChecked:!!(null==C?void 0:C[a]),isPartiallyChecked:(t=>{var e;let o=0,i=0;if(C[t]){const c=null==f?void 0:f.products;c&&Object.keys(c).forEach((t=>{var e;const i=null===(e=c[t])||void 0===e?void 0:e.variants;i&&Object.keys(i).forEach((t=>o+=1))}));const d=null===(e=C[t])||void 0===e?void 0:e.products;return d&&Object.keys(d).forEach((t=>{var e;const o=null===(e=d[t])||void 0===e?void 0:e.variants;o&&Object.keys(o).forEach((()=>i+=1))})),i>0&&o!==i}return!1})(a),onValueChange:function(t){S(t?{type:"selected",data:{id:a,val:f}}:{type:"unselected",data:{id:a}})}}),e("div",Object.assign({style:{width:40,height:40}},{children:e(c,{})})),e(b,{children:"All Products"})]}),Object.keys((null==_?void 0:_.products)||[]).length?Object.keys(_.products||[]).map((t=>e(E,{outOfStockAction:U,collectionId:a,isProductPartiallyChecked:J(t),productId:t,data:_.products[t],selectedData:C,selectedCollectionsDispatch:S,viewOnly:!L&&!!G,upliftAdditions:Q,hideProductCheckbox:R,hideVariantCheckbox:H},t))):K?[1,2,3,4,5,6,7,8,9,10].map(((t,o)=>e("div",Object.assign({style:{borderBottom:"1px solid #E0E0E0"}},{children:e(m,{boxes:[{height:"64px",width:"100%",marginTop:"0px"}]})}),o))):e(k,{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."})]})]})},E=o=>{const{collectionId:i,productId:c,data:d,selectedData:l,selectedCollectionsDispatch:n,viewOnly:r,upliftAdditions:s,isProductPartiallyChecked:a,hideProductCheckbox:u,outOfStockAction:h,hideVariantCheckbox:p}=o,v=t=>{var e,o,d,n,r,s;if(!(null===(o=null===(e=null==l?void 0:l[i])||void 0===e?void 0:e.products)||void 0===o?void 0:o[c]))return!1;return!!(null===(s=null===(r=null===(n=null===(d=null==l?void 0:l[i])||void 0===d?void 0:d.products)||void 0===n?void 0:n[c])||void 0===r?void 0:r.variants)||void 0===s?void 0:s[t])};return t("div",{children:[e(V,{isVariant:!1,data:d,productId:c,collectionId:i,isSelected:!!(null===(f=null===(m=null==l?void 0:l[i])||void 0===m?void 0:m.products)||void 0===f?void 0:f[c]),isPartiallyChecked:a,selectedCollectionsDispatch:n,upliftAdditions:s,viewOnly:r,hideProductCheckbox:u,hideVariantCheckbox:p},c),Object.keys(d.variants||[]).map((t=>e(V,{isVariant:!0,hideVariantCheckbox:p,data:d.variants[t],variantId:t,productId:c,viewOnly:r,upliftAdditions:s,collectionId:i,isSelected:v(t),selectedCollectionsDispatch:n,outOfStockAction:h},t)))]});var m,f},V=i=>{const{isVariant:c,data:d,productId:l,collectionId:n,variantId:r,isSelected:s,selectedCollectionsDispatch:u,viewOnly:p,upliftAdditions:v,isPartiallyChecked:m,hideProductCheckbox:y,outOfStockAction:g,hideVariantCheckbox:k}=i,I=C.getProductLabels(d,g);return t(S,Object.assign({isVariant:c},{children:[c&&!p&&!k||!c&&!p&&!y?e(h,{isChecked:s,isPartiallyChecked:m||!1,onValueChange:function(t){c?t?v("variantSelected",{productId:l,variantId:r,collectionId:n,variant:d}):u({type:"variantUnselected",data:{productId:l,variantId:r,collectionId:n}}):t?v("productSelected",{productId:l,collectionId:n,product:d}):u({type:"productUnselected",data:{productId:l,collectionId:n}})}}):e(o,{}),e("div",{children:e(f,{width:40,height:40,imageUrl:d.image,alt:"Item",borderRadius:4})}),t("div",Object.assign({style:{display:"flex",flexDirection:"column"}},{children:[e(b,{children:j(d.name,40,!0)}),I?e("div",Object.assign({style:{width:90,display:"flex"}},{children:e(a,{tagText:I,type:"warning",theme:"light"})})):e(o,{})]}))]}))};export{V as ProductCard,E as ProductGroup,D as ProductsScreen};
1
+ import{jsxs as t,jsx as e,Fragment as o}from"react/jsx-runtime";import i from"../../assets/icons/arrow_left.svg.js";import c from"../../assets/icons/box.svg.js";import d from"../../assets/icons/search.svg.js";import{cloneDeep as r}from"lodash";import{useContext as n,useState as l,useEffect as s}from"react";import{Tag as a}from"../tag/Tag.js";import{COLORS as u}from"../../constants/Theme.js";import{CheckBox as h}from"../checkBox/CheckBox.js";import{IconButton as p}from"../icon-button/IconButton.js";import{Input as v}from"../input/Input.js";import{BikShimmer as m}from"../shimmer/ShimmerComponent/BikShimmer.js";import{ShimmerImage as y}from"../shimmer-image/ShimmerImage.js";import{Spinner as f}from"../spinner/Spinner.js";import{BodyCaption as g,TitleRegular as k}from"../TypographyStyle.js";import{truncate as b}from"./collectionScreen.js";import{EmptyState as j}from"./emptyState.js";import{ProductHelper as C}from"./helpers/ProductHelper.js";import{CollectionIdContext as I}from"./reducers.js";import{ProductScreenHeader as O,ProductScreenCollectionCardStyle as x,ProductCardStyle as P}from"./style.js";import{OUT_OF_STOCK_ACTION as S}from"./type.js";import{liftTheStateUp as V}from"./utility.js";const w=o=>{const a=n(I),{data:y,collectionsDispatch:b,selectedData:C,selectedCollectionsDispatch:P,productFetcher:w,storeId:T,setScreen:E,setSaveDisabled:A,hideInCollectionSearch:B,customCollectionRestriction:R,hideProductCheckbox:U,outOfStockAction:F=S.BLUR,hideVariantCheckbox:H=!1,selectProductsFromCustomCollection:L=!1,pickerType:W,hideProductVariants:z}=o,[K,N]=l(""),[_,q]=l(!1),[G,J]=l(y);s((()=>{const t=setTimeout((()=>{K.length?(q(!0),o.searchInCollectionFetcher(T,a,K).then((t=>{var e;const o=r(y);o.products={};for(const i of t)(null===(e=null==y?void 0:y.products)||void 0===e?void 0:e[i])&&(o.products[i]=y.products[i]);J(o),A(!1),q(!1)}))):J(y)}),800);return()=>clearTimeout(t)}),[K]);const M=!!R&&y.isSmartCollection,Q=t=>{var e,o,i,c,d,r,n,l;let s=0,u=0;return!!((null===(o=null===(e=null==C?void 0:C[a])||void 0===e?void 0:e.products)||void 0===o?void 0:o[t])&&(null===(d=Object.keys((null===(c=null===(i=null==y?void 0:y.products)||void 0===i?void 0:i[t])||void 0===c?void 0:c.variants)||[]))||void 0===d||d.forEach((()=>u++)),Object.keys((null===(l=null===(n=null===(r=null==C?void 0:C[a])||void 0===r?void 0:r.products)||void 0===n?void 0:n[t])||void 0===l?void 0:l.variants)||[]).forEach((()=>s++)),s>0&&u!==s))};s((()=>{(null==y?void 0:y.products)||X()}),[]);const X=()=>{A(!0),q(!0),w(a,T).then((t=>{Object.keys(t).length&&(b({type:"productsFetched",data:{collectionId:a,products:t}}),J(Object.assign(Object.assign({},G),{products:t}))),A(!1),q(!1)})).catch()},Y=(t,e)=>{const o=V(e,y);P({type:t,data:Object.assign(Object.assign({},o),{isRestricted:R})})};return t("div",{children:[t(O,{children:[e(p,{Icon:i,height:16,onClick:()=>{E("collections")}}),e(g,Object.assign({style:{color:u.content.secondary}},{children:y.name}))]}),!B&&e("div",Object.assign({style:{padding:16,height:"76px",borderBottom:"1px solid #E0E0E0"}},{children:e(v,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>_&&K.length?e(f,{size:"small",color:u.content.primary}):e(d,{})},id:"listInput",height:"24px",type:"text",value:K,onChangeText:t=>{t.length&&t.trim().length?N(t):N("")},placeholder:"Search products in this collection..."})})),t("div",{children:[Object.keys((null==G?void 0:G.products)||[]).length>0&&!M&&!K.length&&!U&&t(x,{children:[e(h,{isChecked:!!(null==C?void 0:C[a]),isPartiallyChecked:(t=>{var e;let o=0,i=0;if(C[t]){const c=null==y?void 0:y.products;c&&Object.keys(c).forEach((t=>{var e;const i=null===(e=c[t])||void 0===e?void 0:e.variants;i&&Object.keys(i).forEach((t=>o+=1))}));const d=null===(e=C[t])||void 0===e?void 0:e.products;return d&&Object.keys(d).forEach((t=>{var e;const o=null===(e=d[t])||void 0===e?void 0:e.variants;o&&Object.keys(o).forEach((()=>i+=1))})),i>0&&o!==i}return!1})(a),onValueChange:function(t){P(t?{type:"selected",data:{id:a,val:y}}:{type:"unselected",data:{id:a}})}}),e("div",Object.assign({style:{width:40,height:40}},{children:e(c,{})})),e(k,{children:"All Products"})]}),Object.keys((null==G?void 0:G.products)||[]).length?Object.keys(G.products||[]).map((t=>e(D,{outOfStockAction:F,collectionId:a,isProductPartiallyChecked:Q(t),productId:t,data:G.products[t],selectedData:C,selectedCollectionsDispatch:P,viewOnly:!L&&!!M,upliftAdditions:Y,hideProductCheckbox:U,hideVariantCheckbox:H,hideProductVariants:z,pickerType:W},t))):_?[1,2,3,4,5,6,7,8,9,10].map(((t,o)=>e("div",Object.assign({style:{borderBottom:"1px solid #E0E0E0"}},{children:e(m,{boxes:[{height:"64px",width:"100%",marginTop:"0px"}]})}),o))):e(j,{title:"No products to show",subtitle:K.length?"We couldn't find the product you were looking for":"We couldn’t find any product in this collection."})]})]})},D=o=>{const{collectionId:i,productId:c,data:d,selectedData:r,selectedCollectionsDispatch:n,viewOnly:l,upliftAdditions:s,isProductPartiallyChecked:a,hideProductCheckbox:u,outOfStockAction:h,hideVariantCheckbox:p,hideProductVariants:v,pickerType:m}=o,y=t=>{var e,o,d,n,l,s;if(!(null===(o=null===(e=null==r?void 0:r[i])||void 0===e?void 0:e.products)||void 0===o?void 0:o[c]))return!1;return!!(null===(s=null===(l=null===(n=null===(d=null==r?void 0:r[i])||void 0===d?void 0:d.products)||void 0===n?void 0:n[c])||void 0===l?void 0:l.variants)||void 0===s?void 0:s[t])};return t("div",{children:[e(T,{isVariant:!1,data:d,productId:c,collectionId:i,isSelected:!!(null===(g=null===(f=null==r?void 0:r[i])||void 0===f?void 0:f.products)||void 0===g?void 0:g[c]),isPartiallyChecked:a,selectedCollectionsDispatch:n,upliftAdditions:s,viewOnly:l,hideProductCheckbox:u,hideVariantCheckbox:p,hideProductVariants:v,pickerType:m},c),v?null:Object.keys(d.variants||[]).map((t=>e(T,{isVariant:!0,hideVariantCheckbox:p,data:d.variants[t],variantId:t,productId:c,viewOnly:l,upliftAdditions:s,collectionId:i,isSelected:y(t),selectedCollectionsDispatch:n,outOfStockAction:h},t)))]});var f,g},T=i=>{const{isVariant:c,data:d,productId:r,collectionId:n,variantId:l,isSelected:s,selectedCollectionsDispatch:u,viewOnly:p,upliftAdditions:v,isPartiallyChecked:m,hideProductCheckbox:f,outOfStockAction:g,hideVariantCheckbox:j,hideProductVariants:I,pickerType:O}=i,x=C.getProductLabels(d,g);return t(P,Object.assign({isVariant:c,onClick:t=>{"PRODUCT"===O&&I&&(t.stopPropagation(),u({type:"reset",data:{}}),v("variantSelected",{productId:r,variantId:l||Object.keys(d.variants)[0],collectionId:n,variant:d}))},isActive:s},{children:[c&&!p&&!j||!c&&!p&&!f?e(h,{isChecked:s,isPartiallyChecked:m||!1,onValueChange:function(t){c?t?v("variantSelected",{productId:r,variantId:l,collectionId:n,variant:d}):u({type:"variantUnselected",data:{productId:r,variantId:l,collectionId:n}}):t?v("productSelected",{productId:r,collectionId:n,product:d}):u({type:"productUnselected",data:{productId:r,collectionId:n}})}}):e(o,{}),e("div",{children:e(y,{width:40,height:40,imageUrl:d.image,alt:"Item",borderRadius:4})}),t("div",Object.assign({style:{display:"flex",flexDirection:"column"}},{children:[e(k,{children:b(d.name,40,!0)}),x?e("div",Object.assign({style:{width:90,display:"flex"}},{children:e(a,{tagText:x,type:"warning",theme:"light"})})):e(o,{})]}))]}))};export{T as ProductCard,D as ProductGroup,w as ProductsScreen};
@@ -11,6 +11,10 @@ interface SearchScreenInterface {
11
11
  [key: string]: Collection;
12
12
  };
13
13
  onBackPress: () => void;
14
+ hideVariantCheckbox?: boolean;
15
+ pickerType?: 'COLLECTION' | 'PRODUCT';
16
+ hideProductVariants?: boolean;
17
+ hideProductCheckbox?: boolean;
14
18
  }
15
19
  export declare const SearchScreen: (props: SearchScreenInterface) => import("react/jsx-runtime").JSX.Element;
16
20
  export {};
@@ -1 +1 @@
1
- import{jsxs as o,jsx as t,Fragment as e}from"react/jsx-runtime";import i from"../../assets/icons/arrow_left.svg.js";import{IconButton as l}from"../icon-button/IconButton.js";import{BodyCaption as r}from"../TypographyStyle.js";import{EmptyState as s}from"./emptyState.js";import{ProductGroup as c}from"./productScreen.js";import{SelectedScreenHeader as d}from"./style.js";import{liftTheStateUp as n}from"./utility.js";const u=u=>{const{customCollectionRestriction:v,selectedCollections:a,searchedCollections:p,selectedCollectionsDispatch:m,setScreen:h,collections:f,onBackPress:j}=u,y=(o,t)=>{var e,i,l,r,s,c,d,n,u;let v=0,p=0;return!!((null===(i=null===(e=null==a?void 0:a[o])||void 0===e?void 0:e.products)||void 0===i?void 0:i[t])&&(null===(c=Object.keys((null===(s=null===(r=null===(l=null==f?void 0:f[o])||void 0===l?void 0:l.products)||void 0===r?void 0:r[t])||void 0===s?void 0:s.variants)||[]))||void 0===c||c.forEach((()=>p++)),Object.keys((null===(u=null===(n=null===(d=null==a?void 0:a[o])||void 0===d?void 0:d.products)||void 0===n?void 0:n[t])||void 0===u?void 0:u.variants)||[]).forEach((()=>v++)),v>0&&p!==v))};return o("div",{children:[o(d,{children:[t(l,{Icon:i,onClick:()=>{h("collections"),j()}}),t(r,{children:"Searched Products"})]}),t("div",{children:Object.keys(p).length?t(e,{children:Object.keys(p).map((o=>{var e;return Object.keys((null===(e=null==p?void 0:p[o])||void 0===e?void 0:e.products)||[]).map((e=>{let i=!1;return(null==p?void 0:p.isCustom)&&(i=!0),t(c,{collectionId:o,upliftAdditions:(t,e)=>((o,t,e)=>{const i=n(e,p[o]);m({type:t,data:Object.assign(Object.assign({},i),{isRestricted:v})})})(o,t,e),productId:e,data:p[o].products[e],isProductPartiallyChecked:y(o,e),selectedData:a,selectedCollectionsDispatch:m,viewOnly:i},e)}))}))}):t(s,{title:"No search results found",subtitle:"We couldn’t find the product you were looking for."})})]})};export{u as SearchScreen};
1
+ import{jsxs as o,jsx as t,Fragment as e}from"react/jsx-runtime";import i from"../../assets/icons/arrow_left.svg.js";import{IconButton as r}from"../icon-button/IconButton.js";import{BodyCaption as l}from"../TypographyStyle.js";import{EmptyState as c}from"./emptyState.js";import{ProductGroup as d}from"./productScreen.js";import{SelectedScreenHeader as s}from"./style.js";import{liftTheStateUp as n}from"./utility.js";const u=u=>{const{customCollectionRestriction:a,selectedCollections:v,searchedCollections:p,selectedCollectionsDispatch:h,setScreen:m,collections:y,onBackPress:f,hideVariantCheckbox:j,pickerType:k,hideProductVariants:b,hideProductCheckbox:C}=u,O=(o,t)=>{var e,i,r,l,c,d,s,n,u;let a=0,p=0;return!!((null===(i=null===(e=null==v?void 0:v[o])||void 0===e?void 0:e.products)||void 0===i?void 0:i[t])&&(null===(d=Object.keys((null===(c=null===(l=null===(r=null==y?void 0:y[o])||void 0===r?void 0:r.products)||void 0===l?void 0:l[t])||void 0===c?void 0:c.variants)||[]))||void 0===d||d.forEach((()=>p++)),Object.keys((null===(u=null===(n=null===(s=null==v?void 0:v[o])||void 0===s?void 0:s.products)||void 0===n?void 0:n[t])||void 0===u?void 0:u.variants)||[]).forEach((()=>a++)),a>0&&p!==a))};return o("div",{children:[o(s,{children:[t(r,{Icon:i,onClick:()=>{m("collections"),f()}}),t(l,{children:"Searched Products"})]}),t("div",{children:Object.keys(p).length?t(e,{children:Object.keys(p).map((o=>{var e;return Object.keys((null===(e=null==p?void 0:p[o])||void 0===e?void 0:e.products)||[]).map((e=>{let i=!1;return(null==p?void 0:p.isCustom)&&(i=!0),t(d,{collectionId:o,upliftAdditions:(t,e)=>((o,t,e)=>{const i=n(e,p[o]);h({type:t,data:Object.assign(Object.assign({},i),{isRestricted:a})})})(o,t,e),productId:e,data:p[o].products[e],isProductPartiallyChecked:O(o,e),selectedData:v,selectedCollectionsDispatch:h,viewOnly:i,hideProductCheckbox:C,hideVariantCheckbox:j,hideProductVariants:b,pickerType:k},e)}))}))}):t(c,{title:"No search results found",subtitle:"We couldn’t find the product you were looking for."})})]})};export{u as SearchScreen};
@@ -2,6 +2,7 @@ export declare const ContainerStyle: import("styled-components").StyledComponent
2
2
  export declare const ScrollContainerStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
3
3
  export declare const CollectionCardStyle: import("styled-components").StyledComponent<"div", any, {
4
4
  isDisabled: boolean;
5
+ isActive: boolean;
5
6
  }, never>;
6
7
  export declare const CollectionCardInfoStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
7
8
  export declare const CollectionCardDetailStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -9,6 +10,7 @@ export declare const ProductScreenHeader: import("styled-components").StyledComp
9
10
  export declare const ProductScreenCollectionCardStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
10
11
  export declare const ProductCardStyle: import("styled-components").StyledComponent<"div", any, {
11
12
  isVariant: boolean;
13
+ isActive: boolean;
12
14
  }, never>;
13
15
  export declare const SelectedScreenHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
14
16
  export declare const CollectionNameHolder: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -4,12 +4,12 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
4
4
  max-height: 600px;
5
5
  min-height: 600px;
6
6
  flex-direction: column;
7
- `,n=e.div`
7
+ `,o=e.div`
8
8
  overflow-y: scroll;
9
9
  overflow-x: hidden;
10
- `,o=e.div`
10
+ `,n=e.div`
11
11
  height: 64px;
12
- background-color: ${e=>e.isDisabled?"#F0F0F0":"white"};
12
+ background-color: ${e=>e.isDisabled?"#F0F0F0":e.isActive?i.background.positive.light:"white"};
13
13
  border-bottom: 1px solid #e0e0e0;
14
14
  padding: 12px 24px;
15
15
  display: flex;
@@ -17,17 +17,21 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
17
17
  column-gap: 16px;
18
18
  justify-content: space-between;
19
19
  align-items: center;
20
- `,d=e.div`
20
+ :hover {
21
+ cursor: pointer;
22
+ background-color: ${i.surface.hovered};
23
+ }
24
+ `,r=e.div`
21
25
  display: flex;
22
26
  flex-direction: row;
23
27
  justify-content: center;
24
28
  align-items: center;
25
29
  column-gap: 18px;
26
- `,l=e.div`
30
+ `,d=e.div`
27
31
  display: flex;
28
32
  flex-direction: column;
29
33
  justify-content: center;
30
- `,p=e.div`
34
+ `,l=e.div`
31
35
  display: flex;
32
36
  flex-direction: row;
33
37
  max-height: 32px;
@@ -37,16 +41,16 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
37
41
  align-items: center;
38
42
  padding: 8px 16px;
39
43
  margin-top: 16px;
40
- `,x=e.div`
44
+ `,p=e.div`
41
45
  display: flex;
42
46
  flex-direction: row;
43
47
  column-gap: 16px;
44
48
  padding: 12px 16px;
45
49
  border-bottom: 1px solid #e0e0e0;
46
50
  align-items: center;
47
- `,r=e.div`
51
+ `,x=e.div`
48
52
  height: 64px;
49
- background-color: white;
53
+ background-color: ${e=>e.isActive?i.background.positive.light:"white"};
50
54
  border-bottom: 1px solid #e0e0e0;
51
55
  padding: 12px 16px;
52
56
  display: flex;
@@ -55,7 +59,11 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
55
59
  justify-content: flex-start;
56
60
  align-items: center;
57
61
  padding-left: ${e=>e.isVariant?"42px":"16px"};
58
- `,a=e.div`
62
+ :hover {
63
+ cursor: pointer;
64
+ background-color: ${i.surface.hovered};
65
+ }
66
+ `,c=e.div`
59
67
  display: flex;
60
68
  flex-direction: row;
61
69
  max-height: 32px;
@@ -64,7 +72,7 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
64
72
  justify-content: flex-start;
65
73
  align-items: center;
66
74
  padding: 8px 16px;
67
- `,c=e.div`
75
+ `,a=e.div`
68
76
  display: flex;
69
77
  flex-direction: column;
70
78
  `,s=e.div`
@@ -99,4 +107,4 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
99
107
  align-items: center;
100
108
  border: 1px solid ${i.stroke.primary};
101
109
  border-radius: 4px;
102
- `;export{l as CollectionCardDetailStyle,d as CollectionCardInfoStyle,o as CollectionCardStyle,c as CollectionNameHolder,t as ContainerStyle,r as ProductCardStyle,x as ProductScreenCollectionCardStyle,p as ProductScreenHeader,n as ScrollContainerStyle,a as SelectedScreenHeader,g as VariantCardGridStyle,s as VariantCardListStyle};
110
+ `;export{d as CollectionCardDetailStyle,r as CollectionCardInfoStyle,n as CollectionCardStyle,a as CollectionNameHolder,t as ContainerStyle,x as ProductCardStyle,p as ProductScreenCollectionCardStyle,l as ProductScreenHeader,o as ScrollContainerStyle,c as SelectedScreenHeader,g as VariantCardGridStyle,s as VariantCardListStyle};
@@ -7,4 +7,5 @@ export type ShimmerImageProps = {
7
7
  borderRadius?: number;
8
8
  defaultImageUrl?: string;
9
9
  };
10
+ export declare const DEFAULT_IMAGE = "https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F9034204a-cbf9-4b93-8b28-ccf880d273f9?alt=media&token=318529b5-8df0-4644-85b0-40fff1dc1d5c";
10
11
  export declare const ShimmerImage: React.FC<ShimmerImageProps>;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as t,useEffect as i}from"react";import{BikShimmer as o}from"../shimmer/ShimmerComponent/BikShimmer.js";const a="https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F9034204a-cbf9-4b93-8b28-ccf880d273f9?alt=media&token=318529b5-8df0-4644-85b0-40fff1dc1d5c",l=l=>{let{imageUrl:s,width:d,height:n,borderRadius:m,alt:h,defaultImageUrl:c=a}=l;const[g,p]=t(!0),[b,u]=t(!1);return i((()=>{const e=new Image;return e.src=s,e.onload=()=>{u(!1),p(!1)},e.onerror=()=>{u(!0),p(!1)},()=>{e.onload=null,e.onerror=null}}),[s]),e("div",Object.assign({style:{position:"relative",width:d,height:n,borderRadius:m}},{children:[g&&r(o,{boxes:[{height:`${n}px`,width:`${d}px`,marginTop:"0px"}]}),r("img",b?{src:c,alt:null!=h?h:"Image",style:{borderRadius:null!=m?m:0,display:"block",width:"100%",height:"100%"}}:{src:s,alt:null!=h?h:"Image",style:{borderRadius:null!=m?m:0,display:g?"none":"block",width:"100%",height:"100%"}})]}))};export{l as ShimmerImage};
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as t,useEffect as i}from"react";import{BikShimmer as o}from"../shimmer/ShimmerComponent/BikShimmer.js";const a="https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F9034204a-cbf9-4b93-8b28-ccf880d273f9?alt=media&token=318529b5-8df0-4644-85b0-40fff1dc1d5c",l=l=>{let{imageUrl:s,width:d,height:n,borderRadius:m,alt:h,defaultImageUrl:c=a}=l;const[g,p]=t(!0),[b,u]=t(!1);return i((()=>{const e=new Image;return e.src=s,e.onload=()=>{u(!1),p(!1)},e.onerror=()=>{u(!0),p(!1)},()=>{e.onload=null,e.onerror=null}}),[s]),e("div",Object.assign({style:{position:"relative",width:d,height:n,borderRadius:m}},{children:[g&&r(o,{boxes:[{height:`${n}px`,width:`${d}px`,marginTop:"0px"}]}),r("img",b?{src:c,alt:null!=h?h:"Image",style:{borderRadius:null!=m?m:0,display:"block",width:"100%",height:"100%"}}:{src:s,alt:null!=h?h:"Image",style:{borderRadius:null!=m?m:0,display:g?"none":"block",width:"100%",height:"100%"}})]}))};export{a as DEFAULT_IMAGE,l as ShimmerImage};
@@ -7,9 +7,11 @@ export interface SideModalProps {
7
7
  footerDirection?: 'row' | 'row-reverse';
8
8
  hideCrossButton?: boolean;
9
9
  width?: string;
10
- saveButtonProps: ButtonProps;
11
- cancelButtonProps: ButtonProps;
10
+ saveButtonProps?: ButtonProps;
11
+ cancelButtonProps?: ButtonProps;
12
12
  onClose: () => void;
13
13
  zIndex?: number;
14
+ hideFooter?: boolean;
15
+ bodyStyle?: React.CSSProperties;
14
16
  }
15
17
  export declare const SideModal: React.FC<SideModalProps>;
@@ -1 +1 @@
1
- import{jsx as o,jsxs as t,Fragment as e}from"react/jsx-runtime";import r from"react-dom";import i from"../../assets/icons/cross.svg.js";import{Button as n}from"../button/Button.js";import{TitleMedium as s}from"../TypographyStyle.js";import{SideModalStyle as c,SideModalContainer as d,SideModalHeader as m,SideModalBody as a,SideModalFooter as h,FooterButtonWrapper as l}from"./SideModal.style.js";const p=p=>r.createPortal(o(c,Object.assign({zIndex:p.zIndex},{children:t(d,Object.assign({width:p.width},{children:[t(m,{children:[o(s,{children:p.header}),!p.hideCrossButton&&o(i,{width:24,height:24,onClick:p.onClose})]}),o(a,{children:p.children}),t(h,Object.assign({footerDirection:p.footerDirection},{children:[t(l,Object.assign({footerDirection:p.footerDirection},{children:[o(n,Object.assign({},p.saveButtonProps)),o(n,Object.assign({},p.cancelButtonProps))]})),p.footerCustomComponent?p.footerCustomComponent:o(e,{})]}))]}))})),document.body);export{p as SideModal};
1
+ import{jsx as o,jsxs as t,Fragment as e}from"react/jsx-runtime";import r from"react-dom";import i from"../../assets/icons/cross.svg.js";import{Button as n}from"../button/Button.js";import{TitleMedium as s}from"../TypographyStyle.js";import{SideModalStyle as c,SideModalContainer as d,SideModalHeader as h,SideModalBody as l,SideModalFooter as m,FooterButtonWrapper as a}from"./SideModal.style.js";const j=j=>r.createPortal(o(c,Object.assign({zIndex:j.zIndex},{children:t(d,Object.assign({width:j.width},{children:[t(h,{children:[o(s,{children:j.header}),!j.hideCrossButton&&o(i,{width:24,height:24,onClick:j.onClose})]}),o(l,Object.assign({hideFooter:j.hideFooter,bodyStyle:Object.assign({},j.bodyStyle)},{children:j.children})),!0===j.hideFooter?null:t(m,Object.assign({footerDirection:j.footerDirection},{children:[t(a,Object.assign({footerDirection:j.footerDirection},{children:[o(n,Object.assign({},j.saveButtonProps)),o(n,Object.assign({},j.cancelButtonProps))]})),j.footerCustomComponent?j.footerCustomComponent:o(e,{})]}))]}))})),document.body);export{j as SideModal};
@@ -5,7 +5,10 @@ export declare const SideModalContainer: import("styled-components").StyledCompo
5
5
  width?: string | undefined;
6
6
  }, never>;
7
7
  export declare const SideModalHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
8
- export declare const SideModalBody: import("styled-components").StyledComponent<"div", any, {}, never>;
8
+ export declare const SideModalBody: import("styled-components").StyledComponent<"div", any, {
9
+ hideFooter?: boolean | undefined;
10
+ bodyStyle: React.CSSProperties;
11
+ }, never>;
9
12
  export declare const SideModalFooter: import("styled-components").StyledComponent<"div", any, {
10
13
  footerDirection?: "row" | "row-reverse" | undefined;
11
14
  }, never>;
@@ -1,22 +1,22 @@
1
- import t from"styled-components";import{COLORS as i}from"../../constants/Theme.js";import{ComponentZindex as e}from"../../constants/zindex.js";const o=t.div`
1
+ import e,{css as t}from"styled-components";import{COLORS as i}from"../../constants/Theme.js";import{ComponentZindex as o}from"../../constants/zindex.js";const r=e.div`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;
5
- z-index: ${t=>t.zIndex||e.SIDE_MODAL};
5
+ z-index: ${e=>e.zIndex||o.SIDE_MODAL};
6
6
  height: 100%;
7
7
  width: 100%;
8
8
  background-color: rgba(0, 0, 0, 0.4);
9
9
  display: flex;
10
10
  align-items: center;
11
11
  justify-content: flex-end;
12
- `,r=t.div`
12
+ `,n=e.div`
13
13
  height: 100%;
14
- width: ${t=>t.width||"566px"};
14
+ width: ${e=>e.width||"566px"};
15
15
  background: ${i.surface.standard};
16
16
  position: relative;
17
17
  display: flex;
18
18
  flex-direction: column;
19
- `,n=t.div`
19
+ `,d=e.div`
20
20
  width: 100%;
21
21
  height: 60px;
22
22
  position: sticky;
@@ -31,24 +31,27 @@ import t from"styled-components";import{COLORS as i}from"../../constants/Theme.j
31
31
  svg:hover {
32
32
  cursor: pointer;
33
33
  }
34
- `,d=t.div`
34
+ `,s=e.div`
35
35
  overflow-y: auto;
36
36
  padding: 24px;
37
- height: calc(100% - 120px);
38
- `,s=t.div`
37
+ height: ${e=>e.hideFooter?"calc(100% - 60px)":"calc(100% - 120px)"};
38
+ ${e=>{let{bodyStyle:i}=e;return t`
39
+ ${Object.keys(i).map((e=>`${e}: ${i[e]};`)).join("\n")}
40
+ `}}
41
+ `,p=e.div`
39
42
  height: 60px;
40
43
  width: 100%;
41
44
  position: sticky;
42
45
  bottom: 0;
43
46
  display: flex;
44
- flex-direction: ${t=>t.footerDirection||"row"};
47
+ flex-direction: ${e=>e.footerDirection||"row"};
45
48
  justify-content: space-between;
46
49
  align-items: center;
47
50
  background: ${i.surface.standard};
48
51
  border-top: 1px solid ${i.stroke.primary};
49
52
  padding: 0px 24px;
50
- `,p=t.div`
53
+ `,a=e.div`
51
54
  display: flex;
52
- flex-direction: ${t=>t.footerDirection||"row"};
55
+ flex-direction: ${e=>e.footerDirection||"row"};
53
56
  gap: 8px;
54
- `;export{p as FooterButtonWrapper,d as SideModalBody,r as SideModalContainer,s as SideModalFooter,n as SideModalHeader,o as SideModalStyle};
57
+ `;export{a as FooterButtonWrapper,s as SideModalBody,n as SideModalContainer,p as SideModalFooter,d as SideModalHeader,r as SideModalStyle};
@@ -3,7 +3,7 @@ import { CHANNEL_TYPE } from '../template-preview/models/Channels';
3
3
  import { EmailTemplateType } from '../template-preview/models/EmailTemplate';
4
4
  import { SMSTemplateType } from '../template-preview/models/SmsTemplate';
5
5
  import { CUSTOM_VARIABLE, GlobalPlaceholderType } from '../template-preview/models/TemplateMeta';
6
- import { WhatsAppPickerMeta, WhatsAppTemplate, WhatsAppTemplateVariables } from '../template-preview/models/WhatsAppTemplate';
6
+ import { ExtrasWhatsapp, POD, WhatsAppPickerMeta, WhatsAppTemplate, WhatsAppTemplateVariables } from '../template-preview/models/WhatsAppTemplate';
7
7
  export interface TemplateContextMapperProps {
8
8
  selectedTemplate: WhatsAppTemplate | EmailTemplateType | SMSTemplateType;
9
9
  closeDialog?: () => void;
@@ -11,7 +11,7 @@ export interface TemplateContextMapperProps {
11
11
  channel: CHANNEL_TYPE;
12
12
  globalPlaceholders: GlobalPlaceholderType;
13
13
  /** List of variables being used in this template */
14
- templateVariables: CUSTOM_VARIABLE[];
14
+ templateVariables: CUSTOM_VARIABLE[] | WhatsAppTemplateVariables;
15
15
  /** Only for initial-UI-purpose for the modal */
16
16
  htmlContent: string;
17
17
  showOnlyContent?: boolean;
@@ -20,10 +20,14 @@ export interface TemplateContextMapperProps {
20
20
  zIndex?: number;
21
21
  showVariableModal?: boolean;
22
22
  variableList?: VariableListInterfaceV2[];
23
+ variableListForImage?: VariableListInterfaceV2[];
23
24
  onBackPress?: () => void;
24
25
  discountCode?: string;
25
26
  setDiscountCode?: (code: string) => void;
26
27
  enabledCustomText?: boolean;
28
+ showSampleValues?: boolean;
27
29
  disableEditVariable?: boolean;
30
+ pod?: POD;
31
+ extras?: ExtrasWhatsapp;
28
32
  }
29
- export declare const TemplateContextMapper: ({ selectedTemplate, closeDialog, showVariableMapping, channel, htmlContent, templateVariables, onTemplateSelect, globalPlaceholders, showOnlyContent, whatsappSpecificPickerMeta, zIndex, showVariableModal, variableList, discountCode, setDiscountCode, onBackPress, enabledCustomText, disableEditVariable, }: TemplateContextMapperProps) => import("react/jsx-runtime").JSX.Element;
33
+ export declare const TemplateContextMapper: ({ selectedTemplate, closeDialog, showVariableMapping, channel, htmlContent, templateVariables, onTemplateSelect, globalPlaceholders, showOnlyContent, whatsappSpecificPickerMeta, zIndex, showVariableModal, variableList, discountCode, setDiscountCode, onBackPress, enabledCustomText, variableListForImage, showSampleValues, disableEditVariable, pod, extras, }: TemplateContextMapperProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t,Fragment as l}from"react/jsx-runtime";import{useEffect as o,useState as a,useMemo as i}from"react";import n from"../../utils/StringUtils.js";import{StyledModal as r}from"../modals/styledModal.js";import{CHANNEL_TYPE as s}from"../template-preview/models/Channels.js";import{TemplateModalContext as d}from"./context/templateModalContext.js";import c from"./modalElements/Footer.js";import m from"./modalElements/TemplateSelectModalContent.js";import{convertPlaceholdersToBikDropdown as p}from"./utils/convertPlaceholdersToBikDropdown.js";const u=u=>{let{selectedTemplate:b,closeDialog:h,showVariableMapping:g,channel:v,htmlContent:C,templateVariables:f,onTemplateSelect:M,globalPlaceholders:S,showOnlyContent:T,whatsappSpecificPickerMeta:j,zIndex:w,showVariableModal:P,variableList:E,discountCode:V,setDiscountCode:x,onBackPress:L,enabledCustomText:y,disableEditVariable:k}=u;var D,I;o((()=>{B(C)}),[C]);const[A,O]=a(v===s.EMAIL?"desktop":"mobile"),[z,B]=a(C),[F,H]=a(!1),[$,N]=a(b),[U,W]=a(null!=f?f:[]),[_,q]=a(!1);const G=i((()=>p(S)),[S]);return e(d.Provider,Object.assign({value:{template:$,setTemplate:N,device:A,setDevice:O,display_content:z,setDisplayContent:B,originalVariableList:U,setOriginalVariableList:W,isError:F,setIsError:H,channel:v,globalNormalizedPlaceholders:G,templateSelectionTriggered:_,setTemplateSelectionTriggered:q,enabledCustomText:y,disableEditVariable:k}},{children:T?e(m,{channel:s.EMAIL,hideHeader:!0}):t(r,Object.assign({zIndex:w,centralContainerStyles:{width:v===s.EMAIL&&g?1e3:650},open:!0,onClose:()=>{null==h||h()},headingTitle:null==$?void 0:$.label,headingSubtitle:v===s.WHATSAPP?`${n.capitaliseFirstLetterOfString(null!==(D=null==$?void 0:$.category)&&void 0!==D?D:"")} • ${null!==(I=null==$?void 0:$.templateCategory)&&void 0!==I?I:""}`:"",onBackPress:()=>{null==L||L()}},{children:[e(m,{showVariableMapping:g,channel:v,whatsappSpecificPickerMeta:j,showVariableModal:P,variableList:E,discountCode:V,setDiscountCode:x}),M?e(c,{onSelect:function(){const e=null==M?void 0:M($,U,null!=z?z:"");e?H(!!e):q(!0)}}):e(l,{})]}))}))};export{u as TemplateContextMapper};
1
+ import{jsx as e,jsxs as t,Fragment as l}from"react/jsx-runtime";import{useEffect as o,useState as a,useMemo as i}from"react";import r from"../../utils/StringUtils.js";import{StyledModal as s}from"../modals/styledModal.js";import{CHANNEL_TYPE as n}from"../template-preview/models/Channels.js";import{TemplateModalContext as d}from"./context/templateModalContext.js";import c from"./modalElements/Footer.js";import m from"./modalElements/TemplateSelectModalContent.js";import{convertPlaceholdersToBikDropdown as p}from"./utils/convertPlaceholdersToBikDropdown.js";const u=u=>{let{selectedTemplate:h,closeDialog:b,showVariableMapping:g,channel:v,htmlContent:C,templateVariables:S,onTemplateSelect:f,globalPlaceholders:w,showOnlyContent:M,whatsappSpecificPickerMeta:T,zIndex:V,showVariableModal:j,variableList:x,discountCode:L,setDiscountCode:P,onBackPress:E,enabledCustomText:I,variableListForImage:y,showSampleValues:k,disableEditVariable:D,pod:A,extras:O}=u;var F,z;o((()=>{N(C)}),[C]);const[B,H]=a(v===n.EMAIL?"desktop":"mobile"),[$,N]=a(C),[U,W]=a(!1),[_,q]=a(h),[G,J]=a(null!=S?S:[]),[K,Q]=a(!1);const R=i((()=>p(w)),[w]);return e(d.Provider,Object.assign({value:{template:_,setTemplate:q,device:B,setDevice:H,display_content:$,setDisplayContent:N,originalVariableList:G,setOriginalVariableList:J,isError:U,setIsError:W,channel:v,globalNormalizedPlaceholders:R,templateSelectionTriggered:K,setTemplateSelectionTriggered:Q,enabledCustomText:I,disableEditVariable:D,pod:A,extras:O}},{children:M?e(m,{channel:n.EMAIL,hideHeader:!0}):t(s,Object.assign({zIndex:V,centralContainerStyles:{width:v===n.EMAIL&&g?1e3:700},open:!0,onClose:()=>{null==b||b()},headingTitle:null==_?void 0:_.label,headingSubtitle:v===n.WHATSAPP?`${r.capitaliseFirstLetterOfString(null!==(F=null==_?void 0:_.category)&&void 0!==F?F:"")} • ${null!==(z=null==_?void 0:_.templateCategory)&&void 0!==z?z:""}`:"",onBackPress:()=>{null==E||E()}},{children:[e(m,{showSampleValues:k,showVariableMapping:g,channel:v,whatsappSpecificPickerMeta:T,showVariableModal:j,variableList:x,discountCode:L,setDiscountCode:P,variableListForImage:y&&(null==y?void 0:y.length)>0?y:x}),f?e(c,{onSelect:function(){const e=null==f?void 0:f(_,G,null!=$?$:"");e?W(!!e):Q(!0)}}):e(l,{})]}))}))};export{u as TemplateContextMapper};
@@ -3,7 +3,7 @@ import { CHANNEL_TYPE } from "../../template-preview/models/Channels";
3
3
  import { EmailTemplateType } from "../../template-preview/models/EmailTemplate";
4
4
  import { SMSTemplateType } from "../../template-preview/models/SmsTemplate";
5
5
  import { CUSTOM_VARIABLE, globalNormalizedPlaceholdersType } from "../../template-preview/models/TemplateMeta";
6
- import { WhatsAppTemplate, WhatsAppTemplateVariables } from "../../template-preview/models/WhatsAppTemplate";
6
+ import { ExtrasWhatsapp, WhatsAppTemplate, WhatsAppTemplateVariables } from "../../template-preview/models/WhatsAppTemplate";
7
7
  export type DEVICE_TYPES = 'desktop' | 'mobile';
8
8
  export declare const TemplateModalContext: React.Context<{
9
9
  device: DEVICE_TYPES;
@@ -23,6 +23,8 @@ export declare const TemplateModalContext: React.Context<{
23
23
  setTemplateSelectionTriggered?: React.Dispatch<React.SetStateAction<boolean>> | undefined;
24
24
  enabledCustomText?: boolean | undefined;
25
25
  disableEditVariable?: boolean | undefined;
26
+ pod?: string | undefined;
27
+ extras?: ExtrasWhatsapp | undefined;
26
28
  }>;
27
29
  export declare const useTemplateModalContext: () => {
28
30
  device: DEVICE_TYPES;
@@ -42,4 +44,6 @@ export declare const useTemplateModalContext: () => {
42
44
  setTemplateSelectionTriggered?: React.Dispatch<React.SetStateAction<boolean>> | undefined;
43
45
  enabledCustomText?: boolean | undefined;
44
46
  disableEditVariable?: boolean | undefined;
47
+ pod?: string | undefined;
48
+ extras?: ExtrasWhatsapp | undefined;
45
49
  };
@@ -0,0 +1,4 @@
1
+ export declare const BackTrackComponent: (props: {
2
+ backTrackMessage?: string | undefined;
3
+ setBackTrackMessage?: ((backTrackMessage: string) => void) | undefined;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import{useState as i}from"react";import{CheckBox as a}from"../../checkBox/CheckBox.js";import{TitleSmall as n}from"../../TypographyStyle.js";import{Input as s}from"../../input/Input.js";const c=c=>{const{backTrackMessage:o,setBackTrackMessage:l}=c,[m,g]=i(!!o);return e(r,{children:[e("div",Object.assign({style:{display:"flex",flexDirection:"row",marginLeft:10,marginTop:8,width:"300px"}},{children:[t(a,{isChecked:m,onValueChange:()=>{m&&l&&l(""),g(!m)}}),t(n,Object.assign({style:{marginLeft:8}},{children:"Prevent BackTracking"}))]})),m&&t("div",Object.assign({style:{margin:10}},{children:t(s,{type:"multiline",placeholder:"Enter your text here",labelText:"Message if user tries backtracking",onChangeText:e=>{l&&l(e)},height:"120px",maxCharLimit:1024,value:o,noErrorHint:!0,validate:e=>[!0,""]})}))]})};export{c as BackTrackComponent};
@@ -6,8 +6,10 @@ export interface BodyProps {
6
6
  whatsappSpecificPickerMeta?: WhatsAppPickerMeta;
7
7
  showVariableModal?: boolean;
8
8
  variableList?: VariableListInterfaceV2[];
9
+ variableListForImage?: VariableListInterfaceV2[];
9
10
  discountCode?: string;
10
11
  setDiscountCode?: (code: string) => void;
12
+ showSampleValues?: boolean;
11
13
  }
12
14
  declare const Body: (props: BodyProps) => import("react/jsx-runtime").JSX.Element;
13
15
  export default Body;
@@ -1,7 +1,7 @@
1
- import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useRef as n}from"react";import l from"styled-components";import{CHANNEL_TYPE as i}from"../../template-preview/models/Channels.js";import{COLORS as a}from"../../../constants/Theme.js";import{useTemplateModalContext as r}from"../context/templateModalContext.js";import{getVariableNameForEmailByIndex as s}from"../utils/getVariableNameEmail.js";import{highlightFor as p}from"../utils/highlightFor.js";import d from"./DesktopPreview.js";import m from"./EditWhatsAppTemplateV2.js";import c from"./MobilePreview.js";import h from"./VariableConnectorsPanel.js";const u=l.div`
1
+ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useRef as l}from"react";import n from"styled-components";import{CHANNEL_TYPE as i}from"../../template-preview/models/Channels.js";import{COLORS as a}from"../../../constants/Theme.js";import{useTemplateModalContext as r}from"../context/templateModalContext.js";import{getVariableNameForEmailByIndex as s}from"../utils/getVariableNameEmail.js";import{highlightFor as p}from"../utils/highlightFor.js";import d from"./DesktopPreview.js";import m from"./EditWhatsAppTemplateV2.js";import c from"./MobilePreview.js";import u from"./VariableConnectorsPanel.js";const h=n.div`
2
2
  display: flex;
3
3
  // height: 100%;
4
- `,f=l.div`
4
+ `,f=n.div`
5
5
  padding: 16px 14px;
6
6
  max-width: 350px;
7
7
 
@@ -9,9 +9,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useRef as
9
9
  overflow-y: 'auto';
10
10
  padding-bottom: 24px;
11
11
  border-left: ${a.stroke.primary} 1px solid;
12
- `,v=l.div`
12
+ `,v=n.div`
13
13
  padding: ${e=>e.showOnlyContent?"16px 14px":"16px 32px"};
14
14
  flex: 1;
15
15
  height: 475px;
16
16
  overflow-y: auto;
17
- `,g=l=>{const{showVariableMapping:g,showOnlyContent:w,whatsappSpecificPickerMeta:b,showVariableModal:x,variableList:y,discountCode:j,setDiscountCode:M}=l,C=n(),P=n(),{device:E,display_content:T,channel:k,template:A,setTemplate:V}=r();const _=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t};return e(u,{children:[t(v,Object.assign({showOnlyContent:w,showVariableMapping:g},{children:"mobile"===E?t(c,{ref:P,display_content:null!=T?T:"",channel:k,template:A}):k!==i.MESSAGE?t(d,{ref:C,channel:k,display_content:null!=T?T:""}):t(o,{})})),g&&t(f,Object.assign({channel:k},{children:k!==i.WHATSAPP?t(h,{onFocus:k===i.EMAIL?function(e){var t,o,n;const l=null===document||void 0===document?void 0:document.getElementById("mobile"===E?"template_html_mobile":"template_html_desktop"),r=s(e+1),d=k===i.EMAIL?null===(t=null==l?void 0:l.contentWindow)||void 0===t?void 0:t.document.getElementById(r):document.getElementById(r),m=_(d),c=null==d?void 0:d.offsetLeft;"desktop"===E?m&&C.current&&(null===(o=null==l?void 0:l.contentWindow)||void 0===o||o.scrollTo(null!=c?c:0,m),p(r,a.background.warning.light,2,k,E)):m&&P.current&&(null===(n=null==l?void 0:l.contentWindow)||void 0===n||n.scrollTo(null!=c?c:0,m),p(r,a.background.warning.light,2,k,E))}:void 0,showVariableModal:x,variableList:y,discountCode:j,setDiscountCode:M}):t(m,{whatsappSpecificPickerMeta:b,template:A,onTemplateChange:e=>{null==V||V(e)},showVariableModal:x,variableList:y})}))]})};export{g as default};
17
+ `,g=n=>{const{showVariableMapping:g,showOnlyContent:w,whatsappSpecificPickerMeta:b,showVariableModal:x,variableList:y,discountCode:C,setDiscountCode:j,variableListForImage:M,showSampleValues:V}=n,P=l(),E=l(),{device:S,display_content:T,channel:k,template:A,setTemplate:L}=r();const I=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t};return e(h,{children:[t(v,Object.assign({showOnlyContent:w,showVariableMapping:g},{children:"mobile"===S?t(c,{ref:E,display_content:null!=T?T:"",channel:k,template:A,showSampleValues:V}):k!==i.MESSAGE?t(d,{ref:P,channel:k,display_content:null!=T?T:"",showSampleValues:V}):t(o,{})})),g&&t(f,Object.assign({channel:k},{children:k!==i.WHATSAPP?t(u,{onFocus:k===i.EMAIL?function(e){var t,o,l;const n=null===document||void 0===document?void 0:document.getElementById("mobile"===S?"template_html_mobile":"template_html_desktop"),r=s(e+1),d=k===i.EMAIL?null===(t=null==n?void 0:n.contentWindow)||void 0===t?void 0:t.document.getElementById(r):document.getElementById(r),m=I(d),c=null==d?void 0:d.offsetLeft;"desktop"===S?m&&P.current&&(null===(o=null==n?void 0:n.contentWindow)||void 0===o||o.scrollTo(null!=c?c:0,m),p(r,a.background.warning.light,2,k,S)):m&&E.current&&(null===(l=null==n?void 0:n.contentWindow)||void 0===l||l.scrollTo(null!=c?c:0,m),p(r,a.background.warning.light,2,k,S))}:void 0,showVariableModal:x,variableList:y,discountCode:C,setDiscountCode:j}):t(m,{whatsappSpecificPickerMeta:b,template:A,onTemplateChange:e=>{null==L||L(e)},showVariableModal:x,variableList:y,variableListForImage:M,discountCode:C,setDiscountCode:j})}))]})};export{g as default};
@@ -3,5 +3,6 @@ import { CHANNEL_TYPE } from "../../template-preview/models/Channels";
3
3
  declare const DesktopPreview: React.ForwardRefExoticComponent<{
4
4
  display_content: string;
5
5
  channel: CHANNEL_TYPE;
6
+ showSampleValues?: boolean | undefined;
6
7
  } & React.RefAttributes<HTMLDivElement>>;
7
8
  export default DesktopPreview;
@@ -1,20 +1,20 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import r from"react";import i from"styled-components";import{Spinner as p}from"../../spinner/Spinner.js";import{TemplatePreview as o}from"../../template-preview/TemplatePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import{COLORS as a}from"../../../constants/Theme.js";import"../../template-preview/models/TemplateMeta.js";import{CHANNEL_TYPE as m}from"../../template-preview/models/Channels.js";const s=i.div`
2
- background: ${a.surface.standard};
3
- border: 1px solid ${a.stroke.primary};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import r from"react";import i from"styled-components";import{Spinner as p}from"../../spinner/Spinner.js";import{TemplatePreview as a}from"../../template-preview/TemplatePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import{COLORS as o}from"../../../constants/Theme.js";import"../../template-preview/models/TemplateMeta.js";import"../../template-preview/models/WhatsAppTemplate.js";import{CHANNEL_TYPE as s}from"../../template-preview/models/Channels.js";const m=i.div`
2
+ background: ${o.surface.standard};
3
+ border: 1px solid ${o.stroke.primary};
4
4
  border-radius: 8px;
5
5
  overflow-y: auto;
6
6
  /* max-height: 420px; */
7
7
  scroll-behavior: smooth;
8
8
  height: 100%;
9
- `,d=i.div`
9
+ `,l=i.div`
10
10
  padding: 18px 24px 12px;
11
11
  display: flex;
12
12
  gap: 4px;
13
13
  border-bottom-width: 1px;
14
- border-bottom-color: ${a.stroke.primary};
15
- `,l=i.div`
14
+ border-bottom-color: ${o.stroke.primary};
15
+ `,d=i.div`
16
16
  width: 6px;
17
17
  height: 6px;
18
18
  background: #d9d9d9;
19
19
  border-radius: 3px;
20
- `,n=r.forwardRef(((r,i)=>{let{display_content:a}=r;return e(s,Object.assign({ref:i},{children:[e(d,{children:[t(l,{}),t(l,{}),t(l,{})]}),t("div",{children:a?t(o,{channel:m.EMAIL,hideHeader:!0,emailSpecificMeta:{emailDisplayContent:a,hideViewButtonForEmail:!0,emailHtmlContainerId:"template_html_desktop",containerStyle:{width:584,height:441},templateContainerStyles:{height:"100%"}}}):t("div",Object.assign({style:{padding:20}},{children:t(p,{size:"small"})}))})]}))}));n.displayName="DesktopPreview";export{n as default};
20
+ `,n=r.forwardRef(((r,i)=>{let{display_content:o,showSampleValues:n}=r;return e(m,Object.assign({ref:i},{children:[e(l,{children:[t(d,{}),t(d,{}),t(d,{})]}),t("div",{children:o?t(a,{showSampleValues:n,channel:s.EMAIL,hideHeader:!0,emailSpecificMeta:{emailDisplayContent:o,hideViewButtonForEmail:!0,emailHtmlContainerId:"template_html_desktop",containerStyle:{width:584,height:441},templateContainerStyles:{height:"100%"}}}):t("div",Object.assign({style:{padding:20}},{children:t(p,{size:"small"})}))})]}))}));n.displayName="DesktopPreview";export{n as default};