@bikdotai/bik-component-library 0.0.398-beta-styles → 0.0.398

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 (121) hide show
  1. package/dist/cjs/components/add-variableV2/AddVariableV2.d.ts +1 -0
  2. package/dist/cjs/components/bik-layout/BikSidebar.js +1 -1
  3. package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
  4. package/dist/cjs/components/input-with-vars/InputWithVariables.d.ts +14 -6
  5. package/dist/cjs/components/input-with-vars/InputWithVariables.js +3 -3
  6. package/dist/cjs/components/product-picker-v2/collectionScreen.d.ts +2 -0
  7. package/dist/cjs/components/product-picker-v2/collectionScreen.js +1 -1
  8. package/dist/cjs/components/product-picker-v2/modal.d.ts +5 -1
  9. package/dist/cjs/components/product-picker-v2/modal.js +1 -1
  10. package/dist/cjs/components/product-picker-v2/productScreen.d.ts +7 -0
  11. package/dist/cjs/components/product-picker-v2/productScreen.js +1 -1
  12. package/dist/cjs/components/product-picker-v2/searchScreen.d.ts +4 -0
  13. package/dist/cjs/components/product-picker-v2/searchScreen.js +1 -1
  14. package/dist/cjs/components/product-picker-v2/style.d.ts +2 -0
  15. package/dist/cjs/components/product-picker-v2/style.js +24 -16
  16. package/dist/cjs/components/shimmer-image/ShimmerImage.d.ts +1 -0
  17. package/dist/cjs/components/shimmer-image/ShimmerImage.js +1 -1
  18. package/dist/cjs/components/side-modal/SideModal.d.ts +4 -2
  19. package/dist/cjs/components/side-modal/SideModal.js +1 -1
  20. package/dist/cjs/components/side-modal/SideModal.style.d.ts +4 -1
  21. package/dist/cjs/components/side-modal/SideModal.style.js +4 -1
  22. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.d.ts +7 -3
  23. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
  24. package/dist/cjs/components/template-context-mapper/context/templateModalContext.d.ts +5 -1
  25. package/dist/cjs/components/template-context-mapper/modalElements/BackTrackComponent.d.ts +4 -0
  26. package/dist/cjs/components/template-context-mapper/modalElements/BackTrackComponent.js +1 -0
  27. package/dist/cjs/components/template-context-mapper/modalElements/Body.d.ts +2 -0
  28. package/dist/cjs/components/template-context-mapper/modalElements/Body.js +5 -5
  29. package/dist/cjs/components/template-context-mapper/modalElements/DesktopPreview.d.ts +1 -0
  30. package/dist/cjs/components/template-context-mapper/modalElements/DesktopPreview.js +2 -2
  31. package/dist/cjs/components/template-context-mapper/modalElements/DiscountCodeComponent.d.ts +6 -0
  32. package/dist/cjs/components/template-context-mapper/modalElements/DiscountCodeComponent.js +1 -0
  33. package/dist/cjs/components/template-context-mapper/modalElements/EditMediaModal.d.ts +11 -0
  34. package/dist/cjs/components/template-context-mapper/modalElements/EditMediaModal.js +1 -0
  35. package/dist/cjs/components/template-context-mapper/modalElements/EditMediaV2.d.ts +3 -0
  36. package/dist/cjs/components/template-context-mapper/modalElements/EditMediaV2.js +2 -2
  37. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.d.ts +2 -0
  38. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.js +1 -1
  39. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.d.ts +4 -1
  40. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
  41. package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.d.ts +1 -0
  42. package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.js +3 -3
  43. package/dist/cjs/components/template-context-mapper/modalElements/TemplateSelectModalContent.d.ts +3 -1
  44. package/dist/cjs/components/template-context-mapper/modalElements/TemplateSelectModalContent.js +1 -1
  45. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.d.ts +3 -1
  46. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.js +3 -3
  47. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
  48. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorsPanel.js +4 -3
  49. package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  50. package/dist/cjs/components/template-preview/TemplatePreview.d.ts +2 -1
  51. package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
  52. package/dist/cjs/components/template-preview/WhatsApp/ChatUI.style.js +5 -5
  53. package/dist/cjs/components/template-preview/WhatsAppTemplatePreview.d.ts +1 -0
  54. package/dist/cjs/components/template-preview/WhatsAppTemplatePreview.js +1 -1
  55. package/dist/cjs/components/template-preview/constants/regexPatterns.js +1 -1
  56. package/dist/cjs/components/template-preview/helpers/TemplateCreatorHelper.d.ts +6 -1
  57. package/dist/cjs/components/template-preview/helpers/TemplateCreatorHelper.js +1 -1
  58. package/dist/cjs/components/template-preview/models/WhatsAppTemplate.d.ts +21 -0
  59. package/dist/cjs/components/template-preview/models/WhatsAppTemplate.js +1 -1
  60. package/dist/cjs/index.js +1 -1
  61. package/dist/esm/components/add-variableV2/AddVariableV2.d.ts +1 -0
  62. package/dist/esm/components/bik-layout/BikSidebar.js +1 -1
  63. package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
  64. package/dist/esm/components/input-with-vars/InputWithVariables.d.ts +14 -6
  65. package/dist/esm/components/input-with-vars/InputWithVariables.js +3 -3
  66. package/dist/esm/components/product-picker-v2/collectionScreen.d.ts +2 -0
  67. package/dist/esm/components/product-picker-v2/collectionScreen.js +1 -1
  68. package/dist/esm/components/product-picker-v2/modal.d.ts +5 -1
  69. package/dist/esm/components/product-picker-v2/modal.js +1 -1
  70. package/dist/esm/components/product-picker-v2/productScreen.d.ts +7 -0
  71. package/dist/esm/components/product-picker-v2/productScreen.js +1 -1
  72. package/dist/esm/components/product-picker-v2/searchScreen.d.ts +4 -0
  73. package/dist/esm/components/product-picker-v2/searchScreen.js +1 -1
  74. package/dist/esm/components/product-picker-v2/style.d.ts +2 -0
  75. package/dist/esm/components/product-picker-v2/style.js +20 -12
  76. package/dist/esm/components/shimmer-image/ShimmerImage.d.ts +1 -0
  77. package/dist/esm/components/shimmer-image/ShimmerImage.js +1 -1
  78. package/dist/esm/components/side-modal/SideModal.d.ts +4 -2
  79. package/dist/esm/components/side-modal/SideModal.js +1 -1
  80. package/dist/esm/components/side-modal/SideModal.style.d.ts +4 -1
  81. package/dist/esm/components/side-modal/SideModal.style.js +15 -12
  82. package/dist/esm/components/template-context-mapper/TemplateContextMapper.d.ts +7 -3
  83. package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
  84. package/dist/esm/components/template-context-mapper/context/templateModalContext.d.ts +5 -1
  85. package/dist/esm/components/template-context-mapper/modalElements/BackTrackComponent.d.ts +4 -0
  86. package/dist/esm/components/template-context-mapper/modalElements/BackTrackComponent.js +1 -0
  87. package/dist/esm/components/template-context-mapper/modalElements/Body.d.ts +2 -0
  88. package/dist/esm/components/template-context-mapper/modalElements/Body.js +4 -4
  89. package/dist/esm/components/template-context-mapper/modalElements/DesktopPreview.d.ts +1 -0
  90. package/dist/esm/components/template-context-mapper/modalElements/DesktopPreview.js +4 -4
  91. package/dist/esm/components/template-context-mapper/modalElements/DiscountCodeComponent.d.ts +6 -0
  92. package/dist/esm/components/template-context-mapper/modalElements/DiscountCodeComponent.js +1 -0
  93. package/dist/esm/components/template-context-mapper/modalElements/EditMediaModal.d.ts +11 -0
  94. package/dist/esm/components/template-context-mapper/modalElements/EditMediaModal.js +1 -0
  95. package/dist/esm/components/template-context-mapper/modalElements/EditMediaV2.d.ts +3 -0
  96. package/dist/esm/components/template-context-mapper/modalElements/EditMediaV2.js +2 -2
  97. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.d.ts +2 -0
  98. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.js +1 -1
  99. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.d.ts +4 -1
  100. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
  101. package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.d.ts +1 -0
  102. package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.js +4 -4
  103. package/dist/esm/components/template-context-mapper/modalElements/TemplateSelectModalContent.d.ts +3 -1
  104. package/dist/esm/components/template-context-mapper/modalElements/TemplateSelectModalContent.js +1 -1
  105. package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.d.ts +3 -1
  106. package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.js +2 -2
  107. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
  108. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorsPanel.js +4 -3
  109. package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  110. package/dist/esm/components/template-preview/TemplatePreview.d.ts +2 -1
  111. package/dist/esm/components/template-preview/TemplatePreview.js +1 -1
  112. package/dist/esm/components/template-preview/WhatsApp/ChatUI.style.js +1 -1
  113. package/dist/esm/components/template-preview/WhatsAppTemplatePreview.d.ts +1 -0
  114. package/dist/esm/components/template-preview/WhatsAppTemplatePreview.js +1 -1
  115. package/dist/esm/components/template-preview/constants/regexPatterns.js +1 -1
  116. package/dist/esm/components/template-preview/helpers/TemplateCreatorHelper.d.ts +6 -1
  117. package/dist/esm/components/template-preview/helpers/TemplateCreatorHelper.js +1 -1
  118. package/dist/esm/components/template-preview/models/WhatsAppTemplate.d.ts +21 -0
  119. package/dist/esm/components/template-preview/models/WhatsAppTemplate.js +1 -1
  120. package/dist/esm/index.js +1 -1
  121. package/package.json +1 -1
