@bikdotai/bik-component-library 0.0.616 → 0.0.617-beta-tcmbc.1

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 (23) hide show
  1. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  2. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  3. package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  4. package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  5. package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  6. package/dist/cjs/components/accordion/Accordion.js +1 -1
  7. package/dist/cjs/components/bik-layout/MockMenus.d.ts +1 -0
  8. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.d.ts +2 -0
  9. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
  10. package/dist/cjs/components/template-context-mapper/modalElements/Footer.d.ts +3 -1
  11. package/dist/cjs/components/template-context-mapper/modalElements/Footer.js +2 -2
  12. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  13. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  14. package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  15. package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  16. package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  17. package/dist/esm/components/accordion/Accordion.js +1 -1
  18. package/dist/esm/components/bik-layout/MockMenus.d.ts +1 -0
  19. package/dist/esm/components/template-context-mapper/TemplateContextMapper.d.ts +2 -0
  20. package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
  21. package/dist/esm/components/template-context-mapper/modalElements/Footer.d.ts +3 -1
  22. package/dist/esm/components/template-context-mapper/modalElements/Footer.js +4 -4
  23. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default EventsTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default IGTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption } from "../../../dropdown/type";
3
- import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
4
- import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
3
+ import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
4
+ import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
5
5
  declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
6
6
  cacheKey: string;
7
7
  propertyAddBtnText: string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../TypographyStyle.js"),n=require("../button/Button.js"),o=require("./Accordion.style.js"),i=require("./AccordionArrow.js");exports.BikAccordion=s=>{var c,a;const[l,d]=r.useState(!1),u=r.useRef(null),h=r.useRef(null);r.useEffect((()=>{s.autoOpen&&v(s.autoOpen,{})}),[s.autoOpen]),r.useEffect((()=>{void 0!==s.isOpen&&v(s.isOpen,{})}),[s.isOpen]);const v=(e,r)=>{var t,n;h.current&&u.current&&("keydown"===r.type&&"Enter"!==r.key||(e!==l&&d(e),e?(h.current.style.maxHeight=(null!==(t=s.childrenMaxHeight)&&void 0!==t?t:h.current.scrollHeight)+"px",u.current.style.transform="rotate(180deg)",u.current.style.transition="transform 0.25s ease-in-out",h.current.style.transition="max-height 0.25s ease-in-out"):(h.current.style.maxHeight="",u.current.style.transform="rotate(0deg)",u.current.style.transition="transform 0.25s ease-in-out",h.current.style.transition="padding 0s"),null===(n=s.onToggleAccordion)||void 0===n||n.call(s,e)))};return r.useEffect((()=>{const e=new MutationObserver((()=>{l&&h.current&&(h.current.style.maxHeight=h.current.scrollHeight+"px")}));return h.current&&e.observe(h.current,{childList:!0,subtree:!0}),()=>{e.disconnect()}}),[l]),r.useEffect((()=>{var e;l&&(null==s?void 0:s.refresh)&&(null===(e=null==h?void 0:h.current)||void 0===e?void 0:e.scrollHeight)&&!s.childrenMaxHeight&&setTimeout((()=>{h.current.style.maxHeight=h.current.scrollHeight+"px"}),100)}),[l,null==s?void 0:s.refresh,null===(c=null==h?void 0:h.current)||void 0===c?void 0:c.scrollHeight]),e.jsxs(o.default,Object.assign({className:"accordion",isActive:l,width:null==s?void 0:s.width,contentMargin:null==s?void 0:s.contentMargin,headerPadding:s.headerPadding,skipHoverState:s.skipHoverHeader,showBorders:s.showBorders,backgroundColor:s.backgroundColor,openDirection:s.openDirection},{children:[e.jsxs("div",Object.assign({className:"accordion__overview "+(l?"active":""),onClick:e=>v(!l,e),onKeyDown:e=>v(!l,e),role:"button",tabIndex:0},{children:[!s.rightActionComponent&&e.jsxs("div",Object.assign({className:"accordion__overview__header",style:null!==(a=s.headerStyles)&&void 0!==a?a:{}},{children:[e.jsxs(o.AccordionHeaderGroup,{children:["string"==typeof s.header?e.jsx(t.TitleRegular,{children:null==s?void 0:s.header}):s.header,e.jsx(n.Button,{buttonText:s.buttonLinkText,buttonType:"text",darkMode:!0,onClick:s.onButtonLinkClick})]}),e.jsx(i.default,{arrowColor:s.arrowColor,isNewIcon:!0,ref:u})]})),s.rightActionComponent&&e.jsxs("div",Object.assign({className:"accordion__overview__header"},{children:[e.jsxs("div",Object.assign({className:"accordion__overview__title-wrapper"},{children:[e.jsx(i.default,{arrowColor:s.arrowColor,isNewIcon:!0,ref:u}),"string"==typeof s.header?e.jsx(t.TitleRegular,{children:null==s?void 0:s.header}):s.header]})),e.jsx("div",Object.assign({onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"===e.key&&e.stopPropagation()},role:"button",tabIndex:0},{children:s.rightActionComponent}))]})),(null==s?void 0:s.caption)&&e.jsx("div",Object.assign({className:"accordion__overview__caption"},{children:e.jsx(t.BodySecondary,{children:e.jsx("div",Object.assign({style:s.captionStyle},{children:s.caption}))})}))]})),e.jsx("div",Object.assign({ref:h,className:"accordion__content"},{children:s.children}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../TypographyStyle.js"),n=require("../button/Button.js"),o=require("./Accordion.style.js"),i=require("./AccordionArrow.js");exports.BikAccordion=s=>{var c,a;const[l,d]=r.useState(!1),u=r.useRef(null),h=r.useRef(null);r.useEffect((()=>{s.autoOpen&&v(s.autoOpen,{})}),[s.autoOpen]),r.useEffect((()=>{void 0!==s.isOpen&&v(s.isOpen,{})}),[s.isOpen]);const v=(e,r)=>{var t,n;h.current&&u.current&&("keydown"===r.type&&"Enter"!==r.key||(e!==l&&d(e),e?(h.current.style.maxHeight=(null!==(t=s.childrenMaxHeight)&&void 0!==t?t:h.current.scrollHeight)+"px",u.current.style.transform="rotate(180deg)",u.current.style.transition="transform 0.25s ease-in-out",h.current.style.transition="max-height 0.25s ease-in-out"):(h.current.style.maxHeight="",u.current.style.transform="rotate(0deg)",u.current.style.transition="transform 0.25s ease-in-out",h.current.style.transition="padding 0s"),null===(n=s.onToggleAccordion)||void 0===n||n.call(s,e)))};return r.useEffect((()=>{const e=new MutationObserver((()=>{l&&h.current&&(h.current.style.maxHeight=h.current.scrollHeight+"px")}));return h.current&&e.observe(h.current,{childList:!0,subtree:!0}),()=>{e.disconnect()}}),[l]),r.useEffect((()=>{var e;l&&(null==s?void 0:s.refresh)&&(null===(e=null==h?void 0:h.current)||void 0===e?void 0:e.scrollHeight)&&!s.childrenMaxHeight&&setTimeout((()=>{h.current.style.maxHeight=h.current.scrollHeight+"px"}),100)}),[l,null==s?void 0:s.refresh,null===(c=null==h?void 0:h.current)||void 0===c?void 0:c.scrollHeight]),e.jsxs(o.default,Object.assign({className:"accordion",isActive:l,width:null==s?void 0:s.width,contentMargin:null==s?void 0:s.contentMargin,headerPadding:s.headerPadding,skipHoverState:s.skipHoverHeader,showBorders:s.showBorders,backgroundColor:s.backgroundColor,openDirection:s.openDirection},{children:[e.jsxs("div",Object.assign({className:"accordion__overview "+(l?"active":""),onClick:e=>v(!l,e),onKeyDown:e=>v(!l,e),role:"button",tabIndex:0},{children:[!s.rightActionComponent&&e.jsxs("div",Object.assign({className:"accordion__overview__header",style:null!==(a=s.headerStyles)&&void 0!==a?a:{}},{children:[e.jsxs(o.AccordionHeaderGroup,{children:["string"==typeof s.header?e.jsx(t.TitleRegular,{children:null==s?void 0:s.header}):s.header,s.buttonLinkText&&e.jsx(n.Button,{buttonText:s.buttonLinkText,buttonType:"text",darkMode:!0,onClick:s.onButtonLinkClick})]}),e.jsx(i.default,{arrowColor:s.arrowColor,isNewIcon:!0,ref:u})]})),s.rightActionComponent&&e.jsxs("div",Object.assign({className:"accordion__overview__header"},{children:[e.jsxs("div",Object.assign({className:"accordion__overview__title-wrapper"},{children:[e.jsx(i.default,{arrowColor:s.arrowColor,isNewIcon:!0,ref:u}),"string"==typeof s.header?e.jsx(t.TitleRegular,{children:null==s?void 0:s.header}):s.header]})),e.jsx("div",Object.assign({onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"===e.key&&e.stopPropagation()},role:"button",tabIndex:0},{children:s.rightActionComponent}))]})),(null==s?void 0:s.caption)&&e.jsx("div",Object.assign({className:"accordion__overview__caption"},{children:e.jsx(t.BodySecondary,{children:e.jsx("div",Object.assign({style:s.captionStyle},{children:s.caption}))})}))]})),e.jsx("div",Object.assign({ref:h,className:"accordion__content"},{children:s.children}))]}))};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -60,5 +60,7 @@ export interface TemplateContextMapperProps {
60
60
  disableCopyCode?: boolean;
61
61
  initialExpiryDateTime?: string;
62
62
  showDiscountCodeExpiryInfo?: boolean;
63
+ footerButtonText?: string;
64
+ footerInfoText?: string;
63
65
  }
