@bikdotai/bik-component-library 0.0.520-beta.1 → 0.0.520

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,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"),l=require("react"),t=require("../../utils/StringUtils.js"),o=require("../../constants/Theme.js"),a=require("../modals/styledModal.js"),r=require("../template-preview/models/Channels.js"),s=require("./context/templateModalContext.js"),i=require("./modalElements/Footer.js"),n=require("./modalElements/TemplateSelectModalContent.js"),d=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=u=>{let{selectedTemplate:c,closeDialog:v,showVariableMapping:p,channel:m,htmlContent:h,templateVariables:C,onTemplateSelect:S,globalPlaceholders:E,showOnlyContent:x,whatsappSpecificPickerMeta:b,zIndex:g,showVariableModal:P,variableList:f,discountCode:T,setDiscountCode:I,onBackPress:y,enabledCustomText:j,variableListForImage:L,showSampleValues:M,disableEditVariable:w,pod:N,extras:A,pickerConf:D,selectedCarouselProducts:H,disableEditExpiry:V,cardWidth:k,onDeleteSelectedProducts:q,fileName:O,setFileName:_,hideDeviceContainerInPreview:F}=u;var W,B,R,Y,z,$,U,G;l.useEffect((()=>{ee(h)}),[h]);const J=m===r.CHANNEL_TYPE.WHATSAPP&&"CAROUSEL"===(null===(B=null===(W=null==c?void 0:c.components)||void 0===W?void 0:W[1])||void 0===B?void 0:B.type),K=null==c?void 0:c.isProductCarouselType,[Q,X]=l.useState(m===r.CHANNEL_TYPE.EMAIL||J?"desktop":"mobile"),[Z,ee]=l.useState(h),[le,te]=l.useState(!1),[oe,ae]=l.useState([]),[re,se]=l.useState({}),[ie,ne]=l.useState(c),[de,ue]=l.useState([]),[ce,ve]=l.useState(!1),[pe,me]=l.useState(null!=C?C:[]),[he,Ce]=l.useState(!1),[Se,Ee]=l.useState(J?(null===(Y=null===(R=null==ie?void 0:ie.mapping)||void 0===R?void 0:R.body)||void 0===Y?void 0:Y.length)?-1:0:-1),[xe,be]=l.useState([]),ge=l.useRef(null),[Pe,fe]=l.useState(!1);l.useEffect((()=>{H?be(H):K&&be([])}),[H]),l.useEffect((()=>{var e;if(!ce&&K&&(!H||0===be.length)){const l=null===(e=null==ie?void 0:ie.components)||void 0===e?void 0:e[1].cards,t=[];null==l||l.forEach((e=>{var l;null===(l=null==e?void 0:e.components)||void 0===l||l.forEach((e=>{var l,o,a;"HEADER"===e.type&&t.push(null!==(a=null===(o=null===(l=e.example)||void 0===l?void 0:l.header_handle)||void 0===o?void 0:o[0])&&void 0!==a?a:"")}))})),ue(t),ve(!0)}}),[ce]);const Te=l.useMemo((()=>d.convertPlaceholdersToBikDropdown(E)),[E]);return e.jsx(s.TemplateModalContext.Provider,Object.assign({value:{template:ie,setTemplate:ne,device:Q,setDevice:X,display_content:Z,setDisplayContent:ee,originalVariableList:pe,setOriginalVariableList:me,isError:le,setIsError:te,channel:m,globalNormalizedPlaceholders:Te,templateSelectionTriggered:he,setTemplateSelectionTriggered:Ce,enabledCustomText:j,disableEditVariable:w,pod:N,extras:A,isWhatsappCarousel:J,selectedCarouselIndex:Se,setSelectedCarouselIndex:Ee,isProductCarouselType:K,templateErrorIndexes:re,cardCount:J?null===($=null===(z=c.components)||void 0===z?void 0:z[1].cards)||void 0===$?void 0:$.length:void 0,errorIndexes:oe,setErrorIndexes:ae,pickerConf:D,carouselProducts:xe,setCarouselProducts:be,disableEditExpiry:V,cardWidth:k,cardImages:de,onDeleteSelectedProducts:q,hideDeviceContainerInPreview:F,sliderRef:ge,isCarouselHovered:Pe,setIsCarouselHovered:fe}},{children:x?e.jsx(n.default,{channel:r.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(a.StyledModal,Object.assign({zIndex:g,centralContainerStyles:{width:J?900:m===r.CHANNEL_TYPE.EMAIL&&p?1e3:800},open:!0,onClose:()=>{null==v||v()},headingTitle:null==ie?void 0:ie.label,headingSubtitle:m===r.CHANNEL_TYPE.WHATSAPP?`${t.default.capitaliseFirstLetterOfString(null!==(U=null==ie?void 0:ie.category)&&void 0!==U?U:"")} • ${null!==(G=null==ie?void 0:ie.templateCategory)&&void 0!==G?G:""}`:"",onBackPress:()=>{null==y||y()},modalHeaderStyles:{borderBottom:`1px solid ${o.COLORS.stroke.primary}`}},{children:[e.jsx(n.default,{showSampleValues:M,showVariableMapping:p,channel:m,whatsappSpecificPickerMeta:b,showVariableModal:P,variableList:f,discountCode:T,setDiscountCode:I,variableListForImage:L&&(null==L?void 0:L.length)>0?L:f,fileName:O,setFileName:e=>{null==_||_(e)}}),S?e.jsx(i.default,{isWhatsappCarousel:null!=J&&J,onSelect:function(){var e;if((null==xe?void 0:xe.length)<1&&K)return void te(!0);const l=null==S?void 0:S(ie,pe,null!=Z?Z:"",xe);se(null!==(e=null==l?void 0:l.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==l?void 0:l.errorIndexes)||(null==l?void 0:l.error)?((null==l?void 0:l.errorIndexes)&&ae(l.errorIndexes),(null==l?void 0:l.error)&&te(!!(null==l?void 0:l.error))):Ce(!0)}}):e.jsx(e.Fragment,{})]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("react"),t=require("../../utils/StringUtils.js"),o=require("../../constants/Theme.js"),a=require("../modals/styledModal.js"),r=require("../template-preview/models/Channels.js"),s=require("./context/templateModalContext.js"),i=require("./modalElements/Footer.js"),n=require("./modalElements/TemplateSelectModalContent.js"),d=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=u=>{let{selectedTemplate:c,closeDialog:v,showVariableMapping:p,channel:m,htmlContent:h,templateVariables:C,onTemplateSelect:S,globalPlaceholders:E,showOnlyContent:x,whatsappSpecificPickerMeta:b,zIndex:g,showVariableModal:P,variableList:f,discountCode:T,setDiscountCode:I,onBackPress:y,enabledCustomText:j,variableListForImage:L,showSampleValues:M,disableEditVariable:w,pod:N,extras:A,pickerConf:D,selectedCarouselProducts:H,disableEditExpiry:V,cardWidth:k,onDeleteSelectedProducts:q,fileName:O,setFileName:_,hideDeviceContainerInPreview:F}=u;var W,B,R,Y,z,$,U,G;l.useEffect((()=>{ee(h)}),[h]);const J=m===r.CHANNEL_TYPE.WHATSAPP&&"CAROUSEL"===(null===(B=null===(W=null==c?void 0:c.components)||void 0===W?void 0:W[1])||void 0===B?void 0:B.type),K=null==c?void 0:c.isProductCarouselType,[Q,X]=l.useState(m===r.CHANNEL_TYPE.EMAIL||J?"desktop":"mobile"),[Z,ee]=l.useState(h),[le,te]=l.useState(!1),[oe,ae]=l.useState([]),[re,se]=l.useState({}),[ie,ne]=l.useState(c),[de,ue]=l.useState([]),[ce,ve]=l.useState(!1),[pe,me]=l.useState(null!=C?C:[]),[he,Ce]=l.useState(!1),[Se,Ee]=l.useState((null===(Y=null===(R=null==ie?void 0:ie.mapping)||void 0===R?void 0:R.body)||void 0===Y?void 0:Y.length)?-1:0),[xe,be]=l.useState([]),ge=l.useRef(null),[Pe,fe]=l.useState(!1);l.useEffect((()=>{H?be(H):K&&be([])}),[H]),l.useEffect((()=>{var e;if(!ce&&K&&(!H||0===be.length)){const l=null===(e=null==ie?void 0:ie.components)||void 0===e?void 0:e[1].cards,t=[];null==l||l.forEach((e=>{var l;null===(l=null==e?void 0:e.components)||void 0===l||l.forEach((e=>{var l,o,a;"HEADER"===e.type&&t.push(null!==(a=null===(o=null===(l=e.example)||void 0===l?void 0:l.header_handle)||void 0===o?void 0:o[0])&&void 0!==a?a:"")}))})),ue(t),ve(!0)}}),[ce]);const Te=l.useMemo((()=>d.convertPlaceholdersToBikDropdown(E)),[E]);return e.jsx(s.TemplateModalContext.Provider,Object.assign({value:{template:ie,setTemplate:ne,device:Q,setDevice:X,display_content:Z,setDisplayContent:ee,originalVariableList:pe,setOriginalVariableList:me,isError:le,setIsError:te,channel:m,globalNormalizedPlaceholders:Te,templateSelectionTriggered:he,setTemplateSelectionTriggered:Ce,enabledCustomText:j,disableEditVariable:w,pod:N,extras:A,isWhatsappCarousel:J,selectedCarouselIndex:Se,setSelectedCarouselIndex:Ee,isProductCarouselType:K,templateErrorIndexes:re,cardCount:J?null===($=null===(z=c.components)||void 0===z?void 0:z[1].cards)||void 0===$?void 0:$.length:void 0,errorIndexes:oe,setErrorIndexes:ae,pickerConf:D,carouselProducts:xe,setCarouselProducts:be,disableEditExpiry:V,cardWidth:k,cardImages:de,onDeleteSelectedProducts:q,hideDeviceContainerInPreview:F,sliderRef:ge,isCarouselHovered:Pe,setIsCarouselHovered:fe}},{children:x?e.jsx(n.default,{channel:r.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(a.StyledModal,Object.assign({zIndex:g,centralContainerStyles:{width:J?900:m===r.CHANNEL_TYPE.EMAIL&&p?1e3:800},open:!0,onClose:()=>{null==v||v()},headingTitle:null==ie?void 0:ie.label,headingSubtitle:m===r.CHANNEL_TYPE.WHATSAPP?`${t.default.capitaliseFirstLetterOfString(null!==(U=null==ie?void 0:ie.category)&&void 0!==U?U:"")} • ${null!==(G=null==ie?void 0:ie.templateCategory)&&void 0!==G?G:""}`:"",onBackPress:()=>{null==y||y()},modalHeaderStyles:{borderBottom:`1px solid ${o.COLORS.stroke.primary}`}},{children:[e.jsx(n.default,{showSampleValues:M,showVariableMapping:p,channel:m,whatsappSpecificPickerMeta:b,showVariableModal:P,variableList:f,discountCode:T,setDiscountCode:I,variableListForImage:L&&(null==L?void 0:L.length)>0?L:f,fileName:O,setFileName:e=>{null==_||_(e)}}),S?e.jsx(i.default,{isWhatsappCarousel:null!=J&&J,onSelect:function(){var e;if((null==xe?void 0:xe.length)<1&&K)return void te(!0);const l=null==S?void 0:S(ie,pe,null!=Z?Z:"",xe);se(null!==(e=null==l?void 0:l.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==l?void 0:l.errorIndexes)||(null==l?void 0:l.error)?((null==l?void 0:l.errorIndexes)&&ae(l.errorIndexes),(null==l?void 0:l.error)&&te(!!(null==l?void 0:l.error))):Ce(!0)}}):e.jsx(e.Fragment,{})]}))}))};
@@ -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{jsx as e,jsxs as l,Fragment as o}from"react/jsx-runtime";import{useEffect as t,useState as r,useRef as i,useMemo as a}from"react";import n from"../../utils/StringUtils.js";import{COLORS as s}from"../../constants/Theme.js";import{StyledModal as d}from"../modals/styledModal.js";import{CHANNEL_TYPE as c}from"../template-preview/models/Channels.js";import{TemplateModalContext as u}from"./context/templateModalContext.js";import p from"./modalElements/Footer.js";import m from"./modalElements/TemplateSelectModalContent.js";import{convertPlaceholdersToBikDropdown as v}from"./utils/convertPlaceholdersToBikDropdown.js";const h=h=>{let{selectedTemplate:C,closeDialog:b,showVariableMapping:g,channel:f,htmlContent:x,templateVariables:E,onTemplateSelect:I,globalPlaceholders:P,showOnlyContent:S,whatsappSpecificPickerMeta:y,zIndex:T,showVariableModal:w,variableList:M,discountCode:j,setDiscountCode:D,onBackPress:L,enabledCustomText:V,variableListForImage:k,showSampleValues:A,disableEditVariable:H,pod:F,extras:O,pickerConf:W,selectedCarouselProducts:N,disableEditExpiry:B,cardWidth:z,onDeleteSelectedProducts:R,fileName:$,setFileName:U,hideDeviceContainerInPreview:_}=h;var q,G,J,K,Q,X,Y,Z;t((()=>{ie(x)}),[x]);const ee=f===c.WHATSAPP&&"CAROUSEL"===(null===(G=null===(q=null==C?void 0:C.components)||void 0===q?void 0:q[1])||void 0===G?void 0:G.type),le=null==C?void 0:C.isProductCarouselType,[oe,te]=r(f===c.EMAIL||ee?"desktop":"mobile"),[re,ie]=r(x),[ae,ne]=r(!1),[se,de]=r([]),[ce,ue]=r({}),[pe,me]=r(C),[ve,he]=r([]),[Ce,be]=r(!1),[ge,fe]=r(null!=E?E:[]),[xe,Ee]=r(!1),[Ie,Pe]=r(ee?(null===(K=null===(J=null==pe?void 0:pe.mapping)||void 0===J?void 0:J.body)||void 0===K?void 0:K.length)?-1:0:-1),[Se,ye]=r([]),Te=i(null),[we,Me]=r(!1);t((()=>{N?ye(N):le&&ye([])}),[N]),t((()=>{var e;if(!Ce&&le&&(!N||0===ye.length)){const l=null===(e=null==pe?void 0:pe.components)||void 0===e?void 0:e[1].cards,o=[];null==l||l.forEach((e=>{var l;null===(l=null==e?void 0:e.components)||void 0===l||l.forEach((e=>{var l,t,r;"HEADER"===e.type&&o.push(null!==(r=null===(t=null===(l=e.example)||void 0===l?void 0:l.header_handle)||void 0===t?void 0:t[0])&&void 0!==r?r:"")}))})),he(o),be(!0)}}),[Ce]);const je=a((()=>v(P)),[P]);return e(u.Provider,Object.assign({value:{template:pe,setTemplate:me,device:oe,setDevice:te,display_content:re,setDisplayContent:ie,originalVariableList:ge,setOriginalVariableList:fe,isError:ae,setIsError:ne,channel:f,globalNormalizedPlaceholders:je,templateSelectionTriggered:xe,setTemplateSelectionTriggered:Ee,enabledCustomText:V,disableEditVariable:H,pod:F,extras:O,isWhatsappCarousel:ee,selectedCarouselIndex:Ie,setSelectedCarouselIndex:Pe,isProductCarouselType:le,templateErrorIndexes:ce,cardCount:ee?null===(X=null===(Q=C.components)||void 0===Q?void 0:Q[1].cards)||void 0===X?void 0:X.length:void 0,errorIndexes:se,setErrorIndexes:de,pickerConf:W,carouselProducts:Se,setCarouselProducts:ye,disableEditExpiry:B,cardWidth:z,cardImages:ve,onDeleteSelectedProducts:R,hideDeviceContainerInPreview:_,sliderRef:Te,isCarouselHovered:we,setIsCarouselHovered:Me}},{children:S?e(m,{channel:c.EMAIL,hideHeader:!0}):l(d,Object.assign({zIndex:T,centralContainerStyles:{width:ee?900:f===c.EMAIL&&g?1e3:800},open:!0,onClose:()=>{null==b||b()},headingTitle:null==pe?void 0:pe.label,headingSubtitle:f===c.WHATSAPP?`${n.capitaliseFirstLetterOfString(null!==(Y=null==pe?void 0:pe.category)&&void 0!==Y?Y:"")} • ${null!==(Z=null==pe?void 0:pe.templateCategory)&&void 0!==Z?Z:""}`:"",onBackPress:()=>{null==L||L()},modalHeaderStyles:{borderBottom:`1px solid ${s.stroke.primary}`}},{children:[e(m,{showSampleValues:A,showVariableMapping:g,channel:f,whatsappSpecificPickerMeta:y,showVariableModal:w,variableList:M,discountCode:j,setDiscountCode:D,variableListForImage:k&&(null==k?void 0:k.length)>0?k:M,fileName:$,setFileName:e=>{null==U||U(e)}}),I?e(p,{isWhatsappCarousel:null!=ee&&ee,onSelect:function(){var e;if((null==Se?void 0:Se.length)<1&&le)return void ne(!0);const l=null==I?void 0:I(pe,ge,null!=re?re:"",Se);ue(null!==(e=null==l?void 0:l.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==l?void 0:l.errorIndexes)||(null==l?void 0:l.error)?((null==l?void 0:l.errorIndexes)&&de(l.errorIndexes),(null==l?void 0:l.error)&&ne(!!(null==l?void 0:l.error))):Ee(!0)}}):e(o,{})]}))}))};export{h as TemplateContextMapper};
1
+ import{jsx as e,jsxs as l,Fragment as o}from"react/jsx-runtime";import{useEffect as t,useState as r,useRef as i,useMemo as a}from"react";import n from"../../utils/StringUtils.js";import{COLORS as s}from"../../constants/Theme.js";import{StyledModal as d}from"../modals/styledModal.js";import{CHANNEL_TYPE as c}from"../template-preview/models/Channels.js";import{TemplateModalContext as u}from"./context/templateModalContext.js";import p from"./modalElements/Footer.js";import m from"./modalElements/TemplateSelectModalContent.js";import{convertPlaceholdersToBikDropdown as v}from"./utils/convertPlaceholdersToBikDropdown.js";const h=h=>{let{selectedTemplate:C,closeDialog:b,showVariableMapping:g,channel:f,htmlContent:x,templateVariables:E,onTemplateSelect:I,globalPlaceholders:P,showOnlyContent:S,whatsappSpecificPickerMeta:y,zIndex:T,showVariableModal:w,variableList:M,discountCode:j,setDiscountCode:D,onBackPress:L,enabledCustomText:V,variableListForImage:k,showSampleValues:A,disableEditVariable:H,pod:F,extras:O,pickerConf:W,selectedCarouselProducts:N,disableEditExpiry:B,cardWidth:z,onDeleteSelectedProducts:R,fileName:$,setFileName:U,hideDeviceContainerInPreview:_}=h;var q,G,J,K,Q,X,Y,Z;t((()=>{ie(x)}),[x]);const ee=f===c.WHATSAPP&&"CAROUSEL"===(null===(G=null===(q=null==C?void 0:C.components)||void 0===q?void 0:q[1])||void 0===G?void 0:G.type),le=null==C?void 0:C.isProductCarouselType,[oe,te]=r(f===c.EMAIL||ee?"desktop":"mobile"),[re,ie]=r(x),[ae,ne]=r(!1),[se,de]=r([]),[ce,ue]=r({}),[pe,me]=r(C),[ve,he]=r([]),[Ce,be]=r(!1),[ge,fe]=r(null!=E?E:[]),[xe,Ee]=r(!1),[Ie,Pe]=r((null===(K=null===(J=null==pe?void 0:pe.mapping)||void 0===J?void 0:J.body)||void 0===K?void 0:K.length)?-1:0),[Se,ye]=r([]),Te=i(null),[we,Me]=r(!1);t((()=>{N?ye(N):le&&ye([])}),[N]),t((()=>{var e;if(!Ce&&le&&(!N||0===ye.length)){const l=null===(e=null==pe?void 0:pe.components)||void 0===e?void 0:e[1].cards,o=[];null==l||l.forEach((e=>{var l;null===(l=null==e?void 0:e.components)||void 0===l||l.forEach((e=>{var l,t,r;"HEADER"===e.type&&o.push(null!==(r=null===(t=null===(l=e.example)||void 0===l?void 0:l.header_handle)||void 0===t?void 0:t[0])&&void 0!==r?r:"")}))})),he(o),be(!0)}}),[Ce]);const je=a((()=>v(P)),[P]);return e(u.Provider,Object.assign({value:{template:pe,setTemplate:me,device:oe,setDevice:te,display_content:re,setDisplayContent:ie,originalVariableList:ge,setOriginalVariableList:fe,isError:ae,setIsError:ne,channel:f,globalNormalizedPlaceholders:je,templateSelectionTriggered:xe,setTemplateSelectionTriggered:Ee,enabledCustomText:V,disableEditVariable:H,pod:F,extras:O,isWhatsappCarousel:ee,selectedCarouselIndex:Ie,setSelectedCarouselIndex:Pe,isProductCarouselType:le,templateErrorIndexes:ce,cardCount:ee?null===(X=null===(Q=C.components)||void 0===Q?void 0:Q[1].cards)||void 0===X?void 0:X.length:void 0,errorIndexes:se,setErrorIndexes:de,pickerConf:W,carouselProducts:Se,setCarouselProducts:ye,disableEditExpiry:B,cardWidth:z,cardImages:ve,onDeleteSelectedProducts:R,hideDeviceContainerInPreview:_,sliderRef:Te,isCarouselHovered:we,setIsCarouselHovered:Me}},{children:S?e(m,{channel:c.EMAIL,hideHeader:!0}):l(d,Object.assign({zIndex:T,centralContainerStyles:{width:ee?900:f===c.EMAIL&&g?1e3:800},open:!0,onClose:()=>{null==b||b()},headingTitle:null==pe?void 0:pe.label,headingSubtitle:f===c.WHATSAPP?`${n.capitaliseFirstLetterOfString(null!==(Y=null==pe?void 0:pe.category)&&void 0!==Y?Y:"")} • ${null!==(Z=null==pe?void 0:pe.templateCategory)&&void 0!==Z?Z:""}`:"",onBackPress:()=>{null==L||L()},modalHeaderStyles:{borderBottom:`1px solid ${s.stroke.primary}`}},{children:[e(m,{showSampleValues:A,showVariableMapping:g,channel:f,whatsappSpecificPickerMeta:y,showVariableModal:w,variableList:M,discountCode:j,setDiscountCode:D,variableListForImage:k&&(null==k?void 0:k.length)>0?k:M,fileName:$,setFileName:e=>{null==U||U(e)}}),I?e(p,{isWhatsappCarousel:null!=ee&&ee,onSelect:function(){var e;if((null==Se?void 0:Se.length)<1&&le)return void ne(!0);const l=null==I?void 0:I(pe,ge,null!=re?re:"",Se);ue(null!==(e=null==l?void 0:l.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==l?void 0:l.errorIndexes)||(null==l?void 0:l.error)?((null==l?void 0:l.errorIndexes)&&de(l.errorIndexes),(null==l?void 0:l.error)&&ne(!!(null==l?void 0:l.error))):Ee(!0)}}):e(o,{})]}))}))};export{h as TemplateContextMapper};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.520-beta.1",
3
+ "version": "0.0.520",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",