@@ -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 { Extras, 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?: Extras;
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 { Extras, 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?: Extras | 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?: Extras | 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,4 +1,4 @@
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`
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 s}from"../../template-preview/models/Channels.js";const m=i.div`
2
2
  background: ${a.surface.standard};
3
3
  border: 1px solid ${a.stroke.primary};
4
4
  border-radius: 8px;
@@ -6,15 +6,15 @@ import{jsxs as e,jsx as t}from"react/jsx-runtime";import r from"react";import i
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
14
  border-bottom-color: ${a.stroke.primary};
15
- `,l=i.div`
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:a,showSampleValues:n}=r;return e(m,Object.assign({ref:i},{children:[e(l,{children:[t(d,{}),t(d,{}),t(d,{})]}),t("div",{children:a?t(o,{showSampleValues:n,channel:s.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};
@@ -0,0 +1,6 @@
1
+ import { VariableListInterfaceV2 } from "../../add-variableV2";
2
+ export declare const DiscountCodeComponent: (props: {
3
+ discountCode?: string | undefined;
4
+ setDiscountCode?: ((code: string) => void) | undefined;
5
+ variableList?: VariableListInterfaceV2[] | undefined;
6
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsxs as e,Fragment as t,jsx as r}from"react/jsx-runtime";import i from"../../../assets/icons/PlusIcon.js";import{useState as o,useRef as a,useEffect as s}from"react";import{AddVariableV2SideModal as l}from"../../add-variableV2/AddVariableV2SideModal.js";import"../../../_virtual/_tslib.js";import"../../add-variableV2/AddVariableV2.styled.js";import"../../button/Button.js";import"../../icon-button/IconButton.js";import{Input as n}from"../../input/Input.js";import"@tippyjs/react";import"../../tooltips/TooltipInternal.js";import"../../../constants/Theme.js";import"../../modals/modal.styled.js";import"../../switch/Switch.js";import{TitleSmall as d}from"../../TypographyStyle.js";import{CheckBox as c}from"../../checkBox/CheckBox.js";import{AddVariableStyled as m}from"./VariableConnectorsPanel.js";const p=p=>{const{discountCode:u,setDiscountCode:h,variableList:b}=p,[j,g]=o(""),[v,V]=o(!!u),[f,y]=o(!1),[x,C]=o(!1),w=a(),T=a();return s((()=>{h&&j&&h(u+j)}),[j]),e(t,{children:[e("div",Object.assign({style:{display:"flex",flexDirection:"row",marginLeft:10,marginTop:8}},{children:[r(c,{isChecked:v,onValueChange:()=>{v&&h&&(h(""),g("")),V(!v)}}),r(d,Object.assign({style:{marginLeft:8}},{children:"Add discount code"}))]})),v&&e("div",Object.assign({ref:w,style:{margin:10}},{children:[r(n,{placeholder:"Enter your discount code",onChangeText:e=>{h&&h(e)},value:u,onFocus:()=>{y(!0)},onBlur:e=>{var t;"addVar"===(null===(t=e.relatedTarget)||void 0===t?void 0:t.id)?(w.current&&w.current.focus(),y(!0)):(y(!1),C(!1))},noErrorHint:!0,validate:e=>[!0,""]}),f&&r(m,Object.assign({ref:T,id:"addVar",onClick:e=>{e.stopPropagation(),C(!0)}},{children:e("div",Object.assign({className:"add"},{children:[r(i,{width:14,height:14,color:"white"}),r("div",Object.assign({className:"variable"},{children:"Add variable"}))]}))}))]})),x&&r(l,{zIndex:2e3,data:null!=b?b:[],showVariable:x,setShowVariable:C,variableValue:j,setVariableValue:g,placeholder:"Add a variable",customTrigger:e=>{g(e.actualValue),y(!1)}})]})};export{p as DiscountCodeComponent};
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { VariableListInterfaceV2 } from "../../add-variableV2";
3
+ import { HEADER_TYPES } from "../../template-preview";
4
+ declare const EditMediaModal: React.FC<{
5
+ setOpenEditMedia: React.Dispatch<React.SetStateAction<boolean>>;
6
+ openEditMedia: boolean;
7
+ mediaComponentFormat: HEADER_TYPES;
8
+ variableListForImage: VariableListInterfaceV2[];
9
+ uploadMedia: (urlOrVariable?: string) => void;
10
+ }>;
11
+ export default EditMediaModal;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Button as i}from"../../button/Button.js";import{InputWithVariables as a}from"../../input-with-vars/InputWithVariables.js";import{StyledModal as o}from"../../modals/styledModal.js";import"../../template-preview/TemplatePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import{DEFAULT_THEME as s}from"../../../constants/Theme.js";import{HEADER_TYPES as r}from"../../template-preview/models/TemplateMeta.js";import{TitleMedium as l,BodySecondary as d,BodyRegular as n,BodyCaption as p}from"../../TypographyStyle.js";import c from"../../../assets/icons/file.svg.js";import m from"../../../assets/icons/filePdf.svg.js";import h from"../../../assets/icons/image.svg.js";import g from"../../../assets/icons/upload.svg.js";const u=u=>{let{setOpenEditMedia:b,mediaComponentFormat:f,variableListForImage:j,openEditMedia:v,uploadMedia:y}=u;return e(o,Object.assign({open:v,zIndex:2e3,onClose:()=>b(!1),width:"440px"},{children:t("div",Object.assign({style:{padding:24,borderRadius:4}},{children:[e(l,Object.assign({style:{marginBottom:16}},{children:"Update media"})),t("div",Object.assign({style:{padding:24,border:`1px dashed ${s.colorsV2.stroke.primary}`,backgroundColor:s.colorsV2.surface.subdued}},{children:[t("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center",gap:16}},{children:[e("div",Object.assign({style:{height:80,width:80,borderRadius:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:s.colorsV2.background.base}},{children:f===r.IMAGE?e(h,{width:40,height:40}):f===r.VIDEO?e(c,{width:40,height:40}):e(m,{width:40,height:40})})),e(l,{children:f===r.IMAGE?"Upload an image":f===r.VIDEO?"Upload a video":"Upload a document"}),e(d,{children:f===r.IMAGE?"JPEG/ PNG format • Max 5MB":f===r.VIDEO?"MP4 format video • Max 16MB":"PDF format a document • Max 100MB"})]})),t("div",Object.assign({style:{marginBottom:16}},{children:[e(n,{children:"Media"}),e(a,{addVarBoxRight:"46px",allowMix:!1,onChange:e=>{},prevVariable:{actualValue:"",variableType:"string"},variablesList:j,showSideVariablePanel:!0,placeHolder:"Enter URL or add variable...",onBlur:(e,t)=>{t&&t.actualValue&&y(t.actualValue)},showAddButton:[r.IMAGE,r.VIDEO,r.DOCUMENT].includes(f)})]})),t("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:4}},{children:[e("hr",{style:{height:"2px",flex:.5,backgroundColor:"black"}}),e(p,Object.assign({style:{flex:1}},{children:"Or upload media from device"})),e("hr",{style:{height:"2px",flex:.5,backgroundColor:"black"}})]})),e("div",Object.assign({style:{display:"flex",width:"100%"}},{children:e(i,{matchParentWidth:!0,buttonText:"Upload",buttonType:"secondary",LeadingIcon:g,onClick:()=>y()})}))]}))]}))}))};export{u as default};
@@ -1,12 +1,15 @@
1
+ /// <reference types="react" />
1
2
  import { HEADER_TYPES } from "../../template-preview/models/TemplateMeta";
