@bikdotai/bik-component-library 0.0.508-beta-err → 0.0.508
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.js +1 -1
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.style.d.ts +0 -4
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.style.js +3 -5
- package/dist/cjs/components/template-preview/WhatsApp/ChatUiV2.js +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/esm/components/template-preview/WhatsApp/ChatUI.js +2 -2
- package/dist/esm/components/template-preview/WhatsApp/ChatUI.style.d.ts +0 -4
- package/dist/esm/components/template-preview/WhatsApp/ChatUI.style.js +4 -6
- package/dist/esm/components/template-preview/WhatsApp/ChatUiV2.js +4 -4
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
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 "../../../
|
|
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 "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default IGTrigger;
|
package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DropdownOption } from "../../../dropdown/type";
|
|
3
|
-
import { QueryBuilderProperty } from "../../
|
|
4
|
-
import { QueryBuilderNodeProps } from "../../
|
|
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"),a=require("../modals/styledModal.js"),o=require("../template-preview/models/Channels.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("react"),t=require("../../utils/StringUtils.js"),a=require("../modals/styledModal.js"),o=require("../template-preview/models/Channels.js"),r=require("./context/templateModalContext.js"),s=require("./modalElements/Footer.js"),i=require("./modalElements/TemplateSelectModalContent.js"),n=require("./utils/convertPlaceholdersToBikDropdown.js"),d=require("./utils/validateName.js");exports.TemplateContextMapper=u=>{let{selectedTemplate:c,closeDialog:p,showVariableMapping:v,channel:m,htmlContent:h,templateVariables:C,onTemplateSelect:E,globalPlaceholders:S,showOnlyContent:x,whatsappSpecificPickerMeta:b,zIndex:g,showVariableModal:P,variableList:f,discountCode:T,setDiscountCode:j,onBackPress:I,enabledCustomText:M,variableListForImage:N,showSampleValues:L,disableEditVariable:y,pod:A,extras:w,pickerConf:V,selectedCarouselProducts:q,disableEditExpiry:D,cardWidth:k,onDeleteSelectedProducts:H,fileName:_,setFileName:F}=u;var O,W,Y,B,z,R;l.useEffect((()=>{Q(h)}),[h]);const U=m===o.CHANNEL_TYPE.WHATSAPP&&"CAROUSEL"===(null===(W=null===(O=null==c?void 0:c.components)||void 0===O?void 0:O[1])||void 0===W?void 0:W.type),$=null==c?void 0:c.isProductCarouselType,[G,J]=l.useState(m===o.CHANNEL_TYPE.EMAIL||U?"desktop":"mobile"),[K,Q]=l.useState(h),[X,Z]=l.useState(!1),[ee,le]=l.useState([]),[te,ae]=l.useState(c),[oe,re]=l.useState([]),[se,ie]=l.useState(!1),[ne,de]=l.useState(null!=C?C:[]),[ue,ce]=l.useState(!1),[pe,ve]=l.useState(-1),[me,he]=l.useState([]),[Ce,Ee]=l.useState(_);l.useEffect((()=>{q?he(q):$&&he([])}),[q]),l.useEffect((()=>{var e;if(!se&&$&&(!q||0===he.length)){const l=null===(e=null==te?void 0:te.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,a,o;"HEADER"===e.type&&t.push(null!==(o=null===(a=null===(l=e.example)||void 0===l?void 0:l.header_handle)||void 0===a?void 0:a[0])&&void 0!==o?o:"")}))})),re(t),ie(!0)}}),[se]);const Se=l.useMemo((()=>n.convertPlaceholdersToBikDropdown(S)),[S]);return e.jsx(r.TemplateModalContext.Provider,Object.assign({value:{template:te,setTemplate:ae,device:G,setDevice:J,display_content:K,setDisplayContent:Q,originalVariableList:ne,setOriginalVariableList:de,isError:X,setIsError:Z,channel:m,globalNormalizedPlaceholders:Se,templateSelectionTriggered:ue,setTemplateSelectionTriggered:ce,enabledCustomText:M,disableEditVariable:y,pod:A,extras:w,isWhatsappCarousel:U,selectedCarouselIndex:pe,setSelectedCarouselIndex:ve,isProductCarouselType:$,cardCount:U?null===(B=null===(Y=c.components)||void 0===Y?void 0:Y[1].cards)||void 0===B?void 0:B.length:void 0,errorIndexes:ee,setErrorIndexes:le,pickerConf:V,carouselProducts:me,setCarouselProducts:he,disableEditExpiry:D,cardWidth:k,cardImages:oe,onDeleteSelectedProducts:H}},{children:x?e.jsx(i.default,{channel:o.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(a.StyledModal,Object.assign({zIndex:g,centralContainerStyles:{width:U?900:m===o.CHANNEL_TYPE.EMAIL&&v?1e3:800},open:!0,onClose:()=>{null==p||p()},headingTitle:null==te?void 0:te.label,headingSubtitle:m===o.CHANNEL_TYPE.WHATSAPP?`${t.default.capitaliseFirstLetterOfString(null!==(z=null==te?void 0:te.category)&&void 0!==z?z:"")} • ${null!==(R=null==te?void 0:te.templateCategory)&&void 0!==R?R:""}`:"",onBackPress:()=>{null==I||I()}},{children:[e.jsx(i.default,{showSampleValues:L,showVariableMapping:v,channel:m,whatsappSpecificPickerMeta:b,showVariableModal:P,variableList:f,discountCode:T,setDiscountCode:j,variableListForImage:N&&(null==N?void 0:N.length)>0?N:f,fileName:_,setFileName:e=>{null==F||F(e),Ee(e)}}),E?e.jsx(s.default,{isWhatsappCarousel:null!=U&&U,onSelect:function(){if((null==me?void 0:me.length)<1&&$)return void Z(!0);if(!Ce)return void Z(!0);if(!Ce||d.validateInputName(Ce))return void Z(!0);const e=null==E?void 0:E(te,ne,null!=K?K:"",me);(null==e?void 0:e.errorIndexes)||(null==e?void 0:e.error)?((null==e?void 0:e.errorIndexes)&&le(e.errorIndexes),(null==e?void 0:e.error)&&Z(!!(null==e?void 0:e.error))):ce(!0)}}):e.jsx(e.Fragment,{})]}))}))};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
height: 8px;
|
|
5
5
|
left: -8px;
|
|
6
6
|
top: -9px;
|
|
7
|
-
`;exports.default=a=>{const{bodyText:j,footerText:m,headerMediaType:y,headerText:
|
|
7
|
+
`;exports.default=a=>{const{bodyText:j,footerText:m,headerMediaType:y,headerText:S,headerAssetLink:g,headerAssetName:f,quickReplybtn:v,ctaBtn:q,actionTypes:E,textType:b,extras:w,showHeader:C,imagePreviewStyles:A,size:N,children:O,isPreview:F}=a,M=new l.WhatsAppFormatToHTML,P=i.useMemo((()=>({color:d.COLORS.content.primary,margin:12,fontSize:C?d.FONTS.caption.fontSize:d.FONTS.bodySecondary.fontSize,fontWeight:d.FONTS.bodySecondary.fontWeight,maxWidth:"100%",whiteSpace:"pre-wrap",marginBottom:0,marginTop:8,wordBreak:"break-word"})),[]);return e.jsxs(p.Container,Object.assign({isPreview:F},{children:[e.jsx(u,{children:e.jsx(t.default,{color:"white",height:8,width:8})}),y===c.HEADER_TYPES.TEXT?e.jsx(T.default,{bold:!0,text:S}):y!==c.HEADER_TYPES.NONE?e.jsx(x.MediaCard,{headerAssetLink:g,headerAssetName:f,mediaType:y,imagePreviewStyles:y===c.HEADER_TYPES.IMAGE?A:{}}):e.jsx(e.Fragment,{}),!!j&&e.jsx(e.Fragment,{children:O?e.jsx(e.Fragment,{children:O}):e.jsx(e.Fragment,{children:"html"===b?e.jsx("div",{className:"richTextEditor",style:P,dangerouslySetInnerHTML:{__html:M.convertToHTML(j)}}):e.jsx(n.BodySecondary,{children:j})})}),e.jsxs(p.FooterWrapper,{children:[e.jsx(o.Tooltip,Object.assign({body:null!=m?m:"",placement:"top"},{children:e.jsx(p.TimeStamp,Object.assign({style:{flex:1}},{children:m}))})),e.jsx(p.TimeStamp,{children:"16:48"})]}),E===c.ACTIONS_TYPES.QUICK_REPLY?e.jsx("div",{children:null==v?void 0:v.map(((t,r)=>e.jsx(h.ChatBtn,{text:t.text},r)))}):E===c.ACTIONS_TYPES.CTA_BTN?e.jsx("div",{children:null==q?void 0:q.map(((t,i)=>e.jsx(h.ChatBtn,{textTypography:C?n.Caption:n.BodySecondary,extraContent:w?t.extra:void 0,placeholder:t.placeholder,text:t.text,Icon:"phoneNumber"===t.type?r.default:s.default,size:N},i)))}):e.jsx(e.Fragment,{})]}))};
|
|
@@ -9,10 +9,6 @@ export declare const TimeStamp: import("styled-components").StyledComponent<"div
|
|
|
9
9
|
numberOfLines?: number | undefined;
|
|
10
10
|
color?: string | undefined;
|
|
11
11
|
}, never>;
|
|
12
|
-
export declare const FooterText: import("styled-components").StyledComponent<"div", any, {
|
|
13
|
-
numberOfLines?: number | undefined;
|
|
14
|
-
color?: string | undefined;
|
|
15
|
-
}, never>;
|
|
16
12
|
export declare const MediaContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
17
13
|
export declare const ChatBtnContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
14
|
export declare const FooterWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -21,9 +21,7 @@
|
|
|
21
21
|
white-space: nowrap;
|
|
22
22
|
overflow: hidden;
|
|
23
23
|
text-wrap: wrap;
|
|
24
|
-
`,s=i.default
|
|
25
|
-
max-width: 200px;
|
|
26
|
-
`,p=i.default.div`
|
|
24
|
+
`,s=i.default.div`
|
|
27
25
|
border-radius: 8px;
|
|
28
26
|
display: flex;
|
|
29
27
|
flex-direction: column;
|
|
@@ -39,7 +37,7 @@
|
|
|
39
37
|
justify-content: center;
|
|
40
38
|
align-items: center;
|
|
41
39
|
border-top: 1px solid ${r.COLORS.stroke.primary};
|
|
42
|
-
`,
|
|
40
|
+
`,p=i.default.div`
|
|
43
41
|
display: flex;
|
|
44
42
|
flex-direction: row;
|
|
45
43
|
justify-content: space-between;
|
|
@@ -62,4 +60,4 @@
|
|
|
62
60
|
position: absolute;
|
|
63
61
|
top: 16px;
|
|
64
62
|
right: 16px;
|
|
65
|
-
`,exports.ChatBtnContainer=n,exports.Container=a,exports.
|
|
63
|
+
`,exports.ChatBtnContainer=n,exports.Container=a,exports.FooterWrapper=p,exports.MediaContainer=s,exports.TimeStamp=d;
|
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
`,g=f.default(C)`
|
|
17
17
|
font-weight: 600;
|
|
18
18
|
margin-bottom: 8px;
|
|
19
|
-
`,E=new u.VariableEditorHelper;exports.ChatUIV2=o=>{const{bodyText:p,footerText:u,headerMediaType:T,headerText:f,headerAssetLink:v,headerAssetName:b,quickReplybtn:q,ctaBtn:O,actionTypes:_,extras:w,showHeader:P,imagePreviewStyles:
|
|
19
|
+
`,E=new u.VariableEditorHelper;exports.ChatUIV2=o=>{const{bodyText:p,footerText:u,headerMediaType:T,headerText:f,headerAssetLink:v,headerAssetName:b,quickReplybtn:q,ctaBtn:O,actionTypes:_,extras:w,showHeader:P,imagePreviewStyles:S,size:I,bodyVariableList:L,headerVariableList:A,buttons:M,limitedTimeOfferComponent:N,carouselCardIndex:R,isWhatsappCarousel:B,isPreview:H}=o,Y=E.format(p,L),U=E.format(f,A),{selectedCarouselIndex:D,isProductCarouselType:F,errorIndexes:V}=n.useTemplateModalContext(),k={COPY_CODE:t.default,PHONE_NUMBER:s.default,URL:a.default,QUICK_REPLY:i.default};return e.jsxs(h.Container,Object.assign({isCarouselCard:null!=R&&R>-1,showBorder:null!=R&&R===D||F&&null!=R&&R>-1&&null!=D&&D>-1,hasError:null==V?void 0:V.includes(null!=R?R:-2),isWhatsappCarousel:B,isPreview:H},{children:[!B&&e.jsx(y,{children:e.jsx(r.default,{color:"white",height:8,width:8})}),T===x.HEADER_TYPES.TEXT?e.jsx(g,{dangerouslySetInnerHTML:{__html:U}}):T!==x.HEADER_TYPES.NONE?e.jsx(j.MediaCard,{headerAssetLink:v,headerAssetName:b,mediaType:T,imagePreviewStyles:T===x.HEADER_TYPES.IMAGE?S:{}}):e.jsx(e.Fragment,{}),(null==N?void 0:N.dateTime)?e.jsx(m.LimitedTimeOffer,{text:N.text,dateTime:N.dateTime,code:N.code}):e.jsx(e.Fragment,{}),!!p&&e.jsx(e.Fragment,{children:e.jsx(C,{dangerouslySetInnerHTML:{__html:Y}})}),e.jsxs(h.FooterWrapper,{children:[e.jsx(l.Tooltip,Object.assign({body:null!=u?u:"",placement:"top"},{children:e.jsx(h.TimeStamp,Object.assign({style:{flex:1}},{children:u}))})),e.jsx(h.TimeStamp,{children:"16:48"})]}),M&&M.length>0?M.map(((t,r)=>e.jsx(c.ChatBtn,{text:"COPY_CODE"===t.type?"Copy code":t.text,Icon:k[t.type],size:I},r))):_===x.ACTIONS_TYPES.QUICK_REPLY?e.jsx("div",{children:null==q?void 0:q.map(((t,r)=>e.jsx(c.ChatBtn,{text:t.text},r)))}):_===x.ACTIONS_TYPES.CTA_BTN?e.jsx("div",{children:null==O?void 0:O.map(((t,r)=>e.jsx(c.ChatBtn,{textTypography:P?d.Caption:d.BodySecondary,extraContent:w?t.extra:void 0,placeholder:t.placeholder,text:t.text,Icon:"phoneNumber"===t.type?s.default:a.default,size:I},r)))}):e.jsx(e.Fragment,{})]}))};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
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 "../../../
|
|
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 "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default IGTrigger;
|
package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DropdownOption } from "../../../dropdown/type";
|
|
3
|
-
import { QueryBuilderProperty } from "../../
|
|
4
|
-
import { QueryBuilderNodeProps } from "../../
|
|
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 i,useMemo as r}from"react";import a from"../../utils/StringUtils.js";import{StyledModal as n}from"../modals/styledModal.js";import{CHANNEL_TYPE as s}from"../template-preview/models/Channels.js";import{TemplateModalContext as d}from"./context/templateModalContext.js";import c from"./modalElements/Footer.js";import u from"./modalElements/TemplateSelectModalContent.js";import{convertPlaceholdersToBikDropdown as p}from"./utils/convertPlaceholdersToBikDropdown.js";import{validateInputName as m}from"./utils/validateName.js";const v=v=>{let{selectedTemplate:h,closeDialog:C,showVariableMapping:b,channel:g,htmlContent:f,templateVariables:x,onTemplateSelect:E,globalPlaceholders:P,showOnlyContent:S,whatsappSpecificPickerMeta:I,zIndex:T,showVariableModal:y,variableList:w,discountCode:M,setDiscountCode:j,onBackPress:L,enabledCustomText:V,variableListForImage:A,showSampleValues:D,disableEditVariable:k,pod:F,extras:N,pickerConf:O,selectedCarouselProducts:W,disableEditExpiry:H,cardWidth:z,onDeleteSelectedProducts:B,fileName:R,setFileName:U}=v;var $,_,q,G,J,K;t((()=>{le(f)}),[f]);const Q=g===s.WHATSAPP&&"CAROUSEL"===(null===(_=null===($=null==h?void 0:h.components)||void 0===$?void 0:$[1])||void 0===_?void 0:_.type),X=null==h?void 0:h.isProductCarouselType,[Y,Z]=i(g===s.EMAIL||Q?"desktop":"mobile"),[ee,le]=i(f),[oe,te]=i(!1),[ie,re]=i([]),[ae,ne]=i(h),[se,de]=i([]),[ce,ue]=i(!1),[pe,me]=i(null!=x?x:[]),[ve,he]=i(!1),[Ce,be]=i(-1),[ge,fe]=i([]),[xe,Ee]=i(R);t((()=>{W?fe(W):X&&fe([])}),[W]),t((()=>{var e;if(!ce&&X&&(!W||0===fe.length)){const l=null===(e=null==ae?void 0:ae.components)||void 0===e?void 0:e[1].cards,o=[];null==l||l.forEach((e=>{var l;null===(l=null==e?void 0:e.components)||void 0===l||l.forEach((e=>{var l,t,i;"HEADER"===e.type&&o.push(null!==(i=null===(t=null===(l=e.example)||void 0===l?void 0:l.header_handle)||void 0===t?void 0:t[0])&&void 0!==i?i:"")}))})),de(o),ue(!0)}}),[ce]);const Pe=r((()=>p(P)),[P]);return e(d.Provider,Object.assign({value:{template:ae,setTemplate:ne,device:Y,setDevice:Z,display_content:ee,setDisplayContent:le,originalVariableList:pe,setOriginalVariableList:me,isError:oe,setIsError:te,channel:g,globalNormalizedPlaceholders:Pe,templateSelectionTriggered:ve,setTemplateSelectionTriggered:he,enabledCustomText:V,disableEditVariable:k,pod:F,extras:N,isWhatsappCarousel:Q,selectedCarouselIndex:Ce,setSelectedCarouselIndex:be,isProductCarouselType:X,cardCount:Q?null===(G=null===(q=h.components)||void 0===q?void 0:q[1].cards)||void 0===G?void 0:G.length:void 0,errorIndexes:ie,setErrorIndexes:re,pickerConf:O,carouselProducts:ge,setCarouselProducts:fe,disableEditExpiry:H,cardWidth:z,cardImages:se,onDeleteSelectedProducts:B}},{children:S?e(u,{channel:s.EMAIL,hideHeader:!0}):l(n,Object.assign({zIndex:T,centralContainerStyles:{width:Q?900:g===s.EMAIL&&b?1e3:800},open:!0,onClose:()=>{null==C||C()},headingTitle:null==ae?void 0:ae.label,headingSubtitle:g===s.WHATSAPP?`${a.capitaliseFirstLetterOfString(null!==(J=null==ae?void 0:ae.category)&&void 0!==J?J:"")} • ${null!==(K=null==ae?void 0:ae.templateCategory)&&void 0!==K?K:""}`:"",onBackPress:()=>{null==L||L()}},{children:[e(u,{showSampleValues:D,showVariableMapping:b,channel:g,whatsappSpecificPickerMeta:I,showVariableModal:y,variableList:w,discountCode:M,setDiscountCode:j,variableListForImage:A&&(null==A?void 0:A.length)>0?A:w,fileName:R,setFileName:e=>{null==U||U(e),Ee(e)}}),E?e(c,{isWhatsappCarousel:null!=Q&&Q,onSelect:function(){if((null==ge?void 0:ge.length)<1&&X)return void te(!0);if(!xe||m(xe))return void te(!0);const e=null==E?void 0:E(ae,pe,null!=ee?ee:"",ge);(null==e?void 0:e.errorIndexes)||(null==e?void 0:e.error)?((null==e?void 0:e.errorIndexes)&&re(e.errorIndexes),(null==e?void 0:e.error)&&te(!!(null==e?void 0:e.error))):he(!0)}}):e(o,{})]}))}))};export{v as TemplateContextMapper};
|
|
1
|
+
import{jsx as e,jsxs as l,Fragment as o}from"react/jsx-runtime";import{useEffect as t,useState as i,useMemo as r}from"react";import a from"../../utils/StringUtils.js";import{StyledModal as n}from"../modals/styledModal.js";import{CHANNEL_TYPE as s}from"../template-preview/models/Channels.js";import{TemplateModalContext as d}from"./context/templateModalContext.js";import c from"./modalElements/Footer.js";import u from"./modalElements/TemplateSelectModalContent.js";import{convertPlaceholdersToBikDropdown as p}from"./utils/convertPlaceholdersToBikDropdown.js";import{validateInputName as m}from"./utils/validateName.js";const v=v=>{let{selectedTemplate:h,closeDialog:C,showVariableMapping:b,channel:g,htmlContent:f,templateVariables:x,onTemplateSelect:E,globalPlaceholders:P,showOnlyContent:S,whatsappSpecificPickerMeta:I,zIndex:T,showVariableModal:y,variableList:w,discountCode:M,setDiscountCode:j,onBackPress:L,enabledCustomText:V,variableListForImage:A,showSampleValues:D,disableEditVariable:k,pod:F,extras:N,pickerConf:O,selectedCarouselProducts:W,disableEditExpiry:H,cardWidth:z,onDeleteSelectedProducts:B,fileName:R,setFileName:U}=v;var $,_,q,G,J,K;t((()=>{le(f)}),[f]);const Q=g===s.WHATSAPP&&"CAROUSEL"===(null===(_=null===($=null==h?void 0:h.components)||void 0===$?void 0:$[1])||void 0===_?void 0:_.type),X=null==h?void 0:h.isProductCarouselType,[Y,Z]=i(g===s.EMAIL||Q?"desktop":"mobile"),[ee,le]=i(f),[oe,te]=i(!1),[ie,re]=i([]),[ae,ne]=i(h),[se,de]=i([]),[ce,ue]=i(!1),[pe,me]=i(null!=x?x:[]),[ve,he]=i(!1),[Ce,be]=i(-1),[ge,fe]=i([]),[xe,Ee]=i(R);t((()=>{W?fe(W):X&&fe([])}),[W]),t((()=>{var e;if(!ce&&X&&(!W||0===fe.length)){const l=null===(e=null==ae?void 0:ae.components)||void 0===e?void 0:e[1].cards,o=[];null==l||l.forEach((e=>{var l;null===(l=null==e?void 0:e.components)||void 0===l||l.forEach((e=>{var l,t,i;"HEADER"===e.type&&o.push(null!==(i=null===(t=null===(l=e.example)||void 0===l?void 0:l.header_handle)||void 0===t?void 0:t[0])&&void 0!==i?i:"")}))})),de(o),ue(!0)}}),[ce]);const Pe=r((()=>p(P)),[P]);return e(d.Provider,Object.assign({value:{template:ae,setTemplate:ne,device:Y,setDevice:Z,display_content:ee,setDisplayContent:le,originalVariableList:pe,setOriginalVariableList:me,isError:oe,setIsError:te,channel:g,globalNormalizedPlaceholders:Pe,templateSelectionTriggered:ve,setTemplateSelectionTriggered:he,enabledCustomText:V,disableEditVariable:k,pod:F,extras:N,isWhatsappCarousel:Q,selectedCarouselIndex:Ce,setSelectedCarouselIndex:be,isProductCarouselType:X,cardCount:Q?null===(G=null===(q=h.components)||void 0===q?void 0:q[1].cards)||void 0===G?void 0:G.length:void 0,errorIndexes:ie,setErrorIndexes:re,pickerConf:O,carouselProducts:ge,setCarouselProducts:fe,disableEditExpiry:H,cardWidth:z,cardImages:se,onDeleteSelectedProducts:B}},{children:S?e(u,{channel:s.EMAIL,hideHeader:!0}):l(n,Object.assign({zIndex:T,centralContainerStyles:{width:Q?900:g===s.EMAIL&&b?1e3:800},open:!0,onClose:()=>{null==C||C()},headingTitle:null==ae?void 0:ae.label,headingSubtitle:g===s.WHATSAPP?`${a.capitaliseFirstLetterOfString(null!==(J=null==ae?void 0:ae.category)&&void 0!==J?J:"")} • ${null!==(K=null==ae?void 0:ae.templateCategory)&&void 0!==K?K:""}`:"",onBackPress:()=>{null==L||L()}},{children:[e(u,{showSampleValues:D,showVariableMapping:b,channel:g,whatsappSpecificPickerMeta:I,showVariableModal:y,variableList:w,discountCode:M,setDiscountCode:j,variableListForImage:A&&(null==A?void 0:A.length)>0?A:w,fileName:R,setFileName:e=>{null==U||U(e),Ee(e)}}),E?e(c,{isWhatsappCarousel:null!=Q&&Q,onSelect:function(){if((null==ge?void 0:ge.length)<1&&X)return void te(!0);if(!xe)return void te(!0);if(!xe||m(xe))return void te(!0);const e=null==E?void 0:E(ae,pe,null!=ee?ee:"",ge);(null==e?void 0:e.errorIndexes)||(null==e?void 0:e.error)?((null==e?void 0:e.errorIndexes)&&re(e.errorIndexes),(null==e?void 0:e.error)&&te(!!(null==e?void 0:e.error))):he(!0)}}):e(o,{})]}))}))};export{v as TemplateContextMapper};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import o from"../../../assets/icons/halfRectangle.svg.js";import i from"../../../assets/icons/phone.svg.js";import s from"../../../assets/icons/RedirectToNew.svg.js";import{useMemo as a}from"react";import n from"styled-components";import{Tooltip as m}from"../../tooltips/Tooltip.js";import{BodySecondary as p,Caption as d}from"../../TypographyStyle.js";import{COLORS as l,FONTS as h}from"../../../constants/Theme.js";import{WhatsAppFormatToHTML as c}from"../helpers/WhatsAppFormatToHTML.js";import{HEADER_TYPES as f,ACTIONS_TYPES as y}from"../models/TemplateMeta.js";import{ChatBtn as T}from"./ChatBtn.js";import{Container as x,FooterWrapper as g,
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import o from"../../../assets/icons/halfRectangle.svg.js";import i from"../../../assets/icons/phone.svg.js";import s from"../../../assets/icons/RedirectToNew.svg.js";import{useMemo as a}from"react";import n from"styled-components";import{Tooltip as m}from"../../tooltips/Tooltip.js";import{BodySecondary as p,Caption as d}from"../../TypographyStyle.js";import{COLORS as l,FONTS as h}from"../../../constants/Theme.js";import{WhatsAppFormatToHTML as c}from"../helpers/WhatsAppFormatToHTML.js";import{HEADER_TYPES as f,ACTIONS_TYPES as y}from"../models/TemplateMeta.js";import{ChatBtn as T}from"./ChatBtn.js";import{Container as x,FooterWrapper as g,TimeStamp as j}from"./ChatUI.style.js";import{MediaCard as v}from"./MediaCard.js";import w from"./RenderTemplateWithVariable.js";const b=n.div`
|
|
2
2
|
position: absolute;
|
|
3
3
|
width: 8px;
|
|
4
4
|
height: 8px;
|
|
5
5
|
left: -8px;
|
|
6
6
|
top: -9px;
|
|
7
|
-
`,
|
|
7
|
+
`,u=n=>{const{bodyText:u,footerText:S,headerMediaType:N,headerText:A,headerAssetLink:M,headerAssetName:C,quickReplybtn:L,ctaBtn:k,actionTypes:z,textType:B,extras:E,showHeader:I,imagePreviewStyles:P,size:R,children:W,isPreview:H}=n,O=new c,_=a((()=>({color:l.content.primary,margin:12,fontSize:I?h.caption.fontSize:h.bodySecondary.fontSize,fontWeight:h.bodySecondary.fontWeight,maxWidth:"100%",whiteSpace:"pre-wrap",marginBottom:0,marginTop:8,wordBreak:"break-word"})),[]);return e(x,Object.assign({isPreview:H},{children:[t(b,{children:t(o,{color:"white",height:8,width:8})}),N===f.TEXT?t(w,{bold:!0,text:A}):N!==f.NONE?t(v,{headerAssetLink:M,headerAssetName:C,mediaType:N,imagePreviewStyles:N===f.IMAGE?P:{}}):t(r,{}),!!u&&t(r,{children:t(r,W?{children:W}:{children:"html"===B?t("div",{className:"richTextEditor",style:_,dangerouslySetInnerHTML:{__html:O.convertToHTML(u)}}):t(p,{children:u})})}),e(g,{children:[t(m,Object.assign({body:null!=S?S:"",placement:"top"},{children:t(j,Object.assign({style:{flex:1}},{children:S}))})),t(j,{children:"16:48"})]}),z===y.QUICK_REPLY?t("div",{children:null==L?void 0:L.map(((e,r)=>t(T,{text:e.text},r)))}):z===y.CTA_BTN?t("div",{children:null==k?void 0:k.map(((e,r)=>t(T,{textTypography:I?d:p,extraContent:E?e.extra:void 0,placeholder:e.placeholder,text:e.text,Icon:"phoneNumber"===e.type?i:s,size:R},r)))}):t(r,{})]}))};export{u as default};
|
|
@@ -9,10 +9,6 @@ export declare const TimeStamp: import("styled-components").StyledComponent<"div
|
|
|
9
9
|
numberOfLines?: number | undefined;
|
|
10
10
|
color?: string | undefined;
|
|
11
11
|
}, never>;
|
|
12
|
-
export declare const FooterText: import("styled-components").StyledComponent<"div", any, {
|
|
13
|
-
numberOfLines?: number | undefined;
|
|
14
|
-
color?: string | undefined;
|
|
15
|
-
}, never>;
|
|
16
12
|
export declare const MediaContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
17
13
|
export declare const ChatBtnContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
14
|
export declare const FooterWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -21,9 +21,7 @@ import e from"styled-components";import{Caption as r}from"../../TypographyStyle.
|
|
|
21
21
|
white-space: nowrap;
|
|
22
22
|
overflow: hidden;
|
|
23
23
|
text-wrap: wrap;
|
|
24
|
-
`,d=e
|
|
25
|
-
max-width: 200px;
|
|
26
|
-
`,s=e.div`
|
|
24
|
+
`,d=e.div`
|
|
27
25
|
border-radius: 8px;
|
|
28
26
|
display: flex;
|
|
29
27
|
flex-direction: column;
|
|
@@ -32,14 +30,14 @@ import e from"styled-components";import{Caption as r}from"../../TypographyStyle.
|
|
|
32
30
|
min-height: 152px;
|
|
33
31
|
margin-bottom: 4px;
|
|
34
32
|
margin: 0px 8px;
|
|
35
|
-
`,
|
|
33
|
+
`,s=e.div`
|
|
36
34
|
padding: 12px;
|
|
37
35
|
display: flex;
|
|
38
36
|
flex-direction: row;
|
|
39
37
|
justify-content: center;
|
|
40
38
|
align-items: center;
|
|
41
39
|
border-top: 1px solid ${t.stroke.primary};
|
|
42
|
-
`,
|
|
40
|
+
`,p=e.div`
|
|
43
41
|
display: flex;
|
|
44
42
|
flex-direction: row;
|
|
45
43
|
justify-content: space-between;
|
|
@@ -62,4 +60,4 @@ import e from"styled-components";import{Caption as r}from"../../TypographyStyle.
|
|
|
62
60
|
position: absolute;
|
|
63
61
|
top: 16px;
|
|
64
62
|
right: 16px;
|
|
65
|
-
`;export{
|
|
63
|
+
`;export{s as ChatBtnContainer,o as Container,p as FooterWrapper,d as MediaContainer,i as TimeStamp};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import r from"../../../assets/icons/copy-code-icon.svg.js";import i from"../../../assets/icons/halfRectangle.svg.js";import s from"../../../assets/icons/phone.svg.js";import a from"../../../assets/icons/qrb.svg.js";import n from"../../../assets/icons/RedirectToNew.svg.js";import l from"styled-components";import{useTemplateModalContext as m}from"../../template-context-mapper/context/templateModalContext.js";import{Tooltip as p}from"../../tooltips/Tooltip.js";import{Caption as d,BodySecondary as c}from"../../TypographyStyle.js";import{COLORS as h}from"../../../constants/Theme.js";import{VariableEditorHelper as f}from"../helpers/VariableEditorHelper.js";import{HEADER_TYPES as x,ACTIONS_TYPES as y}from"../models/TemplateMeta.js";import{ChatBtn as u}from"./ChatBtn.js";import{Container as T,FooterWrapper as g,
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import r from"../../../assets/icons/copy-code-icon.svg.js";import i from"../../../assets/icons/halfRectangle.svg.js";import s from"../../../assets/icons/phone.svg.js";import a from"../../../assets/icons/qrb.svg.js";import n from"../../../assets/icons/RedirectToNew.svg.js";import l from"styled-components";import{useTemplateModalContext as m}from"../../template-context-mapper/context/templateModalContext.js";import{Tooltip as p}from"../../tooltips/Tooltip.js";import{Caption as d,BodySecondary as c}from"../../TypographyStyle.js";import{COLORS as h}from"../../../constants/Theme.js";import{VariableEditorHelper as f}from"../helpers/VariableEditorHelper.js";import{HEADER_TYPES as x,ACTIONS_TYPES as y}from"../models/TemplateMeta.js";import{ChatBtn as u}from"./ChatBtn.js";import{Container as T,FooterWrapper as g,TimeStamp as C}from"./ChatUI.style.js";import{LimitedTimeOffer as j}from"./LimitedTimeOffer/LimitedTimeOffer.index.js";import{MediaCard as v}from"./MediaCard.js";const b=l.div`
|
|
2
2
|
position: absolute;
|
|
3
3
|
width: 8px;
|
|
4
4
|
height: 8px;
|
|
5
5
|
left: -8px;
|
|
6
6
|
top: -9px;
|
|
7
|
-
`,
|
|
7
|
+
`,w=l.div`
|
|
8
8
|
font-family: 'Inter';
|
|
9
9
|
font-style: normal;
|
|
10
10
|
font-weight: 400;
|
|
@@ -13,7 +13,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import r from"..
|
|
|
13
13
|
padding: 8px 12px 0px;
|
|
14
14
|
color: ${h.content.primary};
|
|
15
15
|
word-wrap: break-word;
|
|
16
|
-
`,
|
|
16
|
+
`,I=l(w)`
|
|
17
17
|
font-weight: 600;
|
|
18
18
|
margin-bottom: 8px;
|
|
19
|
-
`,
|
|
19
|
+
`,O=new f,E=l=>{const{bodyText:h,footerText:f,headerMediaType:E,headerText:L,headerAssetLink:P,headerAssetName:_,quickReplybtn:N,ctaBtn:M,actionTypes:R,extras:A,showHeader:B,imagePreviewStyles:H,size:S,bodyVariableList:U,headerVariableList:k,buttons:z,limitedTimeOfferComponent:Y,carouselCardIndex:V,isWhatsappCarousel:q,isPreview:D}=l,K=O.format(h,U),Q=O.format(L,k),{selectedCarouselIndex:W,isProductCarouselType:G,errorIndexes:X}=m(),$={COPY_CODE:r,PHONE_NUMBER:s,URL:n,QUICK_REPLY:a};return e(T,Object.assign({isCarouselCard:null!=V&&V>-1,showBorder:null!=V&&V===W||G&&null!=V&&V>-1&&null!=W&&W>-1,hasError:null==X?void 0:X.includes(null!=V?V:-2),isWhatsappCarousel:q,isPreview:D},{children:[!q&&t(b,{children:t(i,{color:"white",height:8,width:8})}),E===x.TEXT?t(I,{dangerouslySetInnerHTML:{__html:Q}}):E!==x.NONE?t(v,{headerAssetLink:P,headerAssetName:_,mediaType:E,imagePreviewStyles:E===x.IMAGE?H:{}}):t(o,{}),(null==Y?void 0:Y.dateTime)?t(j,{text:Y.text,dateTime:Y.dateTime,code:Y.code}):t(o,{}),!!h&&t(o,{children:t(w,{dangerouslySetInnerHTML:{__html:K}})}),e(g,{children:[t(p,Object.assign({body:null!=f?f:"",placement:"top"},{children:t(C,Object.assign({style:{flex:1}},{children:f}))})),t(C,{children:"16:48"})]}),z&&z.length>0?z.map(((e,o)=>t(u,{text:"COPY_CODE"===e.type?"Copy code":e.text,Icon:$[e.type],size:S},o))):R===y.QUICK_REPLY?t("div",{children:null==N?void 0:N.map(((e,o)=>t(u,{text:e.text},o)))}):R===y.CTA_BTN?t("div",{children:null==M?void 0:M.map(((e,o)=>t(u,{textTypography:B?d:c,extraContent:A?e.extra:void 0,placeholder:e.placeholder,text:e.text,Icon:"phoneNumber"===e.type?s:n,size:S},o)))}):t(o,{})]}))};export{E as ChatUIV2};
|