@bikdotai/bik-component-library 0.0.639--beta--0.2 → 0.0.639--prev--beta0.22
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.
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js +1 -1
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lodash"),l=require("react"),o=require("../../utils/StringUtils.js"),a=require("../../constants/Theme.js"),i=require("../modals/styledModal.js"),r=require("../template-preview/models/Channels.js"),s=require("../template-preview/models/WhatsAppTemplate.js"),n=require("./context/templateModalContext.js"),d=require("./modalElements/Footer.js"),u=require("./modalElements/TemplateAnalyticsComponent.js"),c=require("./modalElements/TemplateSelectModalContent.js"),p=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=v=>{var m,C,h,b,S,E,f,x,P,T;const{selectedTemplate:g,closeDialog:y,showVariableMapping:I,channel:L,htmlContent:A,templateVariables:D,onTemplateSelect:j,globalPlaceholders:w,showOnlyContent:k,whatsappSpecificPickerMeta:H,zIndex:N,showVariableModal:V,variableList:M,discountCode:O,setDiscountCode:B,onBackPress:q,enabledCustomText:F,variableListForImage:_,showSampleValues:W,disableEditVariable:Y,pod:R,extras:$,pickerConf:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lodash"),l=require("react"),o=require("../../utils/StringUtils.js"),a=require("../../constants/Theme.js"),i=require("../modals/styledModal.js"),r=require("../template-preview/models/Channels.js"),s=require("../template-preview/models/WhatsAppTemplate.js"),n=require("./context/templateModalContext.js"),d=require("./modalElements/Footer.js"),u=require("./modalElements/TemplateAnalyticsComponent.js"),c=require("./modalElements/TemplateSelectModalContent.js"),p=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=v=>{var m,C,h,b,S,E,f,x,P,T;const{selectedTemplate:g,closeDialog:y,showVariableMapping:I,channel:L,htmlContent:A,templateVariables:D,onTemplateSelect:j,globalPlaceholders:w,showOnlyContent:k,whatsappSpecificPickerMeta:H,zIndex:N,showVariableModal:V,variableList:M,discountCode:O,setDiscountCode:B,onBackPress:q,enabledCustomText:F,variableListForImage:_,showSampleValues:W,disableEditVariable:Y,pod:R,extras:$,pickerConf:U,selectedCarouselProducts:z,disableEditExpiry:Q,cardWidth:G,onDeleteSelectedProducts:J,fileName:K,setFileName:X,hideDeviceContainerInPreview:Z,maxCharLimit:ee,onDefaultVariableSelect:te,skipDefaultVariableContent:le,disableDatePicker:oe,disableCopyCode:ae,initialExpiryDateTime:ie,showDiscountCodeExpiryInfo:re,footerButtonText:se,footerInfoText:ne,templateAnalytics:de}=v;l.useEffect((()=>{be(A)}),[A]);const ue=L===r.CHANNEL_TYPE.WHATSAPP&&"CAROUSEL"===(null===(C=null===(m=null==g?void 0:g.components)||void 0===m?void 0:m[1])||void 0===C?void 0:C.type),ce=null==g?void 0:g.isProductCarouselType,[pe,ve]=l.useState(L===r.CHANNEL_TYPE.EMAIL||L==r.CHANNEL_TYPE.WEBPUSH||ue?"desktop":"mobile"),[me,Ce]=l.useState(!1),[he,be]=l.useState(A),[Se,Ee]=l.useState(!1),[fe,xe]=l.useState([]),[Pe,Te]=l.useState({}),[ge,ye]=l.useState(g),[Ie,Le]=l.useState([]),[Ae,De]=l.useState(null),[je,we]=l.useState(!1),[ke,He]=l.useState(null!=D?D:[]),[Ne,Ve]=l.useState(!1),[Me,Oe]=l.useState(ue?(null===(b=null===(h=null==ge?void 0:ge.mapping)||void 0===h?void 0:h.body)||void 0===b?void 0:b.length)?-1:0:-1),[Be,qe]=l.useState([]),[Fe,_e]=l.useState(void 0),We=l.useRef(null),[Ye,Re]=l.useState(!1),[$e,Ue]=l.useState(!1),[ze,Qe]=l.useState(!1),[Ge,Je]=l.useState(!0),[Ke,Xe]=l.useState(!0),[Ze,et]=l.useState({});l.useEffect((()=>{z?qe(z):ce&&qe([])}),[z]),l.useEffect((()=>{var e;if(!je&&ce&&(!z||0===qe.length)){const t=null===(e=null==ge?void 0:ge.components)||void 0===e?void 0:e[1].cards,l=[];null==t||t.forEach((e=>{var t;null===(t=null==e?void 0:e.components)||void 0===t||t.forEach((e=>{var t,o,a;"HEADER"===e.type&&l.push(null!==(a=null===(o=null===(t=e.example)||void 0===t?void 0:t.header_handle)||void 0===o?void 0:o[0])&&void 0!==a?a:"")}))})),Le(l),we(!0)}}),[je]);const tt=l.useMemo((()=>p.convertPlaceholdersToBikDropdown(w)),[w]);return l.useEffect((()=>{_e(t.cloneDeep(M))}),[M]),(null==de?void 0:de.show)&&Ge&&de.templateQuality&&Object.values(s.TEMPLATE_QUALITY).find((e=>e===String(de.templateQuality)))?e.jsx(u.TemplateAnalyticsComponent,{headingTitle:null==ge?void 0:ge.label,headingSubtitle:L===r.CHANNEL_TYPE.WHATSAPP?`${o.default.capitaliseFirstLetterOfString(null!==(S=null==ge?void 0:ge.category)&&void 0!==S?S:"")} • ${null!==(E=null==ge?void 0:ge.templateCategory)&&void 0!==E?E:""}`:"",templateAnalytics:de,onClose:()=>{null==y||y(),Je(!1),Xe(!1)},onCancel:()=>{Je(!1),Xe(!1)},onProceed:()=>{Je(!1),Xe(!0)},templateId:(null==ge?void 0:ge.templateId)||""}):e.jsx(n.TemplateModalContext.Provider,Object.assign({value:{hideFooterButton:ze,setHideFooterButton:Qe,hideCrossButton:$e,setHideCrossButton:Ue,variableList:Fe,setVariableList:_e,variableCallback:Ae,setVariableCallback:De,showVariablePicker:me,setShowVariablePicker:Ce,template:ge,setTemplate:ye,device:pe,setDevice:ve,display_content:he,setDisplayContent:be,originalVariableList:ke,setOriginalVariableList:He,isError:Se,setIsError:Ee,channel:L,globalNormalizedPlaceholders:tt,templateSelectionTriggered:Ne,setTemplateSelectionTriggered:Ve,enabledCustomText:F,disableEditVariable:Y,pod:R,extras:$,isWhatsappCarousel:ue,selectedCarouselIndex:Me,setSelectedCarouselIndex:Oe,isProductCarouselType:ce,templateErrorIndexes:Pe,cardCount:ue?null===(x=null===(f=g.components)||void 0===f?void 0:f[1].cards)||void 0===x?void 0:x.length:void 0,errorIndexes:fe,setErrorIndexes:xe,pickerConf:U,carouselProducts:Be,setCarouselProducts:qe,disableEditExpiry:Q,cardWidth:G,cardImages:Ie,onDeleteSelectedProducts:J,hideDeviceContainerInPreview:Z,sliderRef:We,isCarouselHovered:Ye,setIsCarouselHovered:Re,maxCharLimit:ee,ctaOptionsErrors:Ze,setCtaOptionsErrors:et,onDefaultVariableSelect:te,disableDatePicker:oe,disableCopyCode:ae,initialExpiryDateTime:ie,showDiscountCodeExpiryInfo:re}},{children:k?e.jsx(c.default,{variableListFromProps:M,channel:r.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(i.StyledModal,Object.assign({hideCrossButton:$e,zIndex:N,centralContainerStyles:{width:ue?900:L===r.CHANNEL_TYPE.EMAIL&&I?1e3:800},open:Ke,onClose:()=>{Xe(!1),null==y||y()},headingTitle:null==ge?void 0:ge.label,headingSubtitle:L===r.CHANNEL_TYPE.WHATSAPP?`${o.default.capitaliseFirstLetterOfString(null!==(P=null==ge?void 0:ge.category)&&void 0!==P?P:"")} • ${null!==(T=null==ge?void 0:ge.templateCategory)&&void 0!==T?T:""}`:"",onBackPress:()=>{if(null==de?void 0:de.show)return Je(!0),void Xe(!1);null==q||q()},modalHeaderStyles:{borderBottom:`1px solid ${a.COLORS.stroke.primary}`}},{children:[e.jsx(c.default,{variableListFromProps:M,showSampleValues:W,showVariableMapping:I,channel:L,whatsappSpecificPickerMeta:H,showVariableModal:V,discountCode:O,setDiscountCode:B,variableListForImage:_&&(null==_?void 0:_.length)>0?_:Fe,fileName:K,setFileName:e=>{null==X||X(e)},skipDefaultVariableContent:le}),j?e.jsx(d.default,{isWhatsappCarousel:null!=ue&&ue,onSelect:function(){var e;if((null==Be?void 0:Be.length)<1&&ce)return void Ee(!0);if(Object.keys(Ze).length>0&&R!==s.POD.CHATBOT)return void Ee(!0);const t=null==j?void 0:j(ge,ke,null!=he?he:"",Be);Te(null!==(e=null==t?void 0:t.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==t?void 0:t.errorIndexes)||(null==t?void 0:t.error)?((null==t?void 0:t.errorIndexes)&&xe(t.errorIndexes),(null==t?void 0:t.error)&&Ee(!!(null==t?void 0:t.error))):Ve(!0)},footerButtonText:se,footerInfoText:ne}):e.jsx(e.Fragment,{})]}))}))};
|
package/dist/cjs/components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../shimmer/ShimmerComponent/BikShimmer.js"),i=require("../styles/TemplateAnalyticsStyles.js");const t=()=>e.jsxs("div",Object.assign({className:"each--analytics--container"},{children:[e.jsxs("div",Object.assign({className:"d-flex align--center",style:{gap:8}},{children:[e.jsx(s.BikShimmer,{boxes:[{width:"24px",height:"24px"}]}),e.jsx(s.BikShimmer,{boxes:[{width:"69px",height:"11px"}]})]})),e.jsxs("div",Object.assign({className:"d-flex align--center",style:{gap:8}},{children:[e.jsx(s.BikShimmer,{boxes:[{width:"43px",height:"18px"}]}),e.jsx(s.BikShimmer,{boxes:[{width:"69px",height:"28px"}]})]}))]}));exports.TemplateAnalyticsSkeleton=r=>{const{skipTitleShimmer:x}=r;return e.jsxs(i.RightPanelContainer,{children:[e.jsx("div",{children:x?e.jsx(e.Fragment,{}):e.jsx(s.BikShimmer,{boxes:[{width:"76px",height:"18px"}]})}),e.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../shimmer/ShimmerComponent/BikShimmer.js"),i=require("../styles/TemplateAnalyticsStyles.js");const t=()=>e.jsxs("div",Object.assign({className:"each--analytics--container"},{children:[e.jsxs("div",Object.assign({className:"d-flex align--center",style:{gap:8}},{children:[e.jsx(s.BikShimmer,{boxes:[{width:"24px",height:"24px"}]}),e.jsx(s.BikShimmer,{boxes:[{width:"69px",height:"11px"}]})]})),e.jsxs("div",Object.assign({className:"d-flex align--center",style:{gap:8}},{children:[e.jsx(s.BikShimmer,{boxes:[{width:"43px",height:"18px"}]}),e.jsx(s.BikShimmer,{boxes:[{width:"69px",height:"28px"}]})]}))]}));exports.TemplateAnalyticsSkeleton=r=>{const{skipTitleShimmer:x}=r;return e.jsxs(i.RightPanelContainer,{children:[e.jsx("div",{children:x?e.jsx(e.Fragment,{}):e.jsx(s.BikShimmer,{boxes:[{width:"76px",height:"18px"}]})}),e.jsx("div",Object.assign({className:"mt-3"},{children:[0,1,2].map((s=>e.jsx(t,{},s)))})),e.jsxs(e.Fragment,{children:[e.jsx("div",{children:e.jsx(s.BikShimmer,{boxes:[{width:"76px",height:"18px"}]})}),e.jsx("div",Object.assign({className:"mt-3"},{children:e.jsx(t,{})}))]})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as l,Fragment as o}from"react/jsx-runtime";import{cloneDeep as t}from"lodash";import{useEffect as i,useState as r,useRef as a,useMemo as n}from"react";import s from"../../utils/StringUtils.js";import{COLORS as d}from"../../constants/Theme.js";import{StyledModal as u}from"../modals/styledModal.js";import{CHANNEL_TYPE as c}from"../template-preview/models/Channels.js";import{TEMPLATE_QUALITY as p,POD as m}from"../template-preview/models/WhatsAppTemplate.js";import{TemplateModalContext as v}from"./context/templateModalContext.js";import h from"./modalElements/Footer.js";import{TemplateAnalyticsComponent as C}from"./modalElements/TemplateAnalyticsComponent.js";import b from"./modalElements/TemplateSelectModalContent.js";import{convertPlaceholdersToBikDropdown as f}from"./utils/convertPlaceholdersToBikDropdown.js";const g=g=>{var x,y,P,E,S,T,I,w,D,V;const{selectedTemplate:k,closeDialog:L,showVariableMapping:A,channel:j,htmlContent:B,templateVariables:H,onTemplateSelect:M,globalPlaceholders:O,showOnlyContent:F,whatsappSpecificPickerMeta:W,zIndex:N,showVariableModal:$,variableList:z,discountCode:R,setDiscountCode:U,onBackPress:Q,enabledCustomText:_,variableListForImage:q,showSampleValues:G,disableEditVariable:J,pod:K,extras:X,pickerConf:Y,selectedCarouselProducts:Z,disableEditExpiry:ee,cardWidth:le,onDeleteSelectedProducts:oe,fileName:te,setFileName:ie,hideDeviceContainerInPreview:re,maxCharLimit:ae,onDefaultVariableSelect:ne,skipDefaultVariableContent:se,disableDatePicker:de,disableCopyCode:ue,initialExpiryDateTime:ce,showDiscountCodeExpiryInfo:pe,footerButtonText:me,footerInfoText:ve,templateAnalytics:he}=g;i((()=>{Ee(B)}),[B]);const Ce=j===c.WHATSAPP&&"CAROUSEL"===(null===(y=null===(x=null==k?void 0:k.components)||void 0===x?void 0:x[1])||void 0===y?void 0:y.type),be=null==k?void 0:k.isProductCarouselType,[fe,ge]=r(j===c.EMAIL||j==c.WEBPUSH||Ce?"desktop":"mobile"),[xe,ye]=r(!1),[Pe,Ee]=r(B),[Se,Te]=r(!1),[Ie,we]=r([]),[De,Ve]=r({}),[ke,Le]=r(k),[Ae,je]=r([]),[Be,He]=r(null),[Me,Oe]=r(!1),[Fe,We]=r(null!=H?H:[]),[Ne,$e]=r(!1),[ze,Re]=r(Ce?(null===(E=null===(P=null==ke?void 0:ke.mapping)||void 0===P?void 0:P.body)||void 0===E?void 0:E.length)?-1:0:-1),[Ue,Qe]=r([]),[_e,qe]=r(void 0),Ge=a(null),[Je,Ke]=r(!1),[Xe,Ye]=r(!1),[Ze,el]=r(!1),[ll,ol]=r(!0),[tl,il]=r(!0),[rl,al]=r({});i((()=>{Z?Qe(Z):be&&Qe([])}),[Z]),i((()=>{var e;if(!Me&&be&&(!Z||0===Qe.length)){const l=null===(e=null==ke?void 0:ke.components)||void 0===e?void 0:e[1].cards,o=[];null==l||l.forEach((e=>{var l;null===(l=null==e?void 0:e.components)||void 0===l||l.forEach((e=>{var l,t,i;"HEADER"===e.type&&o.push(null!==(i=null===(t=null===(l=e.example)||void 0===l?void 0:l.header_handle)||void 0===t?void 0:t[0])&&void 0!==i?i:"")}))})),je(o),Oe(!0)}}),[Me]);const nl=n((()=>f(O)),[O]);return i((()=>{qe(t(z))}),[z]),(null==he?void 0:he.show)&&ll&&he.templateQuality&&Object.values(p).find((e=>e===String(he.templateQuality)))?e(C,{headingTitle:null==ke?void 0:ke.label,headingSubtitle:j===c.WHATSAPP?`${s.capitaliseFirstLetterOfString(null!==(S=null==ke?void 0:ke.category)&&void 0!==S?S:"")} • ${null!==(T=null==ke?void 0:ke.templateCategory)&&void 0!==T?T:""}`:"",templateAnalytics:he,onClose:()=>{null==L||L(),ol(!1),il(!1)},onCancel:()=>{ol(!1),il(!1)},onProceed:()=>{ol(!1),il(!0)},templateId:(null==ke?void 0:ke.templateId)||""}):e(v.Provider,Object.assign({value:{hideFooterButton:Ze,setHideFooterButton:el,hideCrossButton:Xe,setHideCrossButton:Ye,variableList:_e,setVariableList:qe,variableCallback:Be,setVariableCallback:He,showVariablePicker:xe,setShowVariablePicker:ye,template:ke,setTemplate:Le,device:fe,setDevice:ge,display_content:Pe,setDisplayContent:Ee,originalVariableList:Fe,setOriginalVariableList:We,isError:Se,setIsError:Te,channel:j,globalNormalizedPlaceholders:nl,templateSelectionTriggered:Ne,setTemplateSelectionTriggered:$e,enabledCustomText:_,disableEditVariable:J,pod:K,extras:X,isWhatsappCarousel:Ce,selectedCarouselIndex:ze,setSelectedCarouselIndex:Re,isProductCarouselType:be,templateErrorIndexes:De,cardCount:Ce?null===(w=null===(I=k.components)||void 0===I?void 0:I[1].cards)||void 0===w?void 0:w.length:void 0,errorIndexes:Ie,setErrorIndexes:we,pickerConf:Y,carouselProducts:Ue,setCarouselProducts:Qe,disableEditExpiry:ee,cardWidth:le,cardImages:Ae,onDeleteSelectedProducts:oe,hideDeviceContainerInPreview:re,sliderRef:Ge,isCarouselHovered:Je,setIsCarouselHovered:Ke,maxCharLimit:ae,ctaOptionsErrors:rl,setCtaOptionsErrors:al,onDefaultVariableSelect:ne,disableDatePicker:de,disableCopyCode:ue,initialExpiryDateTime:ce,showDiscountCodeExpiryInfo:pe}},{children:F?e(b,{variableListFromProps:z,channel:c.EMAIL,hideHeader:!0}):l(u,Object.assign({hideCrossButton:Xe,zIndex:N,centralContainerStyles:{width:Ce?900:j===c.EMAIL&&A?1e3:800},open:tl,onClose:()=>{il(!1),null==L||L()},headingTitle:null==ke?void 0:ke.label,headingSubtitle:j===c.WHATSAPP?`${s.capitaliseFirstLetterOfString(null!==(D=null==ke?void 0:ke.category)&&void 0!==D?D:"")} • ${null!==(V=null==ke?void 0:ke.templateCategory)&&void 0!==V?V:""}`:"",onBackPress:()=>{if(null==he?void 0:he.show)return ol(!0),void il(!1);null==Q||Q()},modalHeaderStyles:{borderBottom:`1px solid ${d.stroke.primary}`}},{children:[e(b,{variableListFromProps:z,showSampleValues:G,showVariableMapping:A,channel:j,whatsappSpecificPickerMeta:W,showVariableModal:$,discountCode:R,setDiscountCode:U,variableListForImage:q&&(null==q?void 0:q.length)>0?q:_e,fileName:te,setFileName:e=>{null==ie||ie(e)},skipDefaultVariableContent:se}),M?e(h,{isWhatsappCarousel:null!=Ce&&Ce,onSelect:function(){var e;if((null==Ue?void 0:Ue.length)<1&&be)return void Te(!0);if(Object.keys(rl).length>0&&K!==m.CHATBOT)return void Te(!0);const l=null==M?void 0:M(ke,Fe,null!=Pe?Pe:"",Ue);Ve(null!==(e=null==l?void 0:l.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==l?void 0:l.errorIndexes)||(null==l?void 0:l.error)?((null==l?void 0:l.errorIndexes)&&we(l.errorIndexes),(null==l?void 0:l.error)&&Te(!!(null==l?void 0:l.error))):$e(!0)},footerButtonText:me,footerInfoText:ve}):e(o,{})]}))}))};export{g as TemplateContextMapper};
|
package/dist/esm/components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as i,Fragment as s}from"react/jsx-runtime";import{BikShimmer as t}from"../../shimmer/ShimmerComponent/BikShimmer.js";import{RightPanelContainer as h}from"../styles/TemplateAnalyticsStyles.js";const
|
|
1
|
+
import{jsxs as e,jsx as i,Fragment as s}from"react/jsx-runtime";import{BikShimmer as t}from"../../shimmer/ShimmerComponent/BikShimmer.js";import{RightPanelContainer as h}from"../styles/TemplateAnalyticsStyles.js";const c=c=>{const{skipTitleShimmer:a}=c;return e(h,{children:[i("div",{children:a?i(s,{}):i(t,{boxes:[{width:"76px",height:"18px"}]})}),i("div",Object.assign({className:"mt-3"},{children:[0,1,2].map((e=>i(n,{},e)))})),e(s,{children:[i("div",{children:i(t,{boxes:[{width:"76px",height:"18px"}]})}),i("div",Object.assign({className:"mt-3"},{children:i(n,{})}))]})]})},n=()=>e("div",Object.assign({className:"each--analytics--container"},{children:[e("div",Object.assign({className:"d-flex align--center",style:{gap:8}},{children:[i(t,{boxes:[{width:"24px",height:"24px"}]}),i(t,{boxes:[{width:"69px",height:"11px"}]})]})),e("div",Object.assign({className:"d-flex align--center",style:{gap:8}},{children:[i(t,{boxes:[{width:"43px",height:"18px"}]}),i(t,{boxes:[{width:"69px",height:"28px"}]})]}))]}));export{c as TemplateAnalyticsSkeleton};
|