2
3
  export interface EditMediaV2Props {
3
4
  imageName: string[];
5
+ selectedVariable?: string;
4
6
  errorSecondaryText?: string;
5
7
  error?: string;
6
8
  isLoading?: boolean;
7
9
  mediaType?: HEADER_TYPES;
8
10
  handleImageChange?: () => void;
9
11
  disableEditVariable?: boolean;
12
+ setOpenEditMedia?: React.Dispatch<React.SetStateAction<boolean>>;
10
13
  }
11
14
  declare const EditMediaV2: (props: EditMediaV2Props) => import("react/jsx-runtime").JSX.Element;
12
15
  export default EditMediaV2;
@@ -1,8 +1,8 @@
1
- import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import o from"../../../assets/icons/document_pdf.svg.js";import r from"../../../assets/icons/edit.svg.js";import s from"../../../assets/icons/refresh.svg.js";import n from"../../../assets/icons/video_camcorder.svg.js";import l from"styled-components";import{Spinner as d}from"../../spinner/Spinner.js";import{HEADER_TYPES as a}from"../../template-preview/models/TemplateMeta.js";import{BodyCaption as c,BodySecondary as m,Caption as p}from"../../TypographyStyle.js";import h from"../../../utils/StringUtils.js";import{COLORS as g}from"../../../constants/Theme.js";import{Container as f,ImageContainer as j,RightComponent as y}from"./EditMediaV2.style.js";const v=l.div`
1
+ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import o from"../../../assets/icons/document_pdf.svg.js";import r from"../../../assets/icons/edit.svg.js";import s from"../../../assets/icons/refresh.svg.js";import n from"../../../assets/icons/video_camcorder.svg.js";import l from"styled-components";import{Spinner as d}from"../../spinner/Spinner.js";import{HEADER_TYPES as a}from"../../template-preview/models/TemplateMeta.js";import{BodyCaption as c,BodySecondary as m,Caption as p}from"../../TypographyStyle.js";import h from"../../../utils/StringUtils.js";import{COLORS as g}from"../../../constants/Theme.js";import{Container as f,ImageContainer as j,RightComponent as v}from"./EditMediaV2.style.js";const y=l.div`
2
2
  padding-left: 14px;
3
3
  padding-right: 6px;
4
4
  width: 44px;
5
5
  height: 24px;
6
6
  border-left: 1px solid ${g.stroke.primary};