64
66
  export declare const TemplateContextMapper: (props: TemplateContextMapperProps) => import("react/jsx-runtime").JSX.Element;
@@ -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/TemplateSelectModalContent.js"),c=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=p=>{var v,m,C,h,b,S,E,x;const{selectedTemplate:P,closeDialog:f,showVariableMapping:g,channel:T,htmlContent:y,templateVariables:D,onTemplateSelect:I,globalPlaceholders:L,showOnlyContent:j,whatsappSpecificPickerMeta:w,zIndex:k,showVariableModal:V,variableList:A,discountCode:H,setDiscountCode:M,onBackPress:N,enabledCustomText:O,variableListForImage:q,showSampleValues:B,disableEditVariable:F,pod:_,extras:W,pickerConf:Y,selectedCarouselProducts:R,disableEditExpiry:z,cardWidth:U,onDeleteSelectedProducts:$,fileName:G,setFileName:J,hideDeviceContainerInPreview:K,maxCharLimit:Q,onDefaultVariableSelect:X,skipDefaultVariableContent:Z,disableDatePicker:ee,disableCopyCode:te,initialExpiryDateTime:le,showDiscountCodeExpiryInfo:oe}=p;l.useEffect((()=>{ce(y)}),[y]);const ae=T===r.CHANNEL_TYPE.WHATSAPP&&"CAROUSEL"===(null===(m=null===(v=null==P?void 0:P.components)||void 0===v?void 0:v[1])||void 0===m?void 0:m.type),ie=null==P?void 0:P.isProductCarouselType,[re,se]=l.useState(T===r.CHANNEL_TYPE.EMAIL||T==r.CHANNEL_TYPE.WEBPUSH||ae?"desktop":"mobile"),[ne,de]=l.useState(!1),[ue,ce]=l.useState(y),[pe,ve]=l.useState(!1),[me,Ce]=l.useState([]),[he,be]=l.useState({}),[Se,Ee]=l.useState(P),[xe,Pe]=l.useState([]),[fe,ge]=l.useState(null),[Te,ye]=l.useState(!1),[De,Ie]=l.useState(null!=D?D:[]),[Le,je]=l.useState(!1),[we,ke]=l.useState(ae?(null===(h=null===(C=null==Se?void 0:Se.mapping)||void 0===C?void 0:C.body)||void 0===h?void 0:h.length)?-1:0:-1),[Ve,Ae]=l.useState([]),[He,Me]=l.useState(void 0),Ne=l.useRef(null),[Oe,qe]=l.useState(!1),[Be,Fe]=l.useState(!1),[_e,We]=l.useState(!1),[Ye,Re]=l.useState({});l.useEffect((()=>{R?Ae(R):ie&&Ae([])}),[R]),l.useEffect((()=>{var e;if(!Te&&ie&&(!R||0===Ae.length)){const t=null===(e=null==Se?void 0:Se.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:"")}))})),Pe(l),ye(!0)}}),[Te]);const ze=l.useMemo((()=>c.convertPlaceholdersToBikDropdown(L)),[L]);return l.useEffect((()=>{Me(t.cloneDeep(A))}),[A]),e.jsx(n.TemplateModalContext.Provider,Object.assign({value:{hideFooterButton:_e,setHideFooterButton:We,hideCrossButton:Be,setHideCrossButton:Fe,variableList:He,setVariableList:Me,variableCallback:fe,setVariableCallback:ge,showVariablePicker:ne,setShowVariablePicker:de,template:Se,setTemplate:Ee,device:re,setDevice:se,display_content:ue,setDisplayContent:ce,originalVariableList:De,setOriginalVariableList:Ie,isError:pe,setIsError:ve,channel:T,globalNormalizedPlaceholders:ze,templateSelectionTriggered:Le,setTemplateSelectionTriggered:je,enabledCustomText:O,disableEditVariable:F,pod:_,extras:W,isWhatsappCarousel:ae,selectedCarouselIndex:we,setSelectedCarouselIndex:ke,isProductCarouselType:ie,templateErrorIndexes:he,cardCount:ae?null===(S=null===(b=P.components)||void 0===b?void 0:b[1].cards)||void 0===S?void 0:S.length:void 0,errorIndexes:me,setErrorIndexes:Ce,pickerConf:Y,carouselProducts:Ve,setCarouselProducts:Ae,disableEditExpiry:z,cardWidth:U,cardImages:xe,onDeleteSelectedProducts:$,hideDeviceContainerInPreview:K,sliderRef:Ne,isCarouselHovered:Oe,setIsCarouselHovered:qe,maxCharLimit:Q,ctaOptionsErrors:Ye,setCtaOptionsErrors:Re,onDefaultVariableSelect:X,disableDatePicker:ee,disableCopyCode:te,initialExpiryDateTime:le,showDiscountCodeExpiryInfo:oe}},{children:j?e.jsx(u.default,{variableListFromProps:A,channel:r.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(i.StyledModal,Object.assign({hideCrossButton:Be,zIndex:k,centralContainerStyles:{width:ae?900:T===r.CHANNEL_TYPE.EMAIL&&g?1e3:800},open:!0,onClose:()=>{null==f||f()},headingTitle:null==Se?void 0:Se.label,headingSubtitle:T===r.CHANNEL_TYPE.WHATSAPP?`${o.default.capitaliseFirstLetterOfString(null!==(E=null==Se?void 0:Se.category)&&void 0!==E?E:"")} • ${null!==(x=null==Se?void 0:Se.templateCategory)&&void 0!==x?x:""}`:"",onBackPress:()=>{null==N||N()},modalHeaderStyles:{borderBottom:`1px solid ${a.COLORS.stroke.primary}`}},{children:[e.jsx(u.default,{variableListFromProps:A,showSampleValues:B,showVariableMapping:g,channel:T,whatsappSpecificPickerMeta:w,showVariableModal:V,discountCode:H,setDiscountCode:M,variableListForImage:q&&(null==q?void 0:q.length)>0?q:He,fileName:G,setFileName:e=>{null==J||J(e)},skipDefaultVariableContent:Z}),I?e.jsx(d.default,{isWhatsappCarousel:null!=ae&&ae,onSelect:function(){var e;if((null==Ve?void 0:Ve.length)<1&&ie)return void ve(!0);if(Object.keys(Ye).length>0&&_!==s.POD.CHATBOT)return void ve(!0);const t=null==I?void 0:I(Se,De,null!=ue?ue:"",Ve);be(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)&&Ce(t.errorIndexes),(null==t?void 0:t.error)&&ve(!!(null==t?void 0:t.error))):je(!0)}}):e.jsx(e.Fragment,{})]}))}))};
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/TemplateSelectModalContent.js"),c=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=p=>{var v,m,C,h,b,S,E,x;const{selectedTemplate:f,closeDialog:P,showVariableMapping:T,channel:g,htmlContent:y,templateVariables:I,onTemplateSelect:D,globalPlaceholders:L,showOnlyContent:j,whatsappSpecificPickerMeta:w,zIndex:k,showVariableModal:V,variableList:A,discountCode:H,setDiscountCode:M,onBackPress:N,enabledCustomText:B,variableListForImage:O,showSampleValues:q,disableEditVariable:F,pod:_,extras:W,pickerConf:Y,selectedCarouselProducts:R,disableEditExpiry:z,cardWidth:U,onDeleteSelectedProducts:$,fileName:G,setFileName:J,hideDeviceContainerInPreview:K,maxCharLimit:Q,onDefaultVariableSelect:X,skipDefaultVariableContent:Z,disableDatePicker:ee,disableCopyCode:te,initialExpiryDateTime:le,showDiscountCodeExpiryInfo:oe,footerButtonText:ae,footerInfoText:ie}=p;l.useEffect((()=>{ve(y)}),[y]);const re=g===r.CHANNEL_TYPE.WHATSAPP&&"CAROUSEL"===(null===(m=null===(v=null==f?void 0:f.components)||void 0===v?void 0:v[1])||void 0===m?void 0:m.type),se=null==f?void 0:f.isProductCarouselType,[ne,de]=l.useState(g===r.CHANNEL_TYPE.EMAIL||g==r.CHANNEL_TYPE.WEBPUSH||re?"desktop":"mobile"),[ue,ce]=l.useState(!1),[pe,ve]=l.useState(y),[me,Ce]=l.useState(!1),[he,be]=l.useState([]),[Se,Ee]=l.useState({}),[xe,fe]=l.useState(f),[Pe,Te]=l.useState([]),[ge,ye]=l.useState(null),[Ie,De]=l.useState(!1),[Le,je]=l.useState(null!=I?I:[]),[we,ke]=l.useState(!1),[Ve,Ae]=l.useState(re?(null===(h=null===(C=null==xe?void 0:xe.mapping)||void 0===C?void 0:C.body)||void 0===h?void 0:h.length)?-1:0:-1),[He,Me]=l.useState([]),[Ne,Be]=l.useState(void 0),Oe=l.useRef(null),[qe,Fe]=l.useState(!1),[_e,We]=l.useState(!1),[Ye,Re]=l.useState(!1),[ze,Ue]=l.useState({});l.useEffect((()=>{R?Me(R):se&&Me([])}),[R]),l.useEffect((()=>{var e;if(!Ie&&se&&(!R||0===Me.length)){const t=null===(e=null==xe?void 0:xe.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:"")}))})),Te(l),De(!0)}}),[Ie]);const $e=l.useMemo((()=>c.convertPlaceholdersToBikDropdown(L)),[L]);return l.useEffect((()=>{Be(t.cloneDeep(A))}),[A]),e.jsx(n.TemplateModalContext.Provider,Object.assign({value:{hideFooterButton:Ye,setHideFooterButton:Re,hideCrossButton:_e,setHideCrossButton:We,variableList:Ne,setVariableList:Be,variableCallback:ge,setVariableCallback:ye,showVariablePicker:ue,setShowVariablePicker:ce,template:xe,setTemplate:fe,device:ne,setDevice:de,display_content:pe,setDisplayContent:ve,originalVariableList:Le,setOriginalVariableList:je,isError:me,setIsError:Ce,channel:g,globalNormalizedPlaceholders:$e,templateSelectionTriggered:we,setTemplateSelectionTriggered:ke,enabledCustomText:B,disableEditVariable:F,pod:_,extras:W,isWhatsappCarousel:re,selectedCarouselIndex:Ve,setSelectedCarouselIndex:Ae,isProductCarouselType:se,templateErrorIndexes:Se,cardCount:re?null===(S=null===(b=f.components)||void 0===b?void 0:b[1].cards)||void 0===S?void 0:S.length:void 0,errorIndexes:he,setErrorIndexes:be,pickerConf:Y,carouselProducts:He,setCarouselProducts:Me,disableEditExpiry:z,cardWidth:U,cardImages:Pe,onDeleteSelectedProducts:$,hideDeviceContainerInPreview:K,sliderRef:Oe,isCarouselHovered:qe,setIsCarouselHovered:Fe,maxCharLimit:Q,ctaOptionsErrors:ze,setCtaOptionsErrors:Ue,onDefaultVariableSelect:X,disableDatePicker:ee,disableCopyCode:te,initialExpiryDateTime:le,showDiscountCodeExpiryInfo:oe}},{children:j?e.jsx(u.default,{variableListFromProps:A,channel:r.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(i.StyledModal,Object.assign({hideCrossButton:_e,zIndex:k,centralContainerStyles:{width:re?900:g===r.CHANNEL_TYPE.EMAIL&&T?1e3:800},open:!0,onClose:()=>{null==P||P()},headingTitle:null==xe?void 0:xe.label,headingSubtitle:g===r.CHANNEL_TYPE.WHATSAPP?`${o.default.capitaliseFirstLetterOfString(null!==(E=null==xe?void 0:xe.category)&&void 0!==E?E:"")} • ${null!==(x=null==xe?void 0:xe.templateCategory)&&void 0!==x?x:""}`:"",onBackPress:N,modalHeaderStyles:{borderBottom:`1px solid ${a.COLORS.stroke.primary}`}},{children:[e.jsx(u.default,{variableListFromProps:A,showSampleValues:q,showVariableMapping:T,channel:g,whatsappSpecificPickerMeta:w,showVariableModal:V,discountCode:H,setDiscountCode:M,variableListForImage:O&&(null==O?void 0:O.length)>0?O:Ne,fileName:G,setFileName:e=>{null==J||J(e)},skipDefaultVariableContent:Z}),D?e.jsx(d.default,{isWhatsappCarousel:null!=re&&re,onSelect:function(){var e;if((null==He?void 0:He.length)<1&&se)return void Ce(!0);if(Object.keys(ze).length>0&&_!==s.POD.CHATBOT)return void Ce(!0);const t=null==D?void 0:D(xe,Le,null!=pe?pe:"",He);Ee(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)&&be(t.errorIndexes),(null==t?void 0:t.error)&&Ce(!!(null==t?void 0:t.error))):ke(!0)},footerButtonText:ae,footerInfoText:ie}):e.jsx(e.Fragment,{})]}))}))};
@@ -1,6 +1,8 @@
1
1
  export interface FooterProps {
2
2
  isWhatsappCarousel: boolean;
3
3
  onSelect: () => void;
4
+ footerButtonText?: string;
5
+ footerInfoText?: string;
4
6
  }
