@bikdotai/bik-component-library 0.0.564 → 0.0.565
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.
|
@@ -19,4 +19,4 @@
|
|
|
19
19
|
background-image: ${e=>e.hideDeviceContainerInPreview&&e.channel===s.CHANNEL_TYPE.WHATSAPP?`url(${u.BACKGROUND_PREVIEW_IMAGE});`:"none"};
|
|
20
20
|
display: ${e=>e.hideDeviceContainerInPreview&&e.channel===s.CHANNEL_TYPE.WHATSAPP?"flex":"initial"};
|
|
21
21
|
align-items: flex-start;
|
|
22
|
-
`;exports.default=l=>{const{showVariableMapping:u,showOnlyContent:x,whatsappSpecificPickerMeta:b,showVariableModal:j,discountCode:A,setDiscountCode:y,variableListForImage:
|
|
22
|
+
`;exports.default=l=>{const{showVariableMapping:u,showOnlyContent:x,whatsappSpecificPickerMeta:b,showVariableModal:j,discountCode:A,setDiscountCode:y,variableListForImage:N,showSampleValues:T,variableListFromProps:S,fileName:L,setFileName:k}=l,M=i.useRef(),V=i.useRef(),{variableList:_,setVariableList:H,variableCallback:q,showVariablePicker:O,setShowVariablePicker:W,device:I,display_content:D,channel:F,template:Y,setTemplate:B,isWhatsappCarousel:$,isProductCarouselType:R,hideDeviceContainerInPreview:G}=c.useTemplateModalContext();const K=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t};return e.jsxs(g,{children:[e.jsx(f,Object.assign({showOnlyContent:x,showVariableMapping:u,isWhatsappCarousel:$,hideDeviceContainerInPreview:G,channel:F},{children:"mobile"===I?e.jsx(w.default,{ref:V,display_content:null!=D?D:"",channel:F,template:Y,showSampleValues:T}):F===s.CHANNEL_TYPE.WHATSAPP&&$?e.jsx(o.CarouselPreview,{ref:M,channel:F,template:Y,showSampleValues:T,isPreview:!1,showArrows:!0}):F!==s.CHANNEL_TYPE.MESSAGE?e.jsx(C.default,{ref:M,channel:F,display_content:null!=D?D:"",showSampleValues:T}):e.jsx(e.Fragment,{})})),(R||u)&&e.jsxs(E,Object.assign({channel:F,isWhatsappCarousel:$,showVariableMapping:!0},{children:[e.jsx("div",Object.assign({style:{height:"100%",width:"whatsapp"===F?428:400,display:O?"block":"none"}},{children:e.jsx(d.VariablePicker,{hideHeaderCross:!0,showHeader:!0,showBackButton:!0,onBackButtonClick:()=>{H(a.cloneDeep(S)),W(!1)},onSelect:e=>{q(e),H(a.cloneDeep(S)),W(!1)},type:t.PickerType.EMBEDDED,data:null!=_?_:[]},Math.random())})),e.jsx("div",Object.assign({style:{padding:"16px 14px",width:"whatsapp"===F?428:400,display:O?"none":"block"}},{children:F!==s.CHANNEL_TYPE.WHATSAPP?e.jsx(P.default,{onFocus:F===s.CHANNEL_TYPE.EMAIL?function(e){var t,a,i;const l=null===document||void 0===document?void 0:document.getElementById("mobile"===I?"template_html_mobile":"template_html_desktop"),o=h.getVariableNameForEmailByIndex(e+1),r=F===s.CHANNEL_TYPE.EMAIL?null===(t=null==l?void 0:l.contentWindow)||void 0===t?void 0:t.document.getElementById(o):document.getElementById(o),n=K(r),d=null==r?void 0:r.offsetLeft;"desktop"===I?n&&M.current&&(null===(a=null==l?void 0:l.contentWindow)||void 0===a||a.scrollTo(null!=d?d:0,n),m.highlightFor(o,p.COLORS.background.warning.light,2,F,I)):n&&V.current&&(null===(i=null==l?void 0:l.contentWindow)||void 0===i||i.scrollTo(null!=d?d:0,n),m.highlightFor(o,p.COLORS.background.warning.light,2,F,I))}:void 0,showVariableModal:j,discountCode:A,setDiscountCode:y}):F===s.CHANNEL_TYPE.WHATSAPP&&$?e.jsx(r.default,{whatsappSpecificPickerMeta:b,template:Y,showVariableModal:j,variableListForImage:N,discountCode:A,setDiscountCode:y}):e.jsx(v.default,{whatsappSpecificPickerMeta:b,template:Y,onTemplateChange:e=>{null==B||B(e)},showVariableModal:j,variableListForImage:N,discountCode:A,setDiscountCode:y,fileName:L,setFileName:k})}))]})),[s.CHANNEL_TYPE.WHATSAPP,s.CHANNEL_TYPE.SMS].includes(F)&&!u&&!R&&e.jsx(E,{children:e.jsx(n.BodySecondary,Object.assign({color:p.COLORS.content.secondary,style:{fontStyle:"italic"}},{children:"Click on ‘Select template’ below to use it"}))})]})};
|
|
@@ -19,4 +19,4 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import"../../cur
|
|
|
19
19
|
background-image: ${e=>e.hideDeviceContainerInPreview&&e.channel===p.WHATSAPP?`url(${u});`:"none"};
|
|
20
20
|
display: ${e=>e.hideDeviceContainerInPreview&&e.channel===p.WHATSAPP?"flex":"initial"};
|
|
21
21
|
align-items: flex-start;
|
|
22
|
-
`,k=n=>{const{showVariableMapping:u,showOnlyContent:k,whatsappSpecificPickerMeta:S,showVariableModal:j,discountCode:A,setDiscountCode:M,variableListForImage:V,showSampleValues:W,variableListFromProps:T}=n,
|
|
22
|
+
`,k=n=>{const{showVariableMapping:u,showOnlyContent:k,whatsappSpecificPickerMeta:S,showVariableModal:j,discountCode:A,setDiscountCode:M,variableListForImage:V,showSampleValues:W,variableListFromProps:T,fileName:E,setFileName:I}=n,D=l(),$=l(),{variableList:H,setVariableList:L,variableCallback:B,showVariablePicker:F,setShowVariablePicker:O,device:_,display_content:N,channel:G,template:q,setTemplate:z,isWhatsappCarousel:J,isProductCarouselType:K,hideDeviceContainerInPreview:Q}=h();const R=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t};return e(P,{children:[t(y,Object.assign({showOnlyContent:k,showVariableMapping:u,isWhatsappCarousel:J,hideDeviceContainerInPreview:Q,channel:G},{children:"mobile"===_?t(g,{ref:$,display_content:null!=N?N:"",channel:G,template:q,showSampleValues:W}):G===p.WHATSAPP&&J?t(r,{ref:D,channel:G,template:q,showSampleValues:W,isPreview:!1,showArrows:!0}):G!==p.MESSAGE?t(f,{ref:D,channel:G,display_content:null!=N?N:"",showSampleValues:W}):t(o,{})})),(K||u)&&e(x,Object.assign({channel:G,isWhatsappCarousel:J,showVariableMapping:!0},{children:[t("div",Object.assign({style:{height:"100%",width:"whatsapp"===G?428:400,display:F?"block":"none"}},{children:t(c,{hideHeaderCross:!0,showHeader:!0,showBackButton:!0,onBackButtonClick:()=>{L(a(T)),O(!1)},onSelect:e=>{B(e),L(a(T)),O(!1)},type:i.EMBEDDED,data:null!=H?H:[]},Math.random())})),t("div",Object.assign({style:{padding:"16px 14px",width:"whatsapp"===G?428:400,display:F?"none":"block"}},{children:G!==p.WHATSAPP?t(C,{onFocus:G===p.EMAIL?function(e){var t,o,i;const a=null===document||void 0===document?void 0:document.getElementById("mobile"===_?"template_html_mobile":"template_html_desktop"),l=w(e+1),n=G===p.EMAIL?null===(t=null==a?void 0:a.contentWindow)||void 0===t?void 0:t.document.getElementById(l):document.getElementById(l),r=R(n),s=null==n?void 0:n.offsetLeft;"desktop"===_?r&&D.current&&(null===(o=null==a?void 0:a.contentWindow)||void 0===o||o.scrollTo(null!=s?s:0,r),v(l,m.background.warning.light,2,G,_)):r&&$.current&&(null===(i=null==a?void 0:a.contentWindow)||void 0===i||i.scrollTo(null!=s?s:0,r),v(l,m.background.warning.light,2,G,_))}:void 0,showVariableModal:j,discountCode:A,setDiscountCode:M}):G===p.WHATSAPP&&J?t(s,{whatsappSpecificPickerMeta:S,template:q,showVariableModal:j,variableListForImage:V,discountCode:A,setDiscountCode:M}):t(b,{whatsappSpecificPickerMeta:S,template:q,onTemplateChange:e=>{null==z||z(e)},showVariableModal:j,variableListForImage:V,discountCode:A,setDiscountCode:M,fileName:E,setFileName:I})}))]})),[p.WHATSAPP,p.SMS].includes(G)&&!u&&!K&&t(x,{children:t(d,Object.assign({color:m.content.secondary,style:{fontStyle:"italic"}},{children:"Click on ‘Select template’ below to use it"}))})]})};export{k as default};
|