7
7
  cursor: pointer;
8
- `,b=l=>{const{imageName:b,error:u,isLoading:x,mediaType:w,handleImageChange:O,disableEditVariable:C}=l,L=null==b?void 0:b[0].split("/"),E=null==L?void 0:L[L.length-1];return e(f,{children:[t(j,Object.assign({error:!!u,onClick:u?O:void 0},{children:u?t(s,{color:g.content.brand,width:32,height:32}):x?t(d,{size:"small"}):w===a.IMAGE?t("img",{alt:"",src:null==b?void 0:b[0],style:{width:"100%",height:"56px",borderRadius:8,objectFit:"cover"}}):w===a.VIDEO?t(n,{width:18,height:22,color:g.content.placeholder}):t(o,{width:18,height:22,color:g.content.placeholder})})),e(y,{children:[t("div",Object.assign({style:{flex:1}},{children:b&&u?t(i,{}):x?t(c,Object.assign({style:{marginLeft:8}},{children:"Your media is getting loaded..."})):t(m,Object.assign({style:{color:g.content.primary,marginLeft:8}},{children:h.toCapitilize(null==w?void 0:w.toLowerCase())||E}))})),!!u&&e("div",Object.assign({style:{display:"flex",flexDirection:"column",marginLeft:8}},{children:[e(m,Object.assign({style:{color:g.content.negative}},{children:["Error loading this ",null==w?void 0:w.toLowerCase(),". Retry"]})),t(p,Object.assign({style:{color:g.content.secondary}},{children:u}))]})),!C&&!u&&!x&&t(v,Object.assign({onClick:O,onKeyDown:O,role:"presentation"},{children:t(r,{width:24,height:24,color:g.content.placeholder})}))]})]})};export{b as default};
8
+ `,u=l=>{const{imageName:u,error:b,isLoading:x,mediaType:w,handleImageChange:O,disableEditVariable:C,selectedVariable:E,setOpenEditMedia:L}=l,M=null==u?void 0:u[0].split("/"),T=null==M?void 0:M[M.length-1];return e(f,{children:[t(j,Object.assign({error:!!b,onClick:b?O:void 0},{children:b?t(s,{color:g.content.brand,width:32,height:32}):x?t(d,{size:"small"}):w===a.IMAGE?t("img",{alt:"",src:null==u?void 0:u[0],style:{width:"100%",height:"56px",borderRadius:8,objectFit:"cover"}}):w===a.VIDEO?t(n,{width:18,height:22,color:g.content.placeholder}):t(o,{width:18,height:22,color:g.content.placeholder})})),e(v,{children:[t("div",Object.assign({style:{flex:1}},{children:u&&b?t(i,{}):x?t(c,Object.assign({style:{marginLeft:8}},{children:"Your media is getting loaded..."})):t(m,Object.assign({style:{color:g.content.primary,marginLeft:8}},{children:E||h.toCapitilize(null==w?void 0:w.toLowerCase())||T}))})),!!b&&e("div",Object.assign({style:{display:"flex",flexDirection:"column",marginLeft:8}},{children:[e(m,Object.assign({style:{color:g.content.negative}},{children:["Error loading this ",null==w?void 0:w.toLowerCase(),". Retry"]})),t(p,Object.assign({style:{color:g.content.secondary}},{children:b}))]})),!C&&!b&&!x&&t(y,Object.assign({onClick:()=>null==L?void 0:L(!0),onKeyDown:()=>null==L?void 0:L(!0),role:"presentation"},{children:t(r,{width:24,height:24,color:g.content.placeholder})}))]})]})};export{u as default};
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
+ import { VariableListInterfaceV2 } from "../../add-variableV2";
2
3
  import { WhatsAppPickerMeta, WhatsAppTemplate } from "../../template-preview/models/WhatsAppTemplate";
3
4
  declare const EditMediaTemplateMediaV2: React.FC<{
4
5
  mediaComponent: WhatsAppTemplate['components'][0];
5
6
  template: WhatsAppTemplate;
6
7
  whatsappSpecificPickerMeta: WhatsAppPickerMeta;
7
8
  updateTemplateImageUrl(url: string, format: WhatsAppTemplate['components'][0]['format']): void;
9
+ variableListForImage?: VariableListInterfaceV2[];
8
10
  }>;
9
11
  export default EditMediaTemplateMediaV2;