5
- declare const Footer: ({ isWhatsappCarousel, onSelect }: FooterProps) => import("react/jsx-runtime").JSX.Element;
7
+ declare const Footer: ({ isWhatsappCarousel, onSelect, footerButtonText, footerInfoText, }: FooterProps) => import("react/jsx-runtime").JSX.Element;
6
8
  export default Footer;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("styled-components"),o=require("../../button/Button.js"),s=require("../../TypographyStyle.js"),l=require("../../../constants/Theme.js"),n=require("../Badge/index.js"),i=require("../context/templateModalContext.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const d=a(r).default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/info.svg.js"),r=require("react"),o=require("styled-components"),s=require("../../button/Button.js"),n=require("../../tag/Tag.js"),i=require("../../TypographyStyle.js"),l=require("../../../constants/Theme.js"),a=require("../Badge/index.js"),d=require("../context/templateModalContext.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const c=u(o).default.div`
2
2
  background: ${l.COLORS.surface.standard};
3
3
  border-top-width: 1px;
4
4
  border-top-color: ${l.COLORS.stroke.primary};
@@ -12,4 +12,4 @@
12
12
  border-bottom-left-radius: 4px;
13
13
  border-bottom-right-radius: 4px;
14
14
  height: ${e=>e.isWhatsappCarousel?64:80}px;
15
- `;exports.default=r=>{let{isWhatsappCarousel:a,onSelect:u}=r;var p,c,x,b;const{isError:g,selectedCarouselIndex:h,setSelectedCarouselIndex:j,setErrorIndexes:f,template:m,showVariablePicker:v,hideFooterButton:y}=i.useTemplateModalContext(),[C,S]=t.useState(a?"Next":"Select template");return t.useEffect((()=>{a&&-1===h?S("Next"):a&&null!=h&&h>-1&&S("Save & Select Template")}),[h]),e.jsxs(d,Object.assign({isWhatsappCarousel:a,justifyContent:a&&(null===(c=null===(p=null==m?void 0:m.mapping)||void 0===p?void 0:p.body)||void 0===c?void 0:c.length)?"space-between":"end"},{children:[a&&null!=h&&h>=-1&&!!(null===(b=null===(x=null==m?void 0:m.mapping)||void 0===x?void 0:x.body)||void 0===b?void 0:b.length)&&e.jsx(s.TitleRegular,Object.assign({color:l.COLORS.text.secondary},{children:`Step ${-1===h?1:2}/2`})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row"}},{children:[g&&e.jsx(n.Badge,{errorText:"Some inputs are missing or incorrect. Please check"}),!y&&e.jsx(o.Button,{disabled:v,id:"select-template-btn",buttonText:C,size:a?"small":"large",onClick:function(){a&&-1===h&&j?j(0):(null==f||f([]),u())}})]}))]}))};
15
+ `;exports.default=o=>{let{isWhatsappCarousel:u,onSelect:p,footerButtonText:x,footerInfoText:g}=o;var f,b,j,h;const{isError:v,selectedCarouselIndex:m,setSelectedCarouselIndex:y,setErrorIndexes:C,template:S,showVariablePicker:T,hideFooterButton:q}=d.useTemplateModalContext(),[O,w]=r.useState(u?"Next":"Select template");return r.useEffect((()=>{x?w(x):u&&-1===m?w("Next"):u&&null!=m&&m>-1&&w("Save & Select Template")}),[m]),e.jsxs(c,Object.assign({isWhatsappCarousel:u,justifyContent:u&&(null===(b=null===(f=null==S?void 0:S.mapping)||void 0===f?void 0:f.body)||void 0===b?void 0:b.length)?"space-between":"end"},{children:[u&&null!=m&&m>=-1&&!!(null===(h=null===(j=null==S?void 0:S.mapping)||void 0===j?void 0:j.body)||void 0===h?void 0:h.length)&&e.jsx(i.TitleRegular,Object.assign({color:l.COLORS.text.secondary},{children:`Step ${-1===m?1:2}/2`})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row"}},{children:[v&&e.jsx(a.Badge,{errorText:"Some inputs are missing or incorrect. Please check"}),!v&&g&&e.jsx(n.Tag,{tagText:g,LeadingIcon:t.default}),!q&&e.jsx(s.Button,{disabled:T,id:"select-template-btn",buttonText:O,size:u?"small":"large",onClick:function(){u&&-1===m&&y?y(0):(null==C||C([]),p())}})]}))]}))};
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default EventsTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default IGTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption } from "../../../dropdown/type";
3
- import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
4
- import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
3
+ import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
4
+ import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
5
5
  declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
6
6
  cacheKey: string;
7
7
  propertyAddBtnText: string;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as t,useRef as n,useEffect as o}from"react";import{TitleRegular as i,BodySecondary as c}from"../TypographyStyle.js";import{Button as s}from"../button/Button.js";import a,{AccordionHeaderGroup as l}from"./Accordion.style.js";import d from"./AccordionArrow.js";const u=u=>{var h,v;const[g,p]=t(!1),m=n(null),y=n(null);o((()=>{u.autoOpen&&b(u.autoOpen,{})}),[u.autoOpen]),o((()=>{void 0!==u.isOpen&&b(u.isOpen,{})}),[u.isOpen]);const b=(e,r)=>{var t,n;y.current&&m.current&&("keydown"===r.type&&"Enter"!==r.key||(e!==g&&p(e),e?(y.current.style.maxHeight=(null!==(t=u.childrenMaxHeight)&&void 0!==t?t:y.current.scrollHeight)+"px",m.current.style.transform="rotate(180deg)",m.current.style.transition="transform 0.25s ease-in-out",y.current.style.transition="max-height 0.25s ease-in-out"):(y.current.style.maxHeight="",m.current.style.transform="rotate(0deg)",m.current.style.transition="transform 0.25s ease-in-out",y.current.style.transition="padding 0s"),null===(n=u.onToggleAccordion)||void 0===n||n.call(u,e)))};return o((()=>{const e=new MutationObserver((()=>{g&&y.current&&(y.current.style.maxHeight=y.current.scrollHeight+"px")}));return y.current&&e.observe(y.current,{childList:!0,subtree:!0}),()=>{e.disconnect()}}),[g]),o((()=>{var e;g&&(null==u?void 0:u.refresh)&&(null===(e=null==y?void 0:y.current)||void 0===e?void 0:e.scrollHeight)&&!u.childrenMaxHeight&&setTimeout((()=>{y.current.style.maxHeight=y.current.scrollHeight+"px"}),100)}),[g,null==u?void 0:u.refresh,null===(h=null==y?void 0:y.current)||void 0===h?void 0:h.scrollHeight]),e(a,Object.assign({className:"accordion",isActive:g,width:null==u?void 0:u.width,contentMargin:null==u?void 0:u.contentMargin,headerPadding:u.headerPadding,skipHoverState:u.skipHoverHeader,showBorders:u.showBorders,backgroundColor:u.backgroundColor,openDirection:u.openDirection},{children:[e("div",Object.assign({className:"accordion__overview "+(g?"active":""),onClick:e=>b(!g,e),onKeyDown:e=>b(!g,e),role:"button",tabIndex:0},{children:[!u.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header",style:null!==(v=u.headerStyles)&&void 0!==v?v:{}},{children:[e(l,{children:["string"==typeof u.header?r(i,{children:null==u?void 0:u.header}):u.header,r(s,{buttonText:u.buttonLinkText,buttonType:"text",darkMode:!0,onClick:u.onButtonLinkClick})]}),r(d,{arrowColor:u.arrowColor,isNewIcon:!0,ref:m})]})),u.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header"},{children:[e("div",Object.assign({className:"accordion__overview__title-wrapper"},{children:[r(d,{arrowColor:u.arrowColor,isNewIcon:!0,ref:m}),"string"==typeof u.header?r(i,{children:null==u?void 0:u.header}):u.header]})),r("div",Object.assign({onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"===e.key&&e.stopPropagation()},role:"button",tabIndex:0},{children:u.rightActionComponent}))]})),(null==u?void 0:u.caption)&&r("div",Object.assign({className:"accordion__overview__caption"},{children:r(c,{children:r("div",Object.assign({style:u.captionStyle},{children:u.caption}))})}))]})),r("div",Object.assign({ref:y,className:"accordion__content"},{children:u.children}))]}))};export{u as BikAccordion};
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as t,useRef as n,useEffect as o}from"react";import{TitleRegular as i,BodySecondary as c}from"../TypographyStyle.js";import{Button as s}from"../button/Button.js";import a,{AccordionHeaderGroup as l}from"./Accordion.style.js";import d from"./AccordionArrow.js";const u=u=>{var h,v;const[g,p]=t(!1),m=n(null),y=n(null);o((()=>{u.autoOpen&&b(u.autoOpen,{})}),[u.autoOpen]),o((()=>{void 0!==u.isOpen&&b(u.isOpen,{})}),[u.isOpen]);const b=(e,r)=>{var t,n;y.current&&m.current&&("keydown"===r.type&&"Enter"!==r.key||(e!==g&&p(e),e?(y.current.style.maxHeight=(null!==(t=u.childrenMaxHeight)&&void 0!==t?t:y.current.scrollHeight)+"px",m.current.style.transform="rotate(180deg)",m.current.style.transition="transform 0.25s ease-in-out",y.current.style.transition="max-height 0.25s ease-in-out"):(y.current.style.maxHeight="",m.current.style.transform="rotate(0deg)",m.current.style.transition="transform 0.25s ease-in-out",y.current.style.transition="padding 0s"),null===(n=u.onToggleAccordion)||void 0===n||n.call(u,e)))};return o((()=>{const e=new MutationObserver((()=>{g&&y.current&&(y.current.style.maxHeight=y.current.scrollHeight+"px")}));return y.current&&e.observe(y.current,{childList:!0,subtree:!0}),()=>{e.disconnect()}}),[g]),o((()=>{var e;g&&(null==u?void 0:u.refresh)&&(null===(e=null==y?void 0:y.current)||void 0===e?void 0:e.scrollHeight)&&!u.childrenMaxHeight&&setTimeout((()=>{y.current.style.maxHeight=y.current.scrollHeight+"px"}),100)}),[g,null==u?void 0:u.refresh,null===(h=null==y?void 0:y.current)||void 0===h?void 0:h.scrollHeight]),e(a,Object.assign({className:"accordion",isActive:g,width:null==u?void 0:u.width,contentMargin:null==u?void 0:u.contentMargin,headerPadding:u.headerPadding,skipHoverState:u.skipHoverHeader,showBorders:u.showBorders,backgroundColor:u.backgroundColor,openDirection:u.openDirection},{children:[e("div",Object.assign({className:"accordion__overview "+(g?"active":""),onClick:e=>b(!g,e),onKeyDown:e=>b(!g,e),role:"button",tabIndex:0},{children:[!u.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header",style:null!==(v=u.headerStyles)&&void 0!==v?v:{}},{children:[e(l,{children:["string"==typeof u.header?r(i,{children:null==u?void 0:u.header}):u.header,u.buttonLinkText&&r(s,{buttonText:u.buttonLinkText,buttonType:"text",darkMode:!0,onClick:u.onButtonLinkClick})]}),r(d,{arrowColor:u.arrowColor,isNewIcon:!0,ref:m})]})),u.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header"},{children:[e("div",Object.assign({className:"accordion__overview__title-wrapper"},{children:[r(d,{arrowColor:u.arrowColor,isNewIcon:!0,ref:m}),"string"==typeof u.header?r(i,{children:null==u?void 0:u.header}):u.header]})),r("div",Object.assign({onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"===e.key&&e.stopPropagation()},role:"button",tabIndex:0},{children:u.rightActionComponent}))]})),(null==u?void 0:u.caption)&&r("div",Object.assign({className:"accordion__overview__caption"},{children:r(c,{children:r("div",Object.assign({style:u.captionStyle},{children:u.caption}))})}))]})),r("div",Object.assign({ref:y,className:"accordion__content"},{children:u.children}))]}))};export{u as BikAccordion};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -60,5 +60,7 @@ export interface TemplateContextMapperProps {
60
60
  disableCopyCode?: boolean;
61
61
  initialExpiryDateTime?: string;
62
62
  showDiscountCodeExpiryInfo?: boolean;
63
+ footerButtonText?: string;
64
+ footerInfoText?: string;
63
65
  }
64
66
  export declare const TemplateContextMapper: (props: TemplateContextMapperProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o,Fragment as l}from"react/jsx-runtime";import{cloneDeep as t}from"lodash";import{useEffect as i,useState as r,useRef as a,useMemo as s}from"react";import n from"../../utils/StringUtils.js";import{COLORS as d}from"../../constants/Theme.js";import{StyledModal as c}from"../modals/styledModal.js";import{CHANNEL_TYPE as u}from"../template-preview/models/Channels.js";import{POD as p}from"../template-preview/models/WhatsAppTemplate.js";import{TemplateModalContext as m}from"./context/templateModalContext.js";import v from"./modalElements/Footer.js";import h from"./modalElements/TemplateSelectModalContent.js";import{convertPlaceholdersToBikDropdown as b}from"./utils/convertPlaceholdersToBikDropdown.js";const C=C=>{var f,g,x,E,P,y,S,I;const{selectedTemplate:D,closeDialog:T,showVariableMapping:w,channel:V,htmlContent:k,templateVariables:L,onTemplateSelect:j,globalPlaceholders:M,showOnlyContent:A,whatsappSpecificPickerMeta:B,zIndex:H,showVariableModal:F,variableList:O,discountCode:W,setDiscountCode:N,onBackPress:z,enabledCustomText:R,variableListForImage:U,showSampleValues:$,disableEditVariable:_,pod:q,extras:G,pickerConf:J,selectedCarouselProducts:K,disableEditExpiry:Q,cardWidth:X,onDeleteSelectedProducts:Y,fileName:Z,setFileName:ee,hideDeviceContainerInPreview:oe,maxCharLimit:le,onDefaultVariableSelect:te,skipDefaultVariableContent:ie,disableDatePicker:re,disableCopyCode:ae,initialExpiryDateTime:se,showDiscountCodeExpiryInfo:ne}=C;i((()=>{be(k)}),[k]);const de=V===u.WHATSAPP&&"CAROUSEL"===(null===(g=null===(f=null==D?void 0:D.components)||void 0===f?void 0:f[1])||void 0===g?void 0:g.type),ce=null==D?void 0:D.isProductCarouselType,[ue,pe]=r(V===u.EMAIL||V==u.WEBPUSH||de?"desktop":"mobile"),[me,ve]=r(!1),[he,be]=r(k),[Ce,fe]=r(!1),[ge,xe]=r([]),[Ee,Pe]=r({}),[ye,Se]=r(D),[Ie,De]=r([]),[Te,we]=r(null),[Ve,ke]=r(!1),[Le,je]=r(null!=L?L:[]),[Me,Ae]=r(!1),[Be,He]=r(de?(null===(E=null===(x=null==ye?void 0:ye.mapping)||void 0===x?void 0:x.body)||void 0===E?void 0:E.length)?-1:0:-1),[Fe,Oe]=r([]),[We,Ne]=r(void 0),ze=a(null),[Re,Ue]=r(!1),[$e,_e]=r(!1),[qe,Ge]=r(!1),[Je,Ke]=r({});i((()=>{K?Oe(K):ce&&Oe([])}),[K]),i((()=>{var e;if(!Ve&&ce&&(!K||0===Oe.length)){const o=null===(e=null==ye?void 0:ye.components)||void 0===e?void 0:e[1].cards,l=[];null==o||o.forEach((e=>{var o;null===(o=null==e?void 0:e.components)||void 0===o||o.forEach((e=>{var o,t,i;"HEADER"===e.type&&l.push(null!==(i=null===(t=null===(o=e.example)||void 0===o?void 0:o.header_handle)||void 0===t?void 0:t[0])&&void 0!==i?i:"")}))})),De(l),ke(!0)}}),[Ve]);const Qe=s((()=>b(M)),[M]);return i((()=>{Ne(t(O))}),[O]),e(m.Provider,Object.assign({value:{hideFooterButton:qe,setHideFooterButton:Ge,hideCrossButton:$e,setHideCrossButton:_e,variableList:We,setVariableList:Ne,variableCallback:Te,setVariableCallback:we,showVariablePicker:me,setShowVariablePicker:ve,template:ye,setTemplate:Se,device:ue,setDevice:pe,display_content:he,setDisplayContent:be,originalVariableList:Le,setOriginalVariableList:je,isError:Ce,setIsError:fe,channel:V,globalNormalizedPlaceholders:Qe,templateSelectionTriggered:Me,setTemplateSelectionTriggered:Ae,enabledCustomText:R,disableEditVariable:_,pod:q,extras:G,isWhatsappCarousel:de,selectedCarouselIndex:Be,setSelectedCarouselIndex:He,isProductCarouselType:ce,templateErrorIndexes:Ee,cardCount:de?null===(y=null===(P=D.components)||void 0===P?void 0:P[1].cards)||void 0===y?void 0:y.length:void 0,errorIndexes:ge,setErrorIndexes:xe,pickerConf:J,carouselProducts:Fe,setCarouselProducts:Oe,disableEditExpiry:Q,cardWidth:X,cardImages:Ie,onDeleteSelectedProducts:Y,hideDeviceContainerInPreview:oe,sliderRef:ze,isCarouselHovered:Re,setIsCarouselHovered:Ue,maxCharLimit:le,ctaOptionsErrors:Je,setCtaOptionsErrors:Ke,onDefaultVariableSelect:te,disableDatePicker:re,disableCopyCode:ae,initialExpiryDateTime:se,showDiscountCodeExpiryInfo:ne}},{children:A?e(h,{variableListFromProps:O,channel:u.EMAIL,hideHeader:!0}):o(c,Object.assign({hideCrossButton:$e,zIndex:H,centralContainerStyles:{width:de?900:V===u.EMAIL&&w?1e3:800},open:!0,onClose:()=>{null==T||T()},headingTitle:null==ye?void 0:ye.label,headingSubtitle:V===u.WHATSAPP?`${n.capitaliseFirstLetterOfString(null!==(S=null==ye?void 0:ye.category)&&void 0!==S?S:"")} • ${null!==(I=null==ye?void 0:ye.templateCategory)&&void 0!==I?I:""}`:"",onBackPress:()=>{null==z||z()},modalHeaderStyles:{borderBottom:`1px solid ${d.stroke.primary}`}},{children:[e(h,{variableListFromProps:O,showSampleValues:$,showVariableMapping:w,channel:V,whatsappSpecificPickerMeta:B,showVariableModal:F,discountCode:W,setDiscountCode:N,variableListForImage:U&&(null==U?void 0:U.length)>0?U:We,fileName:Z,setFileName:e=>{null==ee||ee(e)},skipDefaultVariableContent:ie}),j?e(v,{isWhatsappCarousel:null!=de&&de,onSelect:function(){var e;if((null==Fe?void 0:Fe.length)<1&&ce)return void fe(!0);if(Object.keys(Je).length>0&&q!==p.CHATBOT)return void fe(!0);const o=null==j?void 0:j(ye,Le,null!=he?he:"",Fe);Pe(null!==(e=null==o?void 0:o.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==o?void 0:o.errorIndexes)||(null==o?void 0:o.error)?((null==o?void 0:o.errorIndexes)&&xe(o.errorIndexes),(null==o?void 0:o.error)&&fe(!!(null==o?void 0:o.error))):Ae(!0)}}):e(l,{})]}))}))};export{C as TemplateContextMapper};
1
+ import{jsx as e,jsxs as o,Fragment as l}from"react/jsx-runtime";import{cloneDeep as t}from"lodash";import{useEffect as i,useState as r,useRef as a,useMemo as s}from"react";import n 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{POD as p}from"../template-preview/models/WhatsAppTemplate.js";import{TemplateModalContext as m}from"./context/templateModalContext.js";import v from"./modalElements/Footer.js";import h from"./modalElements/TemplateSelectModalContent.js";import{convertPlaceholdersToBikDropdown as b}from"./utils/convertPlaceholdersToBikDropdown.js";const C=C=>{var f,x,g,E,P,I,T,y;const{selectedTemplate:S,closeDialog:D,showVariableMapping:w,channel:V,htmlContent:k,templateVariables:L,onTemplateSelect:j,globalPlaceholders:B,showOnlyContent:M,whatsappSpecificPickerMeta:A,zIndex:H,showVariableModal:F,variableList:O,discountCode:W,setDiscountCode:N,onBackPress:z,enabledCustomText:R,variableListForImage:U,showSampleValues:$,disableEditVariable:_,pod:q,extras:G,pickerConf:J,selectedCarouselProducts:K,disableEditExpiry:Q,cardWidth:X,onDeleteSelectedProducts:Y,fileName:Z,setFileName:ee,hideDeviceContainerInPreview:oe,maxCharLimit:le,onDefaultVariableSelect:te,skipDefaultVariableContent:ie,disableDatePicker:re,disableCopyCode:ae,initialExpiryDateTime:se,showDiscountCodeExpiryInfo:ne,footerButtonText:de,footerInfoText:ue}=C;i((()=>{fe(k)}),[k]);const ce=V===c.WHATSAPP&&"CAROUSEL"===(null===(x=null===(f=null==S?void 0:S.components)||void 0===f?void 0:f[1])||void 0===x?void 0:x.type),pe=null==S?void 0:S.isProductCarouselType,[me,ve]=r(V===c.EMAIL||V==c.WEBPUSH||ce?"desktop":"mobile"),[he,be]=r(!1),[Ce,fe]=r(k),[xe,ge]=r(!1),[Ee,Pe]=r([]),[Ie,Te]=r({}),[ye,Se]=r(S),[De,we]=r([]),[Ve,ke]=r(null),[Le,je]=r(!1),[Be,Me]=r(null!=L?L:[]),[Ae,He]=r(!1),[Fe,Oe]=r(ce?(null===(E=null===(g=null==ye?void 0:ye.mapping)||void 0===g?void 0:g.body)||void 0===E?void 0:E.length)?-1:0:-1),[We,Ne]=r([]),[ze,Re]=r(void 0),Ue=a(null),[$e,_e]=r(!1),[qe,Ge]=r(!1),[Je,Ke]=r(!1),[Qe,Xe]=r({});i((()=>{K?Ne(K):pe&&Ne([])}),[K]),i((()=>{var e;if(!Le&&pe&&(!K||0===Ne.length)){const o=null===(e=null==ye?void 0:ye.components)||void 0===e?void 0:e[1].cards,l=[];null==o||o.forEach((e=>{var o;null===(o=null==e?void 0:e.components)||void 0===o||o.forEach((e=>{var o,t,i;"HEADER"===e.type&&l.push(null!==(i=null===(t=null===(o=e.example)||void 0===o?void 0:o.header_handle)||void 0===t?void 0:t[0])&&void 0!==i?i:"")}))})),we(l),je(!0)}}),[Le]);const Ye=s((()=>b(B)),[B]);return i((()=>{Re(t(O))}),[O]),e(m.Provider,Object.assign({value:{hideFooterButton:Je,setHideFooterButton:Ke,hideCrossButton:qe,setHideCrossButton:Ge,variableList:ze,setVariableList:Re,variableCallback:Ve,setVariableCallback:ke,showVariablePicker:he,setShowVariablePicker:be,template:ye,setTemplate:Se,device:me,setDevice:ve,display_content:Ce,setDisplayContent:fe,originalVariableList:Be,setOriginalVariableList:Me,isError:xe,setIsError:ge,channel:V,globalNormalizedPlaceholders:Ye,templateSelectionTriggered:Ae,setTemplateSelectionTriggered:He,enabledCustomText:R,disableEditVariable:_,pod:q,extras:G,isWhatsappCarousel:ce,selectedCarouselIndex:Fe,setSelectedCarouselIndex:Oe,isProductCarouselType:pe,templateErrorIndexes:Ie,cardCount:ce?null===(I=null===(P=S.components)||void 0===P?void 0:P[1].cards)||void 0===I?void 0:I.length:void 0,errorIndexes:Ee,setErrorIndexes:Pe,pickerConf:J,carouselProducts:We,setCarouselProducts:Ne,disableEditExpiry:Q,cardWidth:X,cardImages:De,onDeleteSelectedProducts:Y,hideDeviceContainerInPreview:oe,sliderRef:Ue,isCarouselHovered:$e,setIsCarouselHovered:_e,maxCharLimit:le,ctaOptionsErrors:Qe,setCtaOptionsErrors:Xe,onDefaultVariableSelect:te,disableDatePicker:re,disableCopyCode:ae,initialExpiryDateTime:se,showDiscountCodeExpiryInfo:ne}},{children:M?e(h,{variableListFromProps:O,channel:c.EMAIL,hideHeader:!0}):o(u,Object.assign({hideCrossButton:qe,zIndex:H,centralContainerStyles:{width:ce?900:V===c.EMAIL&&w?1e3:800},open:!0,onClose:()=>{null==D||D()},headingTitle:null==ye?void 0:ye.label,headingSubtitle:V===c.WHATSAPP?`${n.capitaliseFirstLetterOfString(null!==(T=null==ye?void 0:ye.category)&&void 0!==T?T:"")} • ${null!==(y=null==ye?void 0:ye.templateCategory)&&void 0!==y?y:""}`:"",onBackPress:z,modalHeaderStyles:{borderBottom:`1px solid ${d.stroke.primary}`}},{children:[e(h,{variableListFromProps:O,showSampleValues:$,showVariableMapping:w,channel:V,whatsappSpecificPickerMeta:A,showVariableModal:F,discountCode:W,setDiscountCode:N,variableListForImage:U&&(null==U?void 0:U.length)>0?U:ze,fileName:Z,setFileName:e=>{null==ee||ee(e)},skipDefaultVariableContent:ie}),j?e(v,{isWhatsappCarousel:null!=ce&&ce,onSelect:function(){var e;if((null==We?void 0:We.length)<1&&pe)return void ge(!0);if(Object.keys(Qe).length>0&&q!==p.CHATBOT)return void ge(!0);const o=null==j?void 0:j(ye,Be,null!=Ce?Ce:"",We);Te(null!==(e=null==o?void 0:o.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==o?void 0:o.errorIndexes)||(null==o?void 0:o.error)?((null==o?void 0:o.errorIndexes)&&Pe(o.errorIndexes),(null==o?void 0:o.error)&&ge(!!(null==o?void 0:o.error))):He(!0)},footerButtonText:de,footerInfoText:ue}):e(l,{})]}))}))};export{C as TemplateContextMapper};
@@ -1,6 +1,8 @@
1
1
  export interface FooterProps {
2
2
  isWhatsappCarousel: boolean;
3
3
  onSelect: () => void;
4
+ footerButtonText?: string;
5
+ footerInfoText?: string;
4
6
  }
5
- declare const Footer: ({ isWhatsappCarousel, onSelect }: FooterProps) => import("react/jsx-runtime").JSX.Element;
7
+ declare const Footer: ({ isWhatsappCarousel, onSelect, footerButtonText, footerInfoText, }: FooterProps) => import("react/jsx-runtime").JSX.Element;
6
8
  export default Footer;
@@ -1,7 +1,7 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useEffect as r}from"react";import i from"styled-components";import{Button as l}from"../../button/Button.js";import{TitleRegular as n}from"../../TypographyStyle.js";import{COLORS as s}from"../../../constants/Theme.js";import{Badge as a}from"../Badge/index.js";import{useTemplateModalContext as d}from"../context/templateModalContext.js";const p=i.div`
2
- background: ${s.surface.standard};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import o from"../../../assets/icons/info.svg.js";import{useState as r,useEffect as i}from"react";import n from"styled-components";import{Button as s}from"../../button/Button.js";import{Tag as l}from"../../tag/Tag.js";import{TitleRegular as a}from"../../TypographyStyle.js";import{COLORS as d}from"../../../constants/Theme.js";import{Badge as p}from"../Badge/index.js";import{useTemplateModalContext as c}from"../context/templateModalContext.js";const m=n.div`
2
+ background: ${d.surface.standard};
3
3
  border-top-width: 1px;
4
- border-top-color: ${s.stroke.primary};
4
+ border-top-color: ${d.stroke.primary};
5
5
  box-shadow: 0px -4px 12px rgba(0, 0, 0, 0.12);
6
6
  width: 100%;
7
7
  padding: 0 24px;
@@ -12,4 +12,4 @@ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useEffect
12
12
  border-bottom-left-radius: 4px;
13
13
  border-bottom-right-radius: 4px;
14
14
  height: ${e=>e.isWhatsappCarousel?64:80}px;
15
- `,c=i=>{let{isWhatsappCarousel:c,onSelect:m}=i;var u,x,b,h;const{isError:f,selectedCarouselIndex:g,setSelectedCarouselIndex:v,setErrorIndexes:y,template:j,showVariablePicker:C,hideFooterButton:S}=d(),[w,k]=o(c?"Next":"Select template");return r((()=>{c&&-1===g?k("Next"):c&&null!=g&&g>-1&&k("Save & Select Template")}),[g]),e(p,Object.assign({isWhatsappCarousel:c,justifyContent:c&&(null===(x=null===(u=null==j?void 0:j.mapping)||void 0===u?void 0:u.body)||void 0===x?void 0:x.length)?"space-between":"end"},{children:[c&&null!=g&&g>=-1&&!!(null===(h=null===(b=null==j?void 0:j.mapping)||void 0===b?void 0:b.body)||void 0===h?void 0:h.length)&&t(n,Object.assign({color:s.text.secondary},{children:`Step ${-1===g?1:2}/2`})),e("div",Object.assign({style:{display:"flex",flexDirection:"row"}},{children:[f&&t(a,{errorText:"Some inputs are missing or incorrect. Please check"}),!S&&t(l,{disabled:C,id:"select-template-btn",buttonText:w,size:c?"small":"large",onClick:function(){c&&-1===g&&v?v(0):(null==y||y([]),m())}})]}))]}))};export{c as default};
15
+ `,u=n=>{let{isWhatsappCarousel:u,onSelect:x,footerButtonText:f,footerInfoText:g}=n;var b,h,v,j;const{isError:y,selectedCarouselIndex:C,setSelectedCarouselIndex:T,setErrorIndexes:S,template:w,showVariablePicker:k,hideFooterButton:I}=c(),[$,B]=r(u?"Next":"Select template");return i((()=>{f?B(f):u&&-1===C?B("Next"):u&&null!=C&&C>-1&&B("Save & Select Template")}),[C]),e(m,Object.assign({isWhatsappCarousel:u,justifyContent:u&&(null===(h=null===(b=null==w?void 0:w.mapping)||void 0===b?void 0:b.body)||void 0===h?void 0:h.length)?"space-between":"end"},{children:[u&&null!=C&&C>=-1&&!!(null===(j=null===(v=null==w?void 0:w.mapping)||void 0===v?void 0:v.body)||void 0===j?void 0:j.length)&&t(a,Object.assign({color:d.text.secondary},{children:`Step ${-1===C?1:2}/2`})),e("div",Object.assign({style:{display:"flex",flexDirection:"row"}},{children:[y&&t(p,{errorText:"Some inputs are missing or incorrect. Please check"}),!y&&g&&t(l,{tagText:g,LeadingIcon:o}),!I&&t(s,{disabled:k,id:"select-template-btn",buttonText:$,size:u?"small":"large",onClick:function(){u&&-1===C&&T?T(0):(null==S||S([]),x())}})]}))]}))};export{u as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.616",
3
+ "version": "0.0.617-beta-tcmbc.1",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",