@bikdotai/bik-component-library 0.0.44-2.beta.link.5 → 0.0.44-4.beta-2
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/WhatsAppTextEditor/WhatsAppTextEditor.js +1 -1
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/cjs/components/carousel-preview/CarouselPreview.d.ts +2 -0
- package/dist/cjs/components/carousel-preview/CarouselPreview.js +3 -3
- package/dist/cjs/components/carousel-preview/CarouselPreviewCard.d.ts +2 -0
- package/dist/cjs/components/carousel-preview/CarouselPreviewCard.js +1 -1
- package/dist/cjs/components/product-picker-v2/modal.d.ts +1 -0
- package/dist/cjs/components/product-picker-v2/modal.js +1 -1
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.d.ts +1 -2
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/Body.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +2 -2
- package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.js +3 -3
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
- package/dist/cjs/components/template-preview/TemplatePreview.d.ts +2 -1
- package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.js +2 -2
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.style.d.ts +1 -0
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.style.js +4 -4
- package/dist/cjs/components/template-preview/WhatsApp/ChatUiV2.js +4 -4
- package/dist/cjs/components/template-preview/WhatsApp/LimitedTimeOffer/LimitedTimeOffer.index.js +1 -0
- package/dist/cjs/components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js +4 -4
- package/dist/cjs/components/template-preview/WhatsAppTemplatePreview.d.ts +1 -0
- package/dist/cjs/components/template-preview/WhatsAppTemplatePreview.js +1 -1
- package/dist/cjs/components/template-preview/models/WhatsAppTemplate.d.ts +1 -0
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditor.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/esm/components/carousel-preview/CarouselPreview.d.ts +2 -0
- package/dist/esm/components/carousel-preview/CarouselPreview.js +2 -2
- package/dist/esm/components/carousel-preview/CarouselPreviewCard.d.ts +2 -0
- package/dist/esm/components/carousel-preview/CarouselPreviewCard.js +1 -1
- package/dist/esm/components/product-picker-v2/modal.d.ts +1 -0
- package/dist/esm/components/product-picker-v2/modal.js +1 -1
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.d.ts +1 -2
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/Body.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.js +2 -2
- package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
- package/dist/esm/components/template-preview/TemplatePreview.d.ts +2 -1
- package/dist/esm/components/template-preview/TemplatePreview.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 +1 -0
- package/dist/esm/components/template-preview/WhatsApp/ChatUI.style.js +16 -16
- package/dist/esm/components/template-preview/WhatsApp/ChatUiV2.js +5 -5
- package/dist/esm/components/template-preview/WhatsApp/LimitedTimeOffer/LimitedTimeOffer.index.js +5 -4
- package/dist/esm/components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js +3 -3
- package/dist/esm/components/template-preview/WhatsAppTemplatePreview.d.ts +1 -0
- package/dist/esm/components/template-preview/WhatsAppTemplatePreview.js +1 -1
- package/dist/esm/components/template-preview/models/WhatsAppTemplate.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,Fragment as r,jsxs as o}from"react/jsx-runtime";import t from"styled-components";import{TitleRegular as a}from"../../TypographyStyle.js";import{COLORS as
|
|
1
|
+
import{jsx as e,Fragment as r,jsxs as o}from"react/jsx-runtime";import t from"styled-components";import{TitleRegular as a}from"../../TypographyStyle.js";import{COLORS as s}from"../../../constants/Theme.js";import{getPreviewPropLen as i}from"../utils/getPreviewPropLen.js";import p from"./ChatHeader.js";import{ChatUIV2 as n}from"./ChatUiV2.js";const d=t.div`
|
|
2
2
|
background-image: url(${e=>e.isWhatsappCarousel?void 0:"https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F341dba50-e84e-4457-b5b5-d9d8a0b95a73?alt=media&token=6fd32f23-8bb2-4980-bbee-bef39b38fd9f"});
|
|
3
3
|
border-radius: 4px;
|
|
4
4
|
background-repeat: no-repeat;
|
|
@@ -6,5 +6,5 @@ import{jsx as e,Fragment as r,jsxs as o}from"react/jsx-runtime";import t from"st
|
|
|
6
6
|
background-size: cover;
|
|
7
7
|
position: relative;
|
|
8
8
|
`,c=t(a)`
|
|
9
|
-
color: ${
|
|
10
|
-
`,m=t=>{const a=
|
|
9
|
+
color: ${s.content.primary};
|
|
10
|
+
`,m=t=>{const a=i(t);return e(r,3===a?{children:t.zeroStateComponent}:{children:o(d,Object.assign({style:t.containerStyle,showHeader:t.showHeader,isWhatsappCarousel:t.isWhatsappCarousel},{children:[t.showHeader&&e(p,{}),o("div",Object.assign({style:{padding:"small"===t.size?"12px 32px 12px 12px":`16px ${t.isWhatsappCarousel?"0px":"56px"} 12px 16px`}},{children:[!t.hidePreviewText&&e("div",Object.assign({style:{marginBottom:16}},{children:e(c,{children:"Preview"})})),e(n,Object.assign({showHeader:t.showHeader},t))]}))]}))})};export{m as WhatsappLikePreviewV2};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as l}from"react/jsx-runtime";import{useState as t,useEffect as a}from"react";import{useTemplateModalContext as
|
|
1
|
+
import{jsx as e,Fragment as l}from"react/jsx-runtime";import{useState as t,useEffect as a}from"react";import{useTemplateModalContext as i}from"../template-context-mapper/context/templateModalContext.js";import{TemplateCreatorHelper as o}from"./helpers/TemplateCreatorHelper.js";import{HEADER_TYPES as n}from"./models/TemplateMeta.js";import{TemplateHelperUtils as r}from"./utils/TemplateHelperUtils.js";import{WhatsappLikePreview as d}from"./WhatsApp/WhatsAppLikePreview.js";import{WhatsappLikePreviewV2 as s}from"./WhatsApp/WhatsAppLikePreviewV2.js";const p=p=>{let{template:u,extras:v,containerStyle:m,usePlaceHolderName:h,showHeader:x,zeroStateComponent:c,size:b,showSampleValues:T,carouselCardIndex:y,isWhatsappCarousel:w,isPreview:f}=p;var B,N,V,k,C,A,L,P,j,S,F,g,O,I,H,U,W,q,z,D,M,R;const{selectedCarouselIndex:E}=i(),[G,J]=t(),K=new o,Q=new r,X=[];return(null===(N=null===(B=null==G?void 0:G.ctaBtn)||void 0===B?void 0:B.phoneNumber)||void 0===N?void 0:N.isChecked)&&X.push({type:"phoneNumber",text:null!==(V=G.ctaBtn.phoneNumber.btnText)&&void 0!==V?V:"",extra:null!==(k=G.ctaBtn.phoneNumber.phoneNumber)&&void 0!==k?k:""}),(null===(A=null===(C=null==G?void 0:G.ctaBtn)||void 0===C?void 0:C.websiteLinkBtn)||void 0===A?void 0:A.isChecked)&&X.push({type:"website",text:null!==(L=G.ctaBtn.websiteLinkBtn.btnText)&&void 0!==L?L:"",extra:null!==(j=null===(P=G.ctaBtn.websiteLinkBtn)||void 0===P?void 0:P.linkOpens)&&void 0!==j?j:"",placeholder:null!==(S=G.ctaBtn.websiteLinkBtn.placeholder)&&void 0!==S?S:""}),a((()=>{u&&K.parseUITemplateFromDBFormat({dbFormattedTemplate:u,isDuplicate:!1,showSampleValues:T,isV2:!u.htmlContentUrl}).then((e=>{J(Object.assign({},e))}))}),[u,T]),a((()=>{u&&K.parseUITemplateFromDBFormat({dbFormattedTemplate:u,isDuplicate:!1,showSampleValues:T,isV2:!u.htmlContentUrl}).then((e=>{J(Object.assign({},e))}))}),[E]),u?u.htmlContentUrl?e(d,{showHeader:x,containerPadding:"large"===b?"16px 56px 12px 16px":"12px 56px 12px 12px",containerStyle:m,textType:"html",bodyText:Q.whatsappOnlyFillVariablesValueInBodyText(null!==(W=null==G?void 0:G.bodyText)&&void 0!==W?W:"",null!==(q=null==G?void 0:G.bodyVariables)&&void 0!==q?q:[],h),footerText:null==G?void 0:G.footerText,headerMediaType:(null==G?void 0:G.headerType)||n.NONE,headerText:Q.fillVariablesValInBodyText(null!==(z=null==G?void 0:G.headerText)&&void 0!==z?z:"",null!==(D=null==G?void 0:G.headerVariables)&&void 0!==D?D:[],h),headerAssetLink:null!==(M=null==G?void 0:G.headerAssetLink)&&void 0!==M?M:"",headerAssetName:null!==(R=null==G?void 0:G.headerAssetName)&&void 0!==R?R:"",quickReplybtn:null==G?void 0:G.quickReply,ctaBtn:X,actionTypes:null==G?void 0:G.actionsType,extras:v,hidePreviewText:!0,imagePreviewStyles:{objectFit:"cover"},zeroStateComponent:null!=c?c:e(l,{children:" "}),isPreview:f}):e(s,{showHeader:x,containerPadding:"large"===b?"16px 56px 12px 16px":"12px 56px 12px 12px",containerStyle:m,textType:"html",bodyText:null==G?void 0:G.bodyText,footerText:null==G?void 0:G.footerText,headerMediaType:(null==G?void 0:G.headerType)||n.NONE,headerText:null==G?void 0:G.headerText,headerAssetLink:null!==(F=null==G?void 0:G.headerAssetLink)&&void 0!==F?F:"",headerAssetName:null!==(g=null==G?void 0:G.headerAssetName)&&void 0!==g?g:"",quickReplybtn:null==G?void 0:G.quickReply,ctaBtn:X,actionTypes:null==G?void 0:G.actionsType,extras:v,hidePreviewText:!0,imagePreviewStyles:{objectFit:"cover"},carouselCardIndex:y,zeroStateComponent:null!=c?c:e(l,{children:" "}),bodyVariableList:null!==(I=null===(O=null==G?void 0:G.bodyVariables)||void 0===O?void 0:O.map((e=>{var l;return{placeholder:e.variableName,value:null!==(l=e.variableVal)&&void 0!==l?l:e.variableName}})))&&void 0!==I?I:[],headerVariableList:null!==(U=null===(H=null==G?void 0:G.headerVariables)||void 0===H?void 0:H.map((e=>{var l;return{placeholder:e.variableName,value:null!==(l=e.variableVal)&&void 0!==l?l:e.variableName}})))&&void 0!==U?U:[],buttons:null==G?void 0:G.allButtons,limitedTimeOfferComponent:null==G?void 0:G.limitedTimeOfferComponent,isWhatsappCarousel:w,isPreview:f}):e(l,{children:c})};export{p as default};
|
|
@@ -188,6 +188,7 @@ export type WhatsappLikePreviewTypes = {
|
|
|
188
188
|
buttons?: WhatsappPreviewButtonType[];
|
|
189
189
|
limitedTimeOfferComponent?: CreateTemplateType['limitedTimeOfferComponent'];
|
|
190
190
|
isWhatsappCarousel?: boolean;
|
|
191
|
+
isPreview?: boolean;
|
|
191
192
|
};
|
|
192
193
|
export type WhatsappPreviewButtonType = {
|
|
193
194
|
type: WhatsappTemplateButtonTypes;
|