@@ -1 +1 @@
1
- import{__awaiter as e}from"../../../_virtual/_tslib.js";import{jsxs as o,Fragment as t,jsx as i}from"react/jsx-runtime";import a,{useState as r}from"react";import{FileUploaderHelper as n}from"../../helpers/FileUploaderHelper.js";import{BikImageCropper as l}from"../../image-cropper/BikImageCropper.js";import"../../image-compress/ImageCompress.js";import"../../states/StateComponent.js";import"../../../constants/zindex.js";import"../../modals/styledModal.js";import"../../spinner/Spinner.js";import{HEADER_TYPES as s}from"../../template-preview/models/TemplateMeta.js";import{useTemplateModalContext as p}from"../context/templateModalContext.js";import m from"./EditMediaV2.js";const d=d=>{let{mediaComponent:c,template:f,updateTemplateImageUrl:u,whatsappSpecificPickerMeta:v}=d;var g,h;const{disableEditVariable:j}=p(),[C,M]=r(void 0),[y,I]=r(),b=a.createRef(),[E,k]=r(!1),[w,x]=r("");function A(o){var t;return e(this,void 0,void 0,(function*(){const e=new n;if(o instanceof Blob){const i=e.validate(o);if(i)x(i),k(!1);else{const e=c.format===s.IMAGE,i=yield v.uploadMediaFiles({file:o,fileName:C,isImage:e});if(i.success){const[e]=o.type.split("/");u(null!==(t=i.url)&&void 0!==t?t:"","application"===e?s.DOCUMENT:s[e.toUpperCase()])}else x("An unknown technical error occured");k(!1)}}else x("An unknown technical error occured"),k(!1)}))}let U;return U=c.format===s.IMAGE?"image/png, image/jpeg":c.format===s.VIDEO?"video/mp4":"application/pdf",o(t,{children:[!!y&&i(l,{aspectRatio:15/8,src:y,onCropComplete:function(o){return e(this,void 0,void 0,(function*(){k(!1),x("");const e=yield fetch(o);A(yield e.blob()).then((()=>{I(void 0)}))}))},onCancel:()=>{k(!1),I("")}}),i("input",{ref:b,style:{display:"none"},type:"file",onChange:function(e){var o;x(""),k(!0);const t=null===(o=e.target.files)||void 0===o?void 0:o[0];if(c.format===s.IMAGE){const e=new FileReader;I(""),M(""),e.onload=()=>{I(e.result),M(null==t?void 0:t.name)},t&&e.readAsDataURL(t)}else A(t)},accept:U}),i(m,{imageName:null!==(h=null===(g=null==c?void 0:c.example)||void 0===g?void 0:g.header_handle)&&void 0!==h?h:[],handleImageChange:function(){var e;(null===(e=null==b?void 0:b.current)||void 0===e?void 0:e.click)&&b.current.click()},mediaType:null==c?void 0:c.format,error:w,isLoading:E,disableEditVariable:j})]})};export{d as default};
1
+ import{__awaiter as e}from"../../../_virtual/_tslib.js";import{jsxs as t,Fragment as i,jsx as o}from"react/jsx-runtime";import n,{useState as a}from"react";import{FileUploaderHelper as r}from"../../helpers/FileUploaderHelper.js";import{BikImageCropper as l}from"../../image-cropper/BikImageCropper.js";import"../../image-compress/ImageCompress.js";import"../../states/StateComponent.js";import"../../../constants/zindex.js";import"../../modals/styledModal.js";import"../../spinner/Spinner.js";import{DEFAULT_IMAGE as s}from"../../shimmer-image/ShimmerImage.js";import{HEADER_TYPES as m}from"../../template-preview/models/TemplateMeta.js";import{useTemplateModalContext as d}from"../context/templateModalContext.js";import p from"./EditMediaModal.js";import c from"./EditMediaV2.js";const f=f=>{let{mediaComponent:u,template:v,updateTemplateImageUrl:g,whatsappSpecificPickerMeta:h,variableListForImage:j}=f;var b,E,M;const{disableEditVariable:I}=d(),[y,C]=a(void 0),[O,A]=a(),[x,k]=a(),[w,T]=a(!1),F=n.createRef(),[R,U]=a(!1),[L,N]=a(""),{template:V,setTemplate:D}=d();let G;function S(){var e;(null===(e=null==F?void 0:F.current)||void 0===e?void 0:e.click)&&F.current.click()}function _(t){var i;return e(this,void 0,void 0,(function*(){const e=new r;if(t instanceof Blob){const o=e.validate(t);if(o)N(o),U(!1);else{const e=u.format===m.IMAGE,o=yield h.uploadMediaFiles({file:t,fileName:y,isImage:e});if(o.success){const[e]=t.type.split("/");g(null!==(i=o.url)&&void 0!==i?i:"","application"===e?m.DOCUMENT:m[e.toUpperCase()])}else N("An unknown technical error occured");U(!1)}}else N("An unknown technical error occured"),U(!1)}))}return G=u.format===m.IMAGE?"image/png, image/jpeg":u.format===m.VIDEO?"video/mp4":"application/pdf",t(i,{children:[o(p,{mediaComponentFormat:null!==(b=u.format)&&void 0!==b?b:m.IMAGE,uploadMedia:function(t){var i;return e(this,void 0,void 0,(function*(){if(N(""),k(""),T(!1),t)if(t.startsWith("https"))try{U(!0);const e=yield fetch(t),i=yield e.blob();yield _(i)}catch(e){N("An unknown technical error occurred")}else if(/^{{.*}}$/.test(t)){k(t);const e=Object.assign({},V);if(e.components){const t=null===(i=null==e?void 0:e.components)||void 0===i?void 0:i.findIndex((e=>{if("HEADER"===e.type&&"NONE"!==e.format&&"TEXT"!==e.format)return!0}));if(void 0!==t&&t>-1&&(null==e?void 0:e.components[t])){const i=Object.assign(Object.assign({},e.components[t]),{format:u.format,example:{header_handle:[s]}}),o=[...e.components];o[t]=i,e.components=o}}e.mapping&&(e.mapping=Object.assign(Object.assign({},e.mapping),{header:[t]})),U(!1),null==D||D(Object.assign({},e))}else U(!1),N("Invalid URL or variable");else S()}))},variableListForImage:j||[],setOpenEditMedia:T,openEditMedia:w}),!!O&&o(l,{aspectRatio:15/8,src:O,onCropComplete:function(t){return e(this,void 0,void 0,(function*(){U(!1),N("");const e=yield fetch(t);_(yield e.blob()).then((()=>{A(void 0)}))}))},onCancel:()=>{U(!1),A("")}}),o("input",{ref:F,style:{display:"none"},type:"file",onChange:function(e){var t;N(""),U(!0);const i=null===(t=e.target.files)||void 0===t?void 0:t[0];if(u.format===m.IMAGE){const e=new FileReader;A(""),C(""),e.onload=()=>{A(e.result),C(null==i?void 0:i.name)},i&&e.readAsDataURL(i)}else _(i)},accept:G}),o(c,{imageName:null!==(M=null===(E=null==u?void 0:u.example)||void 0===E?void 0:E.header_handle)&&void 0!==M?M:[],handleImageChange:S,mediaType:null==u?void 0:u.format,error:L,isLoading:R,setOpenEditMedia:T,selectedVariable:x,disableEditVariable:I})]})};export{f as default};
@@ -8,6 +8,9 @@ export interface EditWhatsAppTemplateV2Props {
8
8
  onTemplateChange?: (template: WhatsAppTemplate | EmailTemplateType | SMSTemplateType) => void;
9
9
  showVariableModal?: boolean;
10
10
  variableList?: VariableListInterfaceV2[];
11
+ variableListForImage?: VariableListInterfaceV2[];
12
+ discountCode?: string;
13
+ setDiscountCode?: (code: string) => void;
11
14
  }
12
- declare const EditWhatsAppTemplateV2: ({ template, onTemplateChange, whatsappSpecificPickerMeta, showVariableModal, variableList, }: EditWhatsAppTemplateV2Props) => import("react/jsx-runtime").JSX.Element;
15
+ declare const EditWhatsAppTemplateV2: ({ template, onTemplateChange, whatsappSpecificPickerMeta, showVariableModal, variableList, variableListForImage, discountCode, setDiscountCode, }: EditWhatsAppTemplateV2Props) => import("react/jsx-runtime").JSX.Element;
13
16
  export default EditWhatsAppTemplateV2;
@@ -1 +1 @@
1
- import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useTemplateModalContext as e}from"../context/templateModalContext.js";import{getAllDataFromTemplateComponent as n}from"../utils/getDataFromTemplateComponent.js";import{EditTemplateMediaContainer as i}from"./EditMediaV2.style.js";import l from"./EditWhatsAppTemplateMediaV2.js";import{Container as a}from"./VariableConnectorsPanel.js";import s from"./VariableConnectorWhatsApp.js";import d from"./VariableEditorHeader.js";import p from"./WhatsAppTemplateCardButtonV2.js";const r=r=>{let{template:c,onTemplateChange:u,whatsappSpecificPickerMeta:m,showVariableModal:b,variableList:v}=r;var g,h,f,j,T,O,x,y,E,V,C,w;const{originalVariableList:B}=e(),{descriptionComponents:I,urlBtns:L,qrbBtns:R,imageComponent:A,bodyVariables:M,headerVariables:U}=n(c);function S(t,o){var e,n,i,l;const a=Object.assign({},c),s=null==a?void 0:a.components.findIndex((t=>"BUTTONS"===t.type));if(void 0!==s&&s>-1){const d=null===(e=null==a?void 0:a.components[s].buttons)||void 0===e?void 0:e.findIndex((t=>"URL"===t.type));if(void 0!==d&&d>-1){const e="custom"===o&&"string"==typeof t,p=[...null!==(l=null===(i=null===(n=a.components)||void 0===n?void 0:n[s])||void 0===i?void 0:i.buttons)&&void 0!==l?l:[]];p[d]=Object.assign(Object.assign({},p[d]),{url:"https://d.bik.ai/{{1}}",example:[e?t:"string"!=typeof t?t.defaultValue:""]});const r=Object.assign(Object.assign({},a.components[s]),{buttons:p}),c=Object.assign(Object.assign({},a.mapping),{buttons:e?["((customBtnPlaceholder))"]:"string"!=typeof t?[t.placeHolder]:void 0});a.mapping=c;const u=[...a.components];u[s]=r,a.components=u}}null==u||u(a)}function k(t,o,e){var n;const i=Object.assign({},c),l=null==i?void 0:i.components.findIndex((t=>"BUTTONS"===t.type));if(void 0!==l&&l>-1){const o=null===(n=null==i?void 0:i.components[l].buttons)||void 0===n?void 0:n.filter((t=>"QUICK_REPLY"===t.type));o&&(o[e]=Object.assign(Object.assign({},o[e]),{flowId:t.flowId,flowName:t.flowName}));const a=Object.assign(Object.assign({},i.components[l]),{buttons:o}),s=[...i.components];s[l]=a,i.components=s}null==u||u(i)}return t(a,Object.assign({style:{flexDirection:"column",maxHeight:460}},{children:[!!A&&o(i,{children:o(l,{whatsappSpecificPickerMeta:m,mediaComponent:A,updateTemplateImageUrl:function(t,o){var e;let n=Object.assign({},c);const i=null===(e=null==n?void 0:n.components)||void 0===e?void 0:e.findIndex((t=>{if("HEADER"===t.type&&"NONE"!==t.format&&"TEXT"!==t.format)return!0}));if(void 0!==i&&i>-1&&(null==n?void 0:n.components[i])){const e=Object.assign(Object.assign({},n.components[i]),{format:o,example:{header_handle:[t]}}),l=[...n.components];l[i]=e,n=Object.assign(Object.assign({},n),{components:l})}null==u||u(n)},template:c})}),(M.length>0||U.length>0)&&o(d,{containerStyle:{paddingTop:A?24:8},headerText:"Edit variable values",subText:"Edit values for the variables used in template",toolTipInfo:"Variables are placeholder texts which can either be filled through data or custom texts. These can be edited through the dropdowns below"}),null==I?void 0:I.map(((t,e)=>o(s,{originalVariableList:B,type:t.type,descriptionComponent:t.component,variableMapping:"HEADER"===t.type?c.mapping.header:c.mapping.body,showVariableModal:b,variableList:v},e))),(null===(h=null===(g=L[0])||void 0===g?void 0:g.component)||void 0===h?void 0:h.buttons)&&(null===(T=null===(j=null===(f=L[0])||void 0===f?void 0:f.component)||void 0===j?void 0:j.buttons)||void 0===T?void 0:T.length)>0&&o(d,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(O=null==B?void 0:B.buttons)||void 0===O?void 0:O.map(((t,e)=>{if("URL"===t.type)return o(p,{CTAoptions:null==m?void 0:m.CTAoptions,button:t,originalVariableList:B,updateSelectedURLTemplateBtn:S},`${e}`)})),(null===(y=null===(x=R[0])||void 0===x?void 0:x.component)||void 0===y?void 0:y.buttons)&&(null===(C=null===(V=null===(E=R[0])||void 0===E?void 0:E.component)||void 0===V?void 0:V.buttons)||void 0===C?void 0:C.length)>0&&o(d,{headerText:"Edit buttons",subText:"Edit the chatflows triggered on clicking the buttons",toolTipInfo:"There is an option to trigger chatflows through the buttons which can keep the user engaged"}),null===(w=null==B?void 0:B.buttons)||void 0===w?void 0:w.map(((t,e)=>{if("QUICK_REPLY"===t.type)return o(p,{QRBoptions:null==m?void 0:m.QRBoptions,button:t,originalVariableList:B,updateSelectedQRBTemplateBtn:k},`${e}`)}))]}))};export{r as default};
1
+ import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useState as e,useEffect as n}from"react";import{POD as i}from"../../template-preview/models/WhatsAppTemplate.js";import{useTemplateModalContext as l}from"../context/templateModalContext.js";import{getAllDataFromTemplateComponent as a}from"../utils/getDataFromTemplateComponent.js";import{BackTrackComponent as s}from"./BackTrackComponent.js";import{DiscountCodeComponent as d}from"./DiscountCodeComponent.js";import{EditTemplateMediaContainer as r}from"./EditMediaV2.style.js";import p from"./EditWhatsAppTemplateMediaV2.js";import{Container as c}from"./VariableConnectorsPanel.js";import u from"./VariableConnectorWhatsApp.js";import m from"./VariableEditorHeader.js";import v from"./WhatsAppTemplateCardButtonV2.js";const b=b=>{let{template:g,onTemplateChange:h,whatsappSpecificPickerMeta:f,showVariableModal:T,variableList:j,variableListForImage:C,discountCode:O,setDiscountCode:x}=b;var E,k,y,V,w,B,L,I,A,M,R,U,H,D,S,N;const{originalVariableList:P,pod:Q,extras:W}=l(),{descriptionComponents:F,urlBtns:_,qrbBtns:K,imageComponent:Y,bodyVariables:$,headerVariables:q}=a(g),[X,z]=e(!1);function G(t,o){var e,n,i,l,a;const s=Object.assign({},g),d=null==s?void 0:s.components.findIndex((t=>"BUTTONS"===t.type));if(void 0!==d&&d>-1){const a=null===(e=null==s?void 0:s.components[d].buttons)||void 0===e?void 0:e.findIndex((t=>"URL"===t.type));if(void 0!==a&&a>-1){const e="custom"===o&&"string"==typeof t,r=[...null!==(l=null===(i=null===(n=s.components)||void 0===n?void 0:n[d])||void 0===i?void 0:i.buttons)&&void 0!==l?l:[]];r[a]=Object.assign(Object.assign({},r[a]),{url:"https://d.bik.ai/{{1}}",example:[e?t:"string"!=typeof t?t.defaultValue:""]});const p=Object.assign(Object.assign({},s.components[d]),{buttons:r}),c=Object.assign(Object.assign({},s.mapping),{buttons:e?["((customBtnPlaceholder))"]:"string"!=typeof t?[t.placeHolder]:void 0});s.mapping=c;const u=[...s.components];u[d]=p,s.components=u}}if("string"!=typeof t){"checkout.checkoutUrl"===(null===(a=t.placeHolder)||void 0===a?void 0:a.slice(2,-2))?z(!0):(z(!1),null==x||x(""))}null==h||h(s)}function J(t,o,e){var n;const i=Object.assign({},g),l=null==i?void 0:i.components.findIndex((t=>"BUTTONS"===t.type));if(void 0!==l&&l>-1){const o=null===(n=null==i?void 0:i.components[l].buttons)||void 0===n?void 0:n.filter((t=>"QUICK_REPLY"===t.type));o&&(o[e]=Object.assign(Object.assign({},o[e]),{flowId:t.flowId,flowName:t.flowName}));const a=Object.assign(Object.assign({},i.components[l]),{buttons:o}),s=[...i.components];s[l]=a,i.components=s}null==h||h(i)}return n((()=>{var t;const o=null===(t=g.mapping.buttons)||void 0===t?void 0:t[0];"checkout.checkoutUrl"===(null==o?void 0:o.slice(2,-2))?z(!0):(z(!1),null==x||x(""))}),[g]),t(c,Object.assign({style:{flexDirection:"column",maxHeight:460}},{children:[!!Y&&o(r,{children:o(p,{whatsappSpecificPickerMeta:f,mediaComponent:Y,updateTemplateImageUrl:function(t,o){var e;let n=Object.assign({},g);const i=null===(e=null==n?void 0:n.components)||void 0===e?void 0:e.findIndex((t=>{if("HEADER"===t.type&&"NONE"!==t.format&&"TEXT"!==t.format)return!0}));if(void 0!==i&&i>-1&&(null==n?void 0:n.components[i])){const e=Object.assign(Object.assign({},n.components[i]),{format:o,example:{header_handle:[t]}}),l=[...n.components];l[i]=e,n=Object.assign(Object.assign({},n),{components:l})}n.mapping&&(n.mapping=Object.assign(Object.assign({},n.mapping),{header:void 0})),null==h||h(Object.assign({},n))},template:g,variableListForImage:C})}),($.length>0||q.length>0)&&o(m,{containerStyle:{paddingTop:Y?24:8},headerText:"Edit variable values",subText:"Edit values for the variables used in template",toolTipInfo:"Variables are placeholder texts which can either be filled through data or custom texts. These can be edited through the dropdowns below"}),null==F?void 0:F.map(((t,e)=>o(u,{originalVariableList:P,type:t.type,descriptionComponent:t.component,variableMapping:"HEADER"===t.type?g.mapping.header:g.mapping.body,showVariableModal:T,variableList:j},e))),(null===(k=null===(E=_[0])||void 0===E?void 0:E.component)||void 0===k?void 0:k.buttons)&&(null===(w=null===(V=null===(y=_[0])||void 0===y?void 0:y.component)||void 0===V?void 0:V.buttons)||void 0===w?void 0:w.length)>0&&o(m,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(B=null==P?void 0:P.buttons)||void 0===B?void 0:B.map(((t,e)=>{if("URL"===t.type)return o(v,{CTAoptions:null==f?void 0:f.CTAoptions,button:t,originalVariableList:P,updateSelectedURLTemplateBtn:G},`${e}`)})),(null===(I=null===(L=K[0])||void 0===L?void 0:L.component)||void 0===I?void 0:I.buttons)&&(null===(R=null===(M=null===(A=K[0])||void 0===A?void 0:A.component)||void 0===M?void 0:M.buttons)||void 0===R?void 0:R.length)>0&&(Q!==i.CHATBOT?o(m,{headerText:"Edit buttons",subText:"Edit the chatflows triggered on clicking the buttons",toolTipInfo:"There is an option to trigger chatflows through the buttons which can keep the user engaged"}):o(s,{backTrackMessage:null===(U=null==W?void 0:W.backTrackExtra)||void 0===U?void 0:U[0],setBackTrackMessage:null===(H=null==W?void 0:W.backTrackExtra)||void 0===H?void 0:H[1]})),null===(D=null==P?void 0:P.buttons)||void 0===D?void 0:D.map(((t,e)=>{if("QUICK_REPLY"===t.type)return o(v,{QRBoptions:null==f?void 0:f.QRBoptions,button:t,originalVariableList:P,updateSelectedQRBTemplateBtn:J},`${e}`)})),Q===i.CHATBOT&&X&&o(d,{discountCode:null===(S=null==W?void 0:W.discountCodeExtra)||void 0===S?void 0:S[0],setDiscountCode:null===(N=null==W?void 0:W.discountCodeExtra)||void 0===N?void 0:N[1],variableList:j})]}))};export{b as default};
@@ -7,5 +7,6 @@ declare const MobilePreview: React.ForwardRefExoticComponent<{
7
7
  display_content: string;
8
8
  channel: CHANNEL_TYPE;
9
9
  template: WhatsAppTemplate | EmailTemplateType | SMSTemplateType | null;
10
+ showSampleValues?: boolean | undefined;
10
11
  } & React.RefAttributes<HTMLDivElement>>;
11
12
  export default MobilePreview;
@@ -1,12 +1,12 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import i from"react";import a from"styled-components";import{TemplatePreview as o}from"../../template-preview/TemplatePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import"../../../constants/Theme.js";import"../../template-preview/models/TemplateMeta.js";import{CHANNEL_TYPE as r}from"../../template-preview/models/Channels.js";const p=a.div`
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import i from"react";import a from"styled-components";import{TemplatePreview as o}from"../../template-preview/TemplatePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import"../../../constants/Theme.js";import"../../template-preview/models/TemplateMeta.js";import{CHANNEL_TYPE as p}from"../../template-preview/models/Channels.js";import{POD as r}from"../../template-preview/models/WhatsAppTemplate.js";import{useTemplateModalContext as l}from"../context/templateModalContext.js";const s=a.div`
2
2
  position: relative;
3
3
  height: 100%;
4
4
  border-radius: 31px;
5
- width: ${e=>e.channel===r.WHATSAPP?"236px":"300px"};
5
+ width: ${e=>e.channel===p.WHATSAPP?"236px":"300px"};
6
6
  background-color: white;
7
7
  margin: auto;
8
8
  overflow-y: auto;
9
- `,l=a.div`
9
+ `,m=a.div`
10
10
  position: absolute;
11
11
  flex: 1;
12
12
  background-color: white;
@@ -17,4 +17,4 @@ import{jsx as e,jsxs as t}from"react/jsx-runtime";import i from"react";import a
17
17
  height: calc(100% - 17px);
18
18
  border-radius: 16px;
19
19
  overflow-y: auto;
20
- `,s=i.forwardRef(((i,a)=>{let{display_content:s,channel:m,template:n}=i;return e("div",{children:t(p,Object.assign({channel:m},{children:[e("img",{alt:"",src:"https://firebasestorage.googleapis.com/v0/b/staging-bikayi.appspot.com/o/bik%2FkNwEVoGlLpVjOsXoO1M8WgvWicP2%2F6f07b850-8b4b-4d58-96cc-8ba6df7b4e4a-Device___Frame.jpg?alt=media&token=253f1bfe-8481-4f54-bdef-3c0a73697d6a",style:{width:m===r.WHATSAPP?236:300,height:443}}),e(l,Object.assign({ref:a},{children:e(o,{template:n,channel:m,smsSpecificMeta:{smsDisplayContent:s},whatsAppSpecificMeta:{showWhatsAppHeader:!0,whatsAppExtras:!0,containerStyle:{border:"none",borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:426}},size:"small",hideHeader:!0,emailSpecificMeta:{emailDisplayContent:s,hideViewButtonForEmail:!0,emailHtmlContainerId:"template_html_mobile",containerStyle:{height:"100%",width:"100%"},templateContainerStyles:{height:"100%"}}})}))]}))})}));s.displayName="MobilePreview";export{s as default};
20
+ `,n=i.forwardRef(((i,a)=>{let{display_content:n,channel:h,template:c,showSampleValues:d}=i;const{pod:w}=l();return e("div",{children:t(s,Object.assign({channel:h},{children:[e("img",{alt:"",src:"https://firebasestorage.googleapis.com/v0/b/staging-bikayi.appspot.com/o/bik%2FkNwEVoGlLpVjOsXoO1M8WgvWicP2%2F6f07b850-8b4b-4d58-96cc-8ba6df7b4e4a-Device___Frame.jpg?alt=media&token=253f1bfe-8481-4f54-bdef-3c0a73697d6a",style:{width:h===p.WHATSAPP?236:300,height:443}}),e(m,Object.assign({ref:a},{children:e(o,{showSampleValues:d,template:c,channel:h,smsSpecificMeta:{smsDisplayContent:n},whatsAppSpecificMeta:{showWhatsAppHeader:!0,whatsAppExtras:w!==r.CHATBOT,containerStyle:{border:"none",borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:426,width:236}},size:"small",hideHeader:!0,emailSpecificMeta:{emailDisplayContent:n,hideViewButtonForEmail:!0,emailHtmlContainerId:"template_html_mobile",containerStyle:{height:"100%",width:"100%"},templateContainerStyles:{height:"100%"}}})}))]}))})}));n.displayName="MobilePreview";export{n as default};
@@ -9,8 +9,10 @@ export interface TemplateSelectModalContentProps {
9
9
  whatsappSpecificPickerMeta?: WhatsAppPickerMeta;
10
10
  showVariableModal?: boolean;
11
11
  variableList?: VariableListInterfaceV2[];
12
+ variableListForImage?: VariableListInterfaceV2[];
12
13
  discountCode?: string;
13
14
  setDiscountCode?: (code: string) => void;
15
+ showSampleValues?: boolean;
14
16
  }
15
- declare const TemplateSelectModalContent: ({ channel, showVariableMapping, showOnlyContent, whatsappSpecificPickerMeta, showVariableModal, variableList, discountCode, setDiscountCode, }: TemplateSelectModalContentProps) => import("react/jsx-runtime").JSX.Element;
17
+ declare const TemplateSelectModalContent: ({ channel, showVariableMapping, showOnlyContent, whatsappSpecificPickerMeta, showVariableModal, variableList, discountCode, setDiscountCode, variableListForImage, showSampleValues, }: TemplateSelectModalContentProps) => import("react/jsx-runtime").JSX.Element;
16
18
  export default TemplateSelectModalContent;
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{CHANNEL_TYPE as o}from"../../template-preview/models/Channels.js";import i from"./Body.js";import a from"./Header.js";const s=s=>{let{channel:n,showVariableMapping:r,showOnlyContent:l,whatsappSpecificPickerMeta:d,showVariableModal:p,variableList:c,discountCode:h,setDiscountCode:m}=s;return e("div",Object.assign({style:{paddingBottom:0}},{children:t("div",{children:[n===o.EMAIL&&e(a,{showOnlyContent:l}),e(i,{whatsappSpecificPickerMeta:d,showVariableMapping:!!r,showOnlyContent:l,showVariableModal:p,variableList:c,discountCode:h,setDiscountCode:m})]})}))};export{s as default};
1
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import{CHANNEL_TYPE as o}from"../../template-preview/models/Channels.js";import t from"./Body.js";import i from"./Header.js";const s=s=>{let{channel:r,showVariableMapping:l,showOnlyContent:n,whatsappSpecificPickerMeta:p,showVariableModal:d,variableList:c,discountCode:m,setDiscountCode:h,variableListForImage:w,showSampleValues:b}=s;return e("div",Object.assign({style:{paddingBottom:0}},{children:a("div",{children:[r===o.EMAIL&&e(i,{showOnlyContent:n}),e(t,{whatsappSpecificPickerMeta:p,showVariableMapping:!!l,showOnlyContent:n,showVariableModal:d,variableList:c,discountCode:m,setDiscountCode:h,variableListForImage:w,showSampleValues:b})]})}))};export{s as default};