@bikdotai/bik-component-library 0.0.394-beta.2 → 0.0.394-beta.4

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../checkBox/CheckBox.js"),s=require("../../TypographyStyle.js"),a=require("../../input/Input.js");exports.BackTrackComponent=i=>{const{backTrackMessage:n,setBackTrackMessage:c}=i,[l,o]=r.useState(!!n);return e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",marginLeft:10,marginTop:8}},{children:[e.jsx(t.CheckBox,{isChecked:l,onValueChange:()=>{l&&c&&c(""),o(!l)}}),e.jsx(s.TitleSmall,Object.assign({style:{marginLeft:8}},{children:"Prevent BackTracking"}))]})),l&&e.jsx("div",Object.assign({style:{margin:10}},{children:e.jsx(a.Input,{placeholder:"Enter your text here",labelText:"Message if user tries backtracking",onChangeText:e=>{c&&c(e)},height:"120px",value:n,noErrorHint:!0,validate:e=>[!0,""]})}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../checkBox/CheckBox.js"),a=require("../../TypographyStyle.js"),s=require("../../input/Input.js");exports.BackTrackComponent=i=>{const{backTrackMessage:n,setBackTrackMessage:c}=i,[l,o]=r.useState(!!n);return e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",marginLeft:10,marginTop:8}},{children:[e.jsx(t.CheckBox,{isChecked:l,onValueChange:()=>{l&&c&&c(""),o(!l)}}),e.jsx(a.TitleSmall,Object.assign({style:{marginLeft:8}},{children:"Prevent BackTracking"}))]})),l&&e.jsx("div",Object.assign({style:{margin:10}},{children:e.jsx(s.Input,{type:"multiline",placeholder:"Enter your text here",labelText:"Message if user tries backtracking",onChangeText:e=>{c&&c(e)},height:"120px",maxCharLimit:1024,value:n,noErrorHint:!0,validate:e=>[!0,""]})}))]})};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../button/Button.js"),s=require("../../input-with-vars/InputWithVariables.js"),a=require("../../modals/styledModal.js");require("../../template-preview/TemplatePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js");var i=require("../../../constants/Theme.js"),r=require("../../template-preview/models/TemplateMeta.js"),l=require("../../TypographyStyle.js"),d=require("../../../assets/icons/file.svg.js"),o=require("../../../assets/icons/filePdf.svg.js"),n=require("../../../assets/icons/image.svg.js"),c=require("../../../assets/icons/upload.svg.js");exports.default=u=>{let{setOpenEditMedia:p,mediaComponentFormat:h,variableListForImage:j,openEditMedia:g,uploadMedia:x}=u;return e.jsx(a.StyledModal,Object.assign({open:g,zIndex:2e3,onClose:()=>p(!1),width:"440px"},{children:e.jsxs("div",Object.assign({style:{padding:24,borderRadius:4}},{children:[e.jsx(l.TitleMedium,Object.assign({style:{marginBottom:16}},{children:"Update media"})),e.jsxs("div",Object.assign({style:{padding:24,border:`1px dashed ${i.DEFAULT_THEME.colorsV2.stroke.primary}`,backgroundColor:i.DEFAULT_THEME.colorsV2.surface.subdued}},{children:[e.jsxs("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center",gap:16}},{children:[e.jsx("div",Object.assign({style:{height:80,width:80,borderRadius:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:i.DEFAULT_THEME.colorsV2.background.base}},{children:h===r.HEADER_TYPES.IMAGE?e.jsx(n.default,{width:40,height:40}):h===r.HEADER_TYPES.VIDEO?e.jsx(d.default,{width:40,height:40}):e.jsx(o.default,{width:40,height:40})})),e.jsx(l.TitleMedium,{children:h===r.HEADER_TYPES.IMAGE?"Upload an image":h===r.HEADER_TYPES.VIDEO?"Upload a video":"Upload a document"}),e.jsx(l.BodySecondary,{children:h===r.HEADER_TYPES.IMAGE?"JPEG/ PNG format • Max 5MB":h===r.HEADER_TYPES.VIDEO?"Mp4 format video • Max 16MB":"Pdf format a document • Max 100MB"})]})),e.jsxs("div",Object.assign({style:{marginBottom:16}},{children:[e.jsx(l.BodyRegular,{children:"Media"}),e.jsx(s.InputWithVariables,{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&&x(t.actualValue)},showAddButton:h===r.HEADER_TYPES.IMAGE})]})),e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:4}},{children:[e.jsx("hr",{style:{height:"2px",flex:.5,backgroundColor:"black"}}),e.jsx(l.BodyCaption,Object.assign({style:{flex:1}},{children:"Or upload media from device"})),e.jsx("hr",{style:{height:"2px",flex:.5,backgroundColor:"black"}})]})),e.jsx("div",Object.assign({style:{display:"flex",width:"100%"}},{children:e.jsx(t.Button,{matchParentWidth:!0,buttonText:"Upload",buttonType:"secondary",LeadingIcon:c.default,onClick:()=>x()})}))]}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../button/Button.js"),s=require("../../input-with-vars/InputWithVariables.js"),a=require("../../modals/styledModal.js");require("../../template-preview/TemplatePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js");var i=require("../../../constants/Theme.js"),r=require("../../template-preview/models/TemplateMeta.js"),l=require("../../TypographyStyle.js"),d=require("../../../assets/icons/file.svg.js"),o=require("../../../assets/icons/filePdf.svg.js"),n=require("../../../assets/icons/image.svg.js"),c=require("../../../assets/icons/upload.svg.js");exports.default=u=>{let{setOpenEditMedia:p,mediaComponentFormat:h,variableListForImage:E,openEditMedia:j,uploadMedia:g}=u;return e.jsx(a.StyledModal,Object.assign({open:j,zIndex:2e3,onClose:()=>p(!1),width:"440px"},{children:e.jsxs("div",Object.assign({style:{padding:24,borderRadius:4}},{children:[e.jsx(l.TitleMedium,Object.assign({style:{marginBottom:16}},{children:"Update media"})),e.jsxs("div",Object.assign({style:{padding:24,border:`1px dashed ${i.DEFAULT_THEME.colorsV2.stroke.primary}`,backgroundColor:i.DEFAULT_THEME.colorsV2.surface.subdued}},{children:[e.jsxs("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center",gap:16}},{children:[e.jsx("div",Object.assign({style:{height:80,width:80,borderRadius:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:i.DEFAULT_THEME.colorsV2.background.base}},{children:h===r.HEADER_TYPES.IMAGE?e.jsx(n.default,{width:40,height:40}):h===r.HEADER_TYPES.VIDEO?e.jsx(d.default,{width:40,height:40}):e.jsx(o.default,{width:40,height:40})})),e.jsx(l.TitleMedium,{children:h===r.HEADER_TYPES.IMAGE?"Upload an image":h===r.HEADER_TYPES.VIDEO?"Upload a video":"Upload a document"}),e.jsx(l.BodySecondary,{children:h===r.HEADER_TYPES.IMAGE?"JPEG/ PNG format • Max 5MB":h===r.HEADER_TYPES.VIDEO?"Mp4 format video • Max 16MB":"Pdf format a document • Max 100MB"})]})),e.jsxs("div",Object.assign({style:{marginBottom:16}},{children:[e.jsx(l.BodyRegular,{children:"Media"}),e.jsx(s.InputWithVariables,{addVarBoxRight:"46px",allowMix:!1,onChange:e=>{},prevVariable:{actualValue:"",variableType:"string"},variablesList:E,showSideVariablePanel:!0,placeHolder:"Enter URL or add variable...",onBlur:(e,t)=>{t&&t.actualValue&&g(t.actualValue)},showAddButton:[r.HEADER_TYPES.IMAGE,r.HEADER_TYPES.VIDEO,r.HEADER_TYPES.DOCUMENT].includes(h)})]})),e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:4}},{children:[e.jsx("hr",{style:{height:"2px",flex:.5,backgroundColor:"black"}}),e.jsx(l.BodyCaption,Object.assign({style:{flex:1}},{children:"Or upload media from device"})),e.jsx("hr",{style:{height:"2px",flex:.5,backgroundColor:"black"}})]})),e.jsx("div",Object.assign({style:{display:"flex",width:"100%"}},{children:e.jsx(t.Button,{matchParentWidth:!0,buttonText:"Upload",buttonType:"secondary",LeadingIcon:c.default,onClick:()=>g()})}))]}))]}))}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),o=require("../context/templateModalContext.js"),n=require("../utils/getDataFromTemplateComponent.js"),i=require("./BackTrackComponent.js"),a=require("./DiscountCodeComponent.js"),l=require("./EditMediaV2.style.js"),s=require("./EditWhatsAppTemplateMediaV2.js"),d=require("./VariableConnectorsPanel.js"),r=require("./VariableConnectorWhatsApp.js"),u=require("./VariableEditorHeader.js"),c=require("./WhatsAppTemplateCardButtonV2.js");exports.default=p=>{let{template:v,onTemplateChange:m,whatsappSpecificPickerMeta:b,showVariableModal:g,variableList:h,variableListForImage:f,discountCode:j,setDiscountCode:T}=p;var x,C,O,E,k,y,B,V,w,L,q,I,M,A,R,U;const{originalVariableList:D,pod:H,extras:S}=o.useTemplateModalContext(),{descriptionComponents:P,urlBtns:N,qrbBtns:Q,imageComponent:_,bodyVariables:F,headerVariables:W}=n.getAllDataFromTemplateComponent(v),[K,Y]=t.useState(!1);function $(e,t){var o,n,i,a,l;const s=Object.assign({},v),d=null==s?void 0:s.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==d&&d>-1){const l=null===(o=null==s?void 0:s.components[d].buttons)||void 0===o?void 0:o.findIndex((e=>"URL"===e.type));if(void 0!==l&&l>-1){const o="custom"===t&&"string"==typeof e,r=[...null!==(a=null===(i=null===(n=s.components)||void 0===n?void 0:n[d])||void 0===i?void 0:i.buttons)&&void 0!==a?a:[]];r[l]=Object.assign(Object.assign({},r[l]),{url:"https://d.bik.ai/{{1}}",example:[o?e:"string"!=typeof e?e.defaultValue:""]});const u=Object.assign(Object.assign({},s.components[d]),{buttons:r}),c=Object.assign(Object.assign({},s.mapping),{buttons:o?["((customBtnPlaceholder))"]:"string"!=typeof e?[e.placeHolder]:void 0});s.mapping=c;const p=[...s.components];p[d]=u,s.components=p}}if("string"!=typeof e){"checkout.checkoutUrl"===(null===(l=e.placeHolder)||void 0===l?void 0:l.slice(2,-2))?Y(!0):(Y(!1),null==T||T(""))}null==m||m(s)}function X(e,t,o){var n;const i=Object.assign({},v),a=null==i?void 0:i.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==a&&a>-1){const t=null===(n=null==i?void 0:i.components[a].buttons)||void 0===n?void 0:n.filter((e=>"QUICK_REPLY"===e.type));t&&(t[o]=Object.assign(Object.assign({},t[o]),{flowId:e.flowId,flowName:e.flowName}));const l=Object.assign(Object.assign({},i.components[a]),{buttons:t}),s=[...i.components];s[a]=l,i.components=s}null==m||m(i)}return t.useEffect((()=>{var e;const t=null===(e=v.mapping.buttons)||void 0===e?void 0:e[0];"checkout.Url"===(null==t?void 0:t.slice(2,-2))?Y(!0):(Y(!1),null==T||T(""))}),[v]),e.jsxs(d.Container,Object.assign({style:{flexDirection:"column",maxHeight:460}},{children:[!!_&&e.jsx(l.EditTemplateMediaContainer,{children:e.jsx(s.default,{whatsappSpecificPickerMeta:b,mediaComponent:_,updateTemplateImageUrl:function(e,t){var o;let n=Object.assign({},v);const i=null===(o=null==n?void 0:n.components)||void 0===o?void 0:o.findIndex((e=>{if("HEADER"===e.type&&"NONE"!==e.format&&"TEXT"!==e.format)return!0}));if(void 0!==i&&i>-1&&(null==n?void 0:n.components[i])){const o=Object.assign(Object.assign({},n.components[i]),{format:t,example:{header_handle:[e]}}),a=[...n.components];a[i]=o,n=Object.assign(Object.assign({},n),{components:a})}n.mapping&&(n.mapping=Object.assign(Object.assign({},n.mapping),{header:void 0})),null==m||m(Object.assign({},n))},template:v,variableListForImage:f})}),(F.length>0||W.length>0)&&e.jsx(u.default,{containerStyle:{paddingTop:_?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==P?void 0:P.map(((t,o)=>e.jsx(r.default,{originalVariableList:D,type:t.type,descriptionComponent:t.component,variableMapping:"HEADER"===t.type?v.mapping.header:v.mapping.body,showVariableModal:g,variableList:h},o))),(null===(C=null===(x=N[0])||void 0===x?void 0:x.component)||void 0===C?void 0:C.buttons)&&(null===(k=null===(E=null===(O=N[0])||void 0===O?void 0:O.component)||void 0===E?void 0:E.buttons)||void 0===k?void 0:k.length)>0&&e.jsx(u.default,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(y=null==D?void 0:D.buttons)||void 0===y?void 0:y.map(((t,o)=>{if("URL"===t.type)return e.jsx(c.default,{CTAoptions:null==b?void 0:b.CTAoptions,button:t,originalVariableList:D,updateSelectedURLTemplateBtn:$},`${o}`)})),(null===(V=null===(B=Q[0])||void 0===B?void 0:B.component)||void 0===V?void 0:V.buttons)&&(null===(q=null===(L=null===(w=Q[0])||void 0===w?void 0:w.component)||void 0===L?void 0:L.buttons)||void 0===q?void 0:q.length)>0&&("CHATBOT"!==H?e.jsx(u.default,{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"}):e.jsx(i.BackTrackComponent,{backTrackMessage:null===(I=null==S?void 0:S.backTrackExtra)||void 0===I?void 0:I[0],setBackTrackMessage:null===(M=null==S?void 0:S.backTrackExtra)||void 0===M?void 0:M[1]})),null===(A=null==D?void 0:D.buttons)||void 0===A?void 0:A.map(((t,o)=>{if("QUICK_REPLY"===t.type)return e.jsx(c.default,{QRBoptions:null==b?void 0:b.QRBoptions,button:t,originalVariableList:D,updateSelectedQRBTemplateBtn:X},`${o}`)})),"CHATBOT"===H&&K&&e.jsx(a.DiscountCodeComponent,{discountCode:null===(R=null==S?void 0:S.discountCodeExtra)||void 0===R?void 0:R[0],setDiscountCode:null===(U=null==S?void 0:S.discountCodeExtra)||void 0===U?void 0:U[1],variableList:h})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),o=require("../context/templateModalContext.js"),n=require("../utils/getDataFromTemplateComponent.js"),i=require("./BackTrackComponent.js"),a=require("./DiscountCodeComponent.js"),l=require("./EditMediaV2.style.js"),s=require("./EditWhatsAppTemplateMediaV2.js"),d=require("./VariableConnectorsPanel.js"),r=require("./VariableConnectorWhatsApp.js"),c=require("./VariableEditorHeader.js"),u=require("./WhatsAppTemplateCardButtonV2.js");exports.default=p=>{let{template:v,onTemplateChange:b,whatsappSpecificPickerMeta:m,showVariableModal:g,variableList:h,variableListForImage:f,discountCode:j,setDiscountCode:T}=p;var x,C,k,O,E,y,B,V,M,w,L,q,I,A,R,U,D,H;const{originalVariableList:S,pod:P,extras:N}=o.useTemplateModalContext(),{descriptionComponents:Q,urlBtns:_,qrbBtns:F,imageComponent:W,bodyVariables:K,headerVariables:Y}=n.getAllDataFromTemplateComponent(v),[$,X]=t.useState(!1);function z(e,t){var o,n,i,a,l;const s=Object.assign({},v),d=null==s?void 0:s.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==d&&d>-1){const l=null===(o=null==s?void 0:s.components[d].buttons)||void 0===o?void 0:o.findIndex((e=>"URL"===e.type));if(void 0!==l&&l>-1){const o="custom"===t&&"string"==typeof e,r=[...null!==(a=null===(i=null===(n=s.components)||void 0===n?void 0:n[d])||void 0===i?void 0:i.buttons)&&void 0!==a?a:[]];r[l]=Object.assign(Object.assign({},r[l]),{url:"https://d.bik.ai/{{1}}",example:[o?e:"string"!=typeof e?e.defaultValue:""]});const c=Object.assign(Object.assign({},s.components[d]),{buttons:r}),u=Object.assign(Object.assign({},s.mapping),{buttons:o?["((customBtnPlaceholder))"]:"string"!=typeof e?[e.placeHolder]:void 0});s.mapping=u;const p=[...s.components];p[d]=c,s.components=p}}if("string"!=typeof e){"checkout.checkoutUrl"===(null===(l=e.placeHolder)||void 0===l?void 0:l.slice(2,-2))?X(!0):(X(!1),null==T||T(""))}null==b||b(s)}function G(e,t,o){var n;const i=Object.assign({},v),a=null==i?void 0:i.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==a&&a>-1){const t=null===(n=null==i?void 0:i.components[a].buttons)||void 0===n?void 0:n.filter((e=>"QUICK_REPLY"===e.type));t&&(t[o]=Object.assign(Object.assign({},t[o]),{flowId:e.flowId,flowName:e.flowName}));const l=Object.assign(Object.assign({},i.components[a]),{buttons:t}),s=[...i.components];s[a]=l,i.components=s}null==b||b(i)}return t.useEffect((()=>{var e;const t=null===(e=v.mapping.buttons)||void 0===e?void 0:e[0];"checkout.checkoutUrl"===(null==t?void 0:t.slice(2,-2))?X(!0):(X(!1),null==T||T(""))}),[v]),e.jsxs(d.Container,Object.assign({style:{flexDirection:"column",maxHeight:460}},{children:[!!W&&e.jsx(l.EditTemplateMediaContainer,{children:e.jsx(s.default,{whatsappSpecificPickerMeta:m,mediaComponent:W,updateTemplateImageUrl:function(e,t){var o;let n=Object.assign({},v);const i=null===(o=null==n?void 0:n.components)||void 0===o?void 0:o.findIndex((e=>{if("HEADER"===e.type&&"NONE"!==e.format&&"TEXT"!==e.format)return!0}));if(void 0!==i&&i>-1&&(null==n?void 0:n.components[i])){const o=Object.assign(Object.assign({},n.components[i]),{format:t,example:{header_handle:[e]}}),a=[...n.components];a[i]=o,n=Object.assign(Object.assign({},n),{components:a})}n.mapping&&(n.mapping=Object.assign(Object.assign({},n.mapping),{header:void 0})),null==b||b(Object.assign({},n))},template:v,variableListForImage:f})}),(K.length>0||Y.length>0)&&e.jsx(c.default,{containerStyle:{paddingTop:W?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==Q?void 0:Q.map(((t,o)=>e.jsx(r.default,{originalVariableList:S,type:t.type,descriptionComponent:t.component,variableMapping:"HEADER"===t.type?v.mapping.header:v.mapping.body,showVariableModal:g,variableList:h},o))),(null===(C=null===(x=_[0])||void 0===x?void 0:x.component)||void 0===C?void 0:C.buttons)&&(null===(E=null===(O=null===(k=_[0])||void 0===k?void 0:k.component)||void 0===O?void 0:O.buttons)||void 0===E?void 0:E.length)>0&&e.jsx(c.default,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(y=null==S?void 0:S.buttons)||void 0===y?void 0:y.map(((t,o)=>{if("URL"===t.type)return e.jsx(u.default,{CTAoptions:null==m?void 0:m.CTAoptions,button:t,originalVariableList:S,updateSelectedURLTemplateBtn:z},`${o}`)})),(null===(V=null===(B=F[0])||void 0===B?void 0:B.component)||void 0===V?void 0:V.buttons)&&(null===(L=null===(w=null===(M=F[0])||void 0===M?void 0:M.component)||void 0===w?void 0:w.buttons)||void 0===L?void 0:L.length)>0&&("CHATBOT"!==P?e.jsx(c.default,{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"}):e.jsx(i.BackTrackComponent,{backTrackMessage:null===(q=null==N?void 0:N.backTrackExtra)||void 0===q?void 0:q[0],setBackTrackMessage:null===(I=null==N?void 0:N.backTrackExtra)||void 0===I?void 0:I[1]})),null===(A=null==S?void 0:S.buttons)||void 0===A?void 0:A.map(((t,o)=>{if("QUICK_REPLY"===t.type)return e.jsx(u.default,{QRBoptions:null==m?void 0:m.QRBoptions,button:t,originalVariableList:S,updateSelectedQRBTemplateBtn:G},`${o}`)})),"CHATBOT"===P&&$&&e.jsx(a.DiscountCodeComponent,{discountCode:null===(R=null==N?void 0:N.discountCodeExtra)||void 0===R?void 0:R[0],setDiscountCode:null===(U=null==N?void 0:N.discountCodeExtra)||void 0===U?void 0:U[1],variableList:h}),e.jsx(i.BackTrackComponent,{backTrackMessage:null===(D=null==N?void 0:N.backTrackExtra)||void 0===D?void 0:D[0],setBackTrackMessage:null===(H=null==N?void 0:N.backTrackExtra)||void 0===H?void 0:H[1]})]}))};
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("styled-components"),i=require("../../template-preview/TemplatePreview.js");require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../../constants/Theme.js"),require("../../template-preview/models/TemplateMeta.js");var r=require("../../template-preview/models/Channels.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=s(t),l=s(a);const p=l.default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("styled-components"),i=require("../../template-preview/TemplatePreview.js");require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../../constants/Theme.js"),require("../../template-preview/models/TemplateMeta.js");var r=require("../../template-preview/models/Channels.js"),o=require("../context/templateModalContext.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(t),p=s(a);const n=p.default.div`
2
2
  position: relative;
3
3
  height: 100%;
4
4
  border-radius: 31px;
@@ -6,7 +6,7 @@
6
6
  background-color: white;
7
7
  margin: auto;
8
8
  overflow-y: auto;
9
- `,n=l.default.div`
9
+ `,d=p.default.div`
10
10
  position: absolute;
11
11
  flex: 1;
12
12
  background-color: white;
@@ -17,4 +17,4 @@
17
17
  height: calc(100% - 17px);
18
18
  border-radius: 16px;
19
19
  overflow-y: auto;
20
- `,d=o.default.forwardRef(((t,a)=>{let{display_content:s,channel:o,template:l,showSampleValues:d}=t;return e.jsx("div",{children:e.jsxs(p,Object.assign({channel:o},{children:[e.jsx("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:o===r.CHANNEL_TYPE.WHATSAPP?236:300,height:443}}),e.jsx(n,Object.assign({ref:a},{children:e.jsx(i.TemplatePreview,{showSampleValues:d,template:l,channel:o,smsSpecificMeta:{smsDisplayContent:s},whatsAppSpecificMeta:{showWhatsAppHeader:!0,whatsAppExtras:!0,containerStyle:{border:"none",borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:426,width:236}},size:"small",hideHeader:!0,emailSpecificMeta:{emailDisplayContent:s,hideViewButtonForEmail:!0,emailHtmlContainerId:"template_html_mobile",containerStyle:{height:"100%",width:"100%"},templateContainerStyles:{height:"100%"}}})}))]}))})}));d.displayName="MobilePreview",exports.default=d;
20
+ `,c=l.default.forwardRef(((t,a)=>{let{display_content:s,channel:l,template:p,showSampleValues:c}=t;const{pod:h}=o.useTemplateModalContext();return e.jsx("div",{children:e.jsxs(n,Object.assign({channel:l},{children:[e.jsx("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:l===r.CHANNEL_TYPE.WHATSAPP?236:300,height:443}}),e.jsx(d,Object.assign({ref:a},{children:e.jsx(i.TemplatePreview,{showSampleValues:c,template:p,channel:l,smsSpecificMeta:{smsDisplayContent:s},whatsAppSpecificMeta:{showWhatsAppHeader:!0,whatsAppExtras:"CHATBOT"!==h,containerStyle:{border:"none",borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:426,width:236}},size:"small",hideHeader:!0,emailSpecificMeta:{emailDisplayContent:s,hideViewButtonForEmail:!0,emailHtmlContainerId:"template_html_mobile",containerStyle:{height:"100%",width:"100%"},templateContainerStyles:{height:"100%"}}})}))]}))})}));c.displayName="MobilePreview",exports.default=c;
@@ -7,13 +7,14 @@
7
7
  border-bottom-left-radius: 12px;
8
8
  position: relative;
9
9
  padding: 8px 0px;
10
- `,d=i.default(t.Caption)`
10
+ `,p=i.default(t.Caption)`
11
11
  color: ${r.COLORS.content.secondary};
12
12
  max-width: 80px;
13
13
  text-overflow: ellipsis;
14
14
  white-space: nowrap;
15
15
  overflow: hidden;
16
- `,n=i.default.div`
16
+ text-wrap: wrap;
17
+ `,d=i.default.div`
17
18
  border-radius: 8px;
18
19
  display: flex;
19
20
  flex-direction: column;
@@ -22,7 +23,7 @@
22
23
  min-height: 152px;
23
24
  margin-bottom: 4px;
24
25
  margin: 0px 8px;
25
- `,p=i.default.div`
26
+ `,n=i.default.div`
26
27
  padding: 12px;
27
28
  display: flex;
28
29
  flex-direction: row;
@@ -31,7 +32,6 @@
31
32
  border-top: 1px solid ${r.COLORS.stroke.primary};
32
33
  `,s=i.default.div`
33
34
  display: flex;
34
-
35
35
  flex-direction: row;
36
36
  justify-content: space-between;
37
37
  margin: 8px 12px;
@@ -53,4 +53,4 @@
53
53
  position: absolute;
54
54
  top: 16px;
55
55
  right: 16px;
56
- `,exports.ChatBtnContainer=p,exports.Container=a,exports.FooterWrapper=s,exports.MediaContainer=n,exports.TimeStamp=d;
56
+ `,exports.ChatBtnContainer=n,exports.Container=a,exports.FooterWrapper=s,exports.MediaContainer=d,exports.TimeStamp=p;
@@ -1 +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,[g,m]=i(!!o);return e(r,{children:[e("div",Object.assign({style:{display:"flex",flexDirection:"row",marginLeft:10,marginTop:8}},{children:[t(a,{isChecked:g,onValueChange:()=>{g&&l&&l(""),m(!g)}}),t(n,Object.assign({style:{marginLeft:8}},{children:"Prevent BackTracking"}))]})),g&&t("div",Object.assign({style:{margin:10}},{children:t(s,{placeholder:"Enter your text here",labelText:"Message if user tries backtracking",onChangeText:e=>{l&&l(e)},height:"120px",value:o,noErrorHint:!0,validate:e=>[!0,""]})}))]})};export{c as BackTrackComponent};
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}},{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};
@@ -1 +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 r}from"../../../constants/Theme.js";import{HEADER_TYPES as s}from"../../template-preview/models/TemplateMeta.js";import{TitleMedium as l,BodySecondary as d,BodyRegular as n,BodyCaption as p}from"../../TypographyStyle.js";import m from"../../../assets/icons/file.svg.js";import c 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 ${r.colorsV2.stroke.primary}`,backgroundColor:r.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:r.colorsV2.background.base}},{children:f===s.IMAGE?e(h,{width:40,height:40}):f===s.VIDEO?e(m,{width:40,height:40}):e(c,{width:40,height:40})})),e(l,{children:f===s.IMAGE?"Upload an image":f===s.VIDEO?"Upload a video":"Upload a document"}),e(d,{children:f===s.IMAGE?"JPEG/ PNG format • Max 5MB":f===s.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:f===s.IMAGE})]})),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
+ 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 +1 @@
1
- import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useState as e,useEffect as n}from"react";import{useTemplateModalContext as i}from"../context/templateModalContext.js";import{getAllDataFromTemplateComponent as l}from"../utils/getDataFromTemplateComponent.js";import{BackTrackComponent as a}from"./BackTrackComponent.js";import{DiscountCodeComponent as s}from"./DiscountCodeComponent.js";import{EditTemplateMediaContainer as d}from"./EditMediaV2.style.js";import r from"./EditWhatsAppTemplateMediaV2.js";import{Container as p}from"./VariableConnectorsPanel.js";import c from"./VariableConnectorWhatsApp.js";import u from"./VariableEditorHeader.js";import m from"./WhatsAppTemplateCardButtonV2.js";const v=v=>{let{template:b,onTemplateChange:g,whatsappSpecificPickerMeta:h,showVariableModal:f,variableList:T,variableListForImage:j,discountCode:C,setDiscountCode:O}=v;var x,E,k,y,V,B,w,L,I,A,M,R,U,H,D,S;const{originalVariableList:N,pod:P,extras:Q}=i(),{descriptionComponents:F,urlBtns:W,qrbBtns:_,imageComponent:K,bodyVariables:Y,headerVariables:$}=l(b),[q,X]=e(!1);function z(t,o){var e,n,i,l,a;const s=Object.assign({},b),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))?X(!0):(X(!1),null==O||O(""))}null==g||g(s)}function G(t,o,e){var n;const i=Object.assign({},b),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==g||g(i)}return n((()=>{var t;const o=null===(t=b.mapping.buttons)||void 0===t?void 0:t[0];"checkout.Url"===(null==o?void 0:o.slice(2,-2))?X(!0):(X(!1),null==O||O(""))}),[b]),t(p,Object.assign({style:{flexDirection:"column",maxHeight:460}},{children:[!!K&&o(d,{children:o(r,{whatsappSpecificPickerMeta:h,mediaComponent:K,updateTemplateImageUrl:function(t,o){var e;let n=Object.assign({},b);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==g||g(Object.assign({},n))},template:b,variableListForImage:j})}),(Y.length>0||$.length>0)&&o(u,{containerStyle:{paddingTop:K?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(c,{originalVariableList:N,type:t.type,descriptionComponent:t.component,variableMapping:"HEADER"===t.type?b.mapping.header:b.mapping.body,showVariableModal:f,variableList:T},e))),(null===(E=null===(x=W[0])||void 0===x?void 0:x.component)||void 0===E?void 0:E.buttons)&&(null===(V=null===(y=null===(k=W[0])||void 0===k?void 0:k.component)||void 0===y?void 0:y.buttons)||void 0===V?void 0:V.length)>0&&o(u,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(B=null==N?void 0:N.buttons)||void 0===B?void 0:B.map(((t,e)=>{if("URL"===t.type)return o(m,{CTAoptions:null==h?void 0:h.CTAoptions,button:t,originalVariableList:N,updateSelectedURLTemplateBtn:z},`${e}`)})),(null===(L=null===(w=_[0])||void 0===w?void 0:w.component)||void 0===L?void 0:L.buttons)&&(null===(M=null===(A=null===(I=_[0])||void 0===I?void 0:I.component)||void 0===A?void 0:A.buttons)||void 0===M?void 0:M.length)>0&&("CHATBOT"!==P?o(u,{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(a,{backTrackMessage:null===(R=null==Q?void 0:Q.backTrackExtra)||void 0===R?void 0:R[0],setBackTrackMessage:null===(U=null==Q?void 0:Q.backTrackExtra)||void 0===U?void 0:U[1]})),null===(H=null==N?void 0:N.buttons)||void 0===H?void 0:H.map(((t,e)=>{if("QUICK_REPLY"===t.type)return o(m,{QRBoptions:null==h?void 0:h.QRBoptions,button:t,originalVariableList:N,updateSelectedQRBTemplateBtn:G},`${e}`)})),"CHATBOT"===P&&q&&o(s,{discountCode:null===(D=null==Q?void 0:Q.discountCodeExtra)||void 0===D?void 0:D[0],setDiscountCode:null===(S=null==Q?void 0:Q.discountCodeExtra)||void 0===S?void 0:S[1],variableList:T})]}))};export{v as default};
1
+ import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useState as e,useEffect as n}from"react";import{useTemplateModalContext as i}from"../context/templateModalContext.js";import{getAllDataFromTemplateComponent as a}from"../utils/getDataFromTemplateComponent.js";import{BackTrackComponent as l}from"./BackTrackComponent.js";import{DiscountCodeComponent as s}from"./DiscountCodeComponent.js";import{EditTemplateMediaContainer as d}from"./EditMediaV2.style.js";import r from"./EditWhatsAppTemplateMediaV2.js";import{Container as c}from"./VariableConnectorsPanel.js";import p from"./VariableConnectorWhatsApp.js";import u from"./VariableEditorHeader.js";import m from"./WhatsAppTemplateCardButtonV2.js";const v=v=>{let{template:b,onTemplateChange:g,whatsappSpecificPickerMeta:h,showVariableModal:f,variableList:T,variableListForImage:j,discountCode:k,setDiscountCode:x}=v;var C,O,E,y,B,V,w,L,I,M,A,R,U,H,D,S,N,P;const{originalVariableList:Q,pod:F,extras:W}=i(),{descriptionComponents:_,urlBtns:K,qrbBtns:Y,imageComponent:$,bodyVariables:q,headerVariables:X}=a(b),[z,G]=e(!1);function J(t,o){var e,n,i,a,l;const s=Object.assign({},b),d=null==s?void 0:s.components.findIndex((t=>"BUTTONS"===t.type));if(void 0!==d&&d>-1){const l=null===(e=null==s?void 0:s.components[d].buttons)||void 0===e?void 0:e.findIndex((t=>"URL"===t.type));if(void 0!==l&&l>-1){const e="custom"===o&&"string"==typeof t,r=[...null!==(a=null===(i=null===(n=s.components)||void 0===n?void 0:n[d])||void 0===i?void 0:i.buttons)&&void 0!==a?a:[]];r[l]=Object.assign(Object.assign({},r[l]),{url:"https://d.bik.ai/{{1}}",example:[e?t:"string"!=typeof t?t.defaultValue:""]});const c=Object.assign(Object.assign({},s.components[d]),{buttons:r}),p=Object.assign(Object.assign({},s.mapping),{buttons:e?["((customBtnPlaceholder))"]:"string"!=typeof t?[t.placeHolder]:void 0});s.mapping=p;const u=[...s.components];u[d]=c,s.components=u}}if("string"!=typeof t){"checkout.checkoutUrl"===(null===(l=t.placeHolder)||void 0===l?void 0:l.slice(2,-2))?G(!0):(G(!1),null==x||x(""))}null==g||g(s)}function Z(t,o,e){var n;const i=Object.assign({},b),a=null==i?void 0:i.components.findIndex((t=>"BUTTONS"===t.type));if(void 0!==a&&a>-1){const o=null===(n=null==i?void 0:i.components[a].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 l=Object.assign(Object.assign({},i.components[a]),{buttons:o}),s=[...i.components];s[a]=l,i.components=s}null==g||g(i)}return n((()=>{var t;const o=null===(t=b.mapping.buttons)||void 0===t?void 0:t[0];"checkout.checkoutUrl"===(null==o?void 0:o.slice(2,-2))?G(!0):(G(!1),null==x||x(""))}),[b]),t(c,Object.assign({style:{flexDirection:"column",maxHeight:460}},{children:[!!$&&o(d,{children:o(r,{whatsappSpecificPickerMeta:h,mediaComponent:$,updateTemplateImageUrl:function(t,o){var e;let n=Object.assign({},b);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]}}),a=[...n.components];a[i]=e,n=Object.assign(Object.assign({},n),{components:a})}n.mapping&&(n.mapping=Object.assign(Object.assign({},n.mapping),{header:void 0})),null==g||g(Object.assign({},n))},template:b,variableListForImage:j})}),(q.length>0||X.length>0)&&o(u,{containerStyle:{paddingTop:$?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==_?void 0:_.map(((t,e)=>o(p,{originalVariableList:Q,type:t.type,descriptionComponent:t.component,variableMapping:"HEADER"===t.type?b.mapping.header:b.mapping.body,showVariableModal:f,variableList:T},e))),(null===(O=null===(C=K[0])||void 0===C?void 0:C.component)||void 0===O?void 0:O.buttons)&&(null===(B=null===(y=null===(E=K[0])||void 0===E?void 0:E.component)||void 0===y?void 0:y.buttons)||void 0===B?void 0:B.length)>0&&o(u,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(V=null==Q?void 0:Q.buttons)||void 0===V?void 0:V.map(((t,e)=>{if("URL"===t.type)return o(m,{CTAoptions:null==h?void 0:h.CTAoptions,button:t,originalVariableList:Q,updateSelectedURLTemplateBtn:J},`${e}`)})),(null===(L=null===(w=Y[0])||void 0===w?void 0:w.component)||void 0===L?void 0:L.buttons)&&(null===(A=null===(M=null===(I=Y[0])||void 0===I?void 0:I.component)||void 0===M?void 0:M.buttons)||void 0===A?void 0:A.length)>0&&("CHATBOT"!==F?o(u,{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(l,{backTrackMessage:null===(R=null==W?void 0:W.backTrackExtra)||void 0===R?void 0:R[0],setBackTrackMessage:null===(U=null==W?void 0:W.backTrackExtra)||void 0===U?void 0:U[1]})),null===(H=null==Q?void 0:Q.buttons)||void 0===H?void 0:H.map(((t,e)=>{if("QUICK_REPLY"===t.type)return o(m,{QRBoptions:null==h?void 0:h.QRBoptions,button:t,originalVariableList:Q,updateSelectedQRBTemplateBtn:Z},`${e}`)})),"CHATBOT"===F&&z&&o(s,{discountCode:null===(D=null==W?void 0:W.discountCodeExtra)||void 0===D?void 0:D[0],setDiscountCode:null===(S=null==W?void 0:W.discountCodeExtra)||void 0===S?void 0:S[1],variableList:T}),o(l,{backTrackMessage:null===(N=null==W?void 0:W.backTrackExtra)||void 0===N?void 0:N[0],setBackTrackMessage:null===(P=null==W?void 0:W.backTrackExtra)||void 0===P?void 0:P[1]})]}))};export{v as default};
@@ -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{useTemplateModalContext as r}from"../context/templateModalContext.js";const l=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
+ `,s=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,showSampleValues:h}=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,{showSampleValues:h,template:n,channel:m,smsSpecificMeta:{smsDisplayContent:s},whatsAppSpecificMeta:{showWhatsAppHeader:!0,whatsAppExtras:!0,containerStyle:{border:"none",borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:426,width:236}},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
+ `,m=i.forwardRef(((i,a)=>{let{display_content:m,channel:n,template:h,showSampleValues:c}=i;const{pod:d}=r();return e("div",{children:t(l,Object.assign({channel:n},{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:n===p.WHATSAPP?236:300,height:443}}),e(s,Object.assign({ref:a},{children:e(o,{showSampleValues:c,template:h,channel:n,smsSpecificMeta:{smsDisplayContent:m},whatsAppSpecificMeta:{showWhatsAppHeader:!0,whatsAppExtras:"CHATBOT"!==d,containerStyle:{border:"none",borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:426,width:236}},size:"small",hideHeader:!0,emailSpecificMeta:{emailDisplayContent:m,hideViewButtonForEmail:!0,emailHtmlContainerId:"template_html_mobile",containerStyle:{height:"100%",width:"100%"},templateContainerStyles:{height:"100%"}}})}))]}))})}));m.displayName="MobilePreview";export{m as default};
@@ -13,6 +13,7 @@ import t from"styled-components";import{Caption as e}from"../../TypographyStyle.
13
13
  text-overflow: ellipsis;
14
14
  white-space: nowrap;
15
15
  overflow: hidden;
16
+ text-wrap: wrap;
16
17
  `,p=t.div`
17
18
  border-radius: 8px;
18
19
  display: flex;
@@ -31,7 +32,6 @@ import t from"styled-components";import{Caption as e}from"../../TypographyStyle.
31
32
  border-top: 1px solid ${o.stroke.primary};
32
33
  `,n=t.div`
33
34
  display: flex;
34
-
35
35
  flex-direction: row;
36
36
  justify-content: space-between;
37
37
  margin: 8px 12px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.394-beta.2",
3
+ "version": "0.0.394-beta.4",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",