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

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 +1 -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 +2 -1
  11. package/dist/cjs/components/template-context-mapper/modalElements/Footer.js +1 -1
  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 +1 -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 +2 -1
  22. package/dist/esm/components/template-context-mapper/modalElements/Footer.js +2 -2
  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,6 @@ export interface TemplateContextMapperProps {
60
60
  disableCopyCode?: boolean;
61
61
  initialExpiryDateTime?: string;
62
62
  showDiscountCodeExpiryInfo?: boolean;
63
+ footerButtonText?: string;
63
64
  }
64
65
  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:P,closeDialog:f,showVariableMapping:T,channel:g,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: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}=p;l.useEffect((()=>{pe(y)}),[y]);const ie=g===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),re=null==P?void 0:P.isProductCarouselType,[se,ne]=l.useState(g===r.CHANNEL_TYPE.EMAIL||g==r.CHANNEL_TYPE.WEBPUSH||ie?"desktop":"mobile"),[de,ue]=l.useState(!1),[ce,pe]=l.useState(y),[ve,me]=l.useState(!1),[Ce,he]=l.useState([]),[be,Se]=l.useState({}),[Ee,xe]=l.useState(P),[Pe,fe]=l.useState([]),[Te,ge]=l.useState(null),[ye,De]=l.useState(!1),[Ie,Le]=l.useState(null!=D?D:[]),[je,we]=l.useState(!1),[ke,Ve]=l.useState(ie?(null===(h=null===(C=null==Ee?void 0:Ee.mapping)||void 0===C?void 0:C.body)||void 0===h?void 0:h.length)?-1:0:-1),[Ae,He]=l.useState([]),[Me,Ne]=l.useState(void 0),Be=l.useRef(null),[Oe,qe]=l.useState(!1),[Fe,_e]=l.useState(!1),[We,Ye]=l.useState(!1),[Re,ze]=l.useState({});l.useEffect((()=>{R?He(R):re&&He([])}),[R]),l.useEffect((()=>{var e;if(!ye&&re&&(!R||0===He.length)){const t=null===(e=null==Ee?void 0:Ee.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:"")}))})),fe(l),De(!0)}}),[ye]);const Ue=l.useMemo((()=>c.convertPlaceholdersToBikDropdown(L)),[L]);return l.useEffect((()=>{Ne(t.cloneDeep(A))}),[A]),e.jsx(n.TemplateModalContext.Provider,Object.assign({value:{hideFooterButton:We,setHideFooterButton:Ye,hideCrossButton:Fe,setHideCrossButton:_e,variableList:Me,setVariableList:Ne,variableCallback:Te,setVariableCallback:ge,showVariablePicker:de,setShowVariablePicker:ue,template:Ee,setTemplate:xe,device:se,setDevice:ne,display_content:ce,setDisplayContent:pe,originalVariableList:Ie,setOriginalVariableList:Le,isError:ve,setIsError:me,channel:g,globalNormalizedPlaceholders:Ue,templateSelectionTriggered:je,setTemplateSelectionTriggered:we,enabledCustomText:B,disableEditVariable:F,pod:_,extras:W,isWhatsappCarousel:ie,selectedCarouselIndex:ke,setSelectedCarouselIndex:Ve,isProductCarouselType:re,templateErrorIndexes:be,cardCount:ie?null===(S=null===(b=P.components)||void 0===b?void 0:b[1].cards)||void 0===S?void 0:S.length:void 0,errorIndexes:Ce,setErrorIndexes:he,pickerConf:Y,carouselProducts:Ae,setCarouselProducts:He,disableEditExpiry:z,cardWidth:U,cardImages:Pe,onDeleteSelectedProducts:$,hideDeviceContainerInPreview:K,sliderRef:Be,isCarouselHovered:Oe,setIsCarouselHovered:qe,maxCharLimit:Q,ctaOptionsErrors:Re,setCtaOptionsErrors:ze,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:Fe,zIndex:k,centralContainerStyles:{width:ie?900:g===r.CHANNEL_TYPE.EMAIL&&T?1e3:800},open:!0,onClose:()=>{null==f||f()},headingTitle:null==Ee?void 0:Ee.label,headingSubtitle:g===r.CHANNEL_TYPE.WHATSAPP?`${o.default.capitaliseFirstLetterOfString(null!==(E=null==Ee?void 0:Ee.category)&&void 0!==E?E:"")} • ${null!==(x=null==Ee?void 0:Ee.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:Me,fileName:G,setFileName:e=>{null==J||J(e)},skipDefaultVariableContent:Z}),I?e.jsx(d.default,{isWhatsappCarousel:null!=ie&&ie,onSelect:function(){var e;if((null==Ae?void 0:Ae.length)<1&&re)return void me(!0);if(Object.keys(Re).length>0&&_!==s.POD.CHATBOT)return void me(!0);const t=null==I?void 0:I(Ee,Ie,null!=ce?ce:"",Ae);Se(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)&&he(t.errorIndexes),(null==t?void 0:t.error)&&me(!!(null==t?void 0:t.error))):we(!0)},footerButtonText:ae}):e.jsx(e.Fragment,{})]}))}))};
@@ -1,6 +1,7 @@
1
1
  export interface FooterProps {
2
2
  isWhatsappCarousel: boolean;
3
3
  onSelect: () => void;
4
+ footerButtonText?: string;
4
5
  }
5
- declare const Footer: ({ isWhatsappCarousel, onSelect }: FooterProps) => import("react/jsx-runtime").JSX.Element;
6
+ declare const Footer: ({ isWhatsappCarousel, onSelect, footerButtonText, }: FooterProps) => import("react/jsx-runtime").JSX.Element;
6
7
  export default Footer;
@@ -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=r=>{let{isWhatsappCarousel:a,onSelect:u,footerButtonText:p}=r;var c,x,b,g;const{isError:f,selectedCarouselIndex:h,setSelectedCarouselIndex:j,setErrorIndexes:m,template:v,showVariablePicker:y,hideFooterButton:C}=i.useTemplateModalContext(),[S,O]=t.useState(a?"Next":"Select template");return t.useEffect((()=>{p?O(p):a&&-1===h?O("Next"):a&&null!=h&&h>-1&&O("Save & Select Template")}),[h]),e.jsxs(d,Object.assign({isWhatsappCarousel:a,justifyContent:a&&(null===(x=null===(c=null==v?void 0:v.mapping)||void 0===c?void 0:c.body)||void 0===x?void 0:x.length)?"space-between":"end"},{children:[a&&null!=h&&h>=-1&&!!(null===(g=null===(b=null==v?void 0:v.mapping)||void 0===b?void 0:b.body)||void 0===g?void 0:g.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:[f&&e.jsx(n.Badge,{errorText:"Some inputs are missing or incorrect. Please check"}),!C&&e.jsx(o.Button,{disabled:y,id:"select-template-btn",buttonText:S,size:a?"small":"large",onClick:function(){a&&-1===h&&j?j(0):(null==m||m([]),u())}})]}))]}))};
@@ -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,6 @@ export interface TemplateContextMapperProps {
60
60
  disableCopyCode?: boolean;
61
61
  initialExpiryDateTime?: string;
62
62
  showDiscountCodeExpiryInfo?: boolean;
63
+ footerButtonText?: string;
63
64
  }
64
65
  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,y,S,I;const{selectedTemplate:T,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}=C;i((()=>{Ce(k)}),[k]);const ue=V===c.WHATSAPP&&"CAROUSEL"===(null===(x=null===(f=null==T?void 0:T.components)||void 0===f?void 0:f[1])||void 0===x?void 0:x.type),ce=null==T?void 0:T.isProductCarouselType,[pe,me]=r(V===c.EMAIL||V==c.WEBPUSH||ue?"desktop":"mobile"),[ve,he]=r(!1),[be,Ce]=r(k),[fe,xe]=r(!1),[ge,Ee]=r([]),[Pe,ye]=r({}),[Se,Ie]=r(T),[Te,De]=r([]),[we,Ve]=r(null),[ke,Le]=r(!1),[je,Be]=r(null!=L?L:[]),[Me,Ae]=r(!1),[He,Fe]=r(ue?(null===(E=null===(g=null==Se?void 0:Se.mapping)||void 0===g?void 0:g.body)||void 0===E?void 0:E.length)?-1:0:-1),[Oe,We]=r([]),[Ne,ze]=r(void 0),Re=a(null),[Ue,$e]=r(!1),[_e,qe]=r(!1),[Ge,Je]=r(!1),[Ke,Qe]=r({});i((()=>{K?We(K):ce&&We([])}),[K]),i((()=>{var e;if(!ke&&ce&&(!K||0===We.length)){const o=null===(e=null==Se?void 0:Se.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),Le(!0)}}),[ke]);const Xe=s((()=>b(B)),[B]);return i((()=>{ze(t(O))}),[O]),e(m.Provider,Object.assign({value:{hideFooterButton:Ge,setHideFooterButton:Je,hideCrossButton:_e,setHideCrossButton:qe,variableList:Ne,setVariableList:ze,variableCallback:we,setVariableCallback:Ve,showVariablePicker:ve,setShowVariablePicker:he,template:Se,setTemplate:Ie,device:pe,setDevice:me,display_content:be,setDisplayContent:Ce,originalVariableList:je,setOriginalVariableList:Be,isError:fe,setIsError:xe,channel:V,globalNormalizedPlaceholders:Xe,templateSelectionTriggered:Me,setTemplateSelectionTriggered:Ae,enabledCustomText:R,disableEditVariable:_,pod:q,extras:G,isWhatsappCarousel:ue,selectedCarouselIndex:He,setSelectedCarouselIndex:Fe,isProductCarouselType:ce,templateErrorIndexes:Pe,cardCount:ue?null===(y=null===(P=T.components)||void 0===P?void 0:P[1].cards)||void 0===y?void 0:y.length:void 0,errorIndexes:ge,setErrorIndexes:Ee,pickerConf:J,carouselProducts:Oe,setCarouselProducts:We,disableEditExpiry:Q,cardWidth:X,cardImages:Te,onDeleteSelectedProducts:Y,hideDeviceContainerInPreview:oe,sliderRef:Re,isCarouselHovered:Ue,setIsCarouselHovered:$e,maxCharLimit:le,ctaOptionsErrors:Ke,setCtaOptionsErrors:Qe,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:_e,zIndex:H,centralContainerStyles:{width:ue?900:V===c.EMAIL&&w?1e3:800},open:!0,onClose:()=>{null==D||D()},headingTitle:null==Se?void 0:Se.label,headingSubtitle:V===c.WHATSAPP?`${n.capitaliseFirstLetterOfString(null!==(S=null==Se?void 0:Se.category)&&void 0!==S?S:"")} • ${null!==(I=null==Se?void 0:Se.templateCategory)&&void 0!==I?I:""}`:"",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:Ne,fileName:Z,setFileName:e=>{null==ee||ee(e)},skipDefaultVariableContent:ie}),j?e(v,{isWhatsappCarousel:null!=ue&&ue,onSelect:function(){var e;if((null==Oe?void 0:Oe.length)<1&&ce)return void xe(!0);if(Object.keys(Ke).length>0&&q!==p.CHATBOT)return void xe(!0);const o=null==j?void 0:j(Se,je,null!=be?be:"",Oe);ye(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)&&Ee(o.errorIndexes),(null==o?void 0:o.error)&&xe(!!(null==o?void 0:o.error))):Ae(!0)},footerButtonText:de}):e(l,{})]}))}))};export{C as TemplateContextMapper};
@@ -1,6 +1,7 @@
1
1
  export interface FooterProps {
2
2
  isWhatsappCarousel: boolean;
3
3
  onSelect: () => void;
4
+ footerButtonText?: string;
4
5
  }
5
- declare const Footer: ({ isWhatsappCarousel, onSelect }: FooterProps) => import("react/jsx-runtime").JSX.Element;
6
+ declare const Footer: ({ isWhatsappCarousel, onSelect, footerButtonText, }: FooterProps) => import("react/jsx-runtime").JSX.Element;
6
7
  export default Footer;
@@ -1,4 +1,4 @@
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`
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 n}from"../../button/Button.js";import{TitleRegular as l}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
2
  background: ${s.surface.standard};
3
3
  border-top-width: 1px;
4
4
  border-top-color: ${s.stroke.primary};
@@ -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
+ `,c=i=>{let{isWhatsappCarousel:c,onSelect:m,footerButtonText:u}=i;var x,b,f,h;const{isError:g,selectedCarouselIndex:v,setSelectedCarouselIndex:y,setErrorIndexes:j,template:C,showVariablePicker:S,hideFooterButton:w}=d(),[T,k]=o(c?"Next":"Select template");return r((()=>{u?k(u):c&&-1===v?k("Next"):c&&null!=v&&v>-1&&k("Save & Select Template")}),[v]),e(p,Object.assign({isWhatsappCarousel:c,justifyContent:c&&(null===(b=null===(x=null==C?void 0:C.mapping)||void 0===x?void 0:x.body)||void 0===b?void 0:b.length)?"space-between":"end"},{children:[c&&null!=v&&v>=-1&&!!(null===(h=null===(f=null==C?void 0:C.mapping)||void 0===f?void 0:f.body)||void 0===h?void 0:h.length)&&t(l,Object.assign({color:s.text.secondary},{children:`Step ${-1===v?1:2}/2`})),e("div",Object.assign({style:{display:"flex",flexDirection:"row"}},{children:[g&&t(a,{errorText:"Some inputs are missing or incorrect. Please check"}),!w&&t(n,{disabled:S,id:"select-template-btn",buttonText:T,size:c?"small":"large",onClick:function(){c&&-1===v&&y?y(0):(null==j||j([]),m())}})]}))]}))};export{c 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.0",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",