@bikdotai/bik-component-library 0.0.800-beta.0 → 0.0.800-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,19 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/chevronDownOutline.svg.js"),r=require("../../../assets/icons/copy-code-icon.svg.js"),s=require("../../../assets/icons/halfRectangle.svg.js"),i=require("../../../assets/icons/phone.svg.js"),a=require("../../../assets/icons/qrb.svg.js"),o=require("../../../assets/icons/user_icon.svg.js"),l=require("../../../assets/icons/RedirectToNew.svg.js"),n=require("styled-components"),d=require("../../template-context-mapper/context/templateModalContext.js"),p=require("../../tooltips/Tooltip.js"),u=require("../../TypographyStyle.js"),c=require("../../../constants/Theme.js"),x=require("../helpers/VariableEditorHelper.js"),h=require("../models/TemplateMeta.js"),m=require("./ChatBtn.js"),j=require("./ChatUI.style.js"),T=require("./LimitedTimeOffer/LimitedTimeOffer.index.js"),C=require("./MediaCard.js");function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=f(n);const y=g.default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/chevronDownOutline.svg.js"),r=require("../../../assets/icons/copy-code-icon.svg.js"),s=require("../../../assets/icons/halfRectangle.svg.js"),i=require("../../../assets/icons/phone.svg.js"),a=require("../../../assets/icons/qrb.svg.js"),o=require("../../../assets/icons/RedirectToNew.svg.js"),l=require("styled-components"),n=require("../../template-context-mapper/context/templateModalContext.js"),d=require("../../tooltips/Tooltip.js"),p=require("../../TypographyStyle.js"),u=require("../../../constants/Theme.js"),x=require("../helpers/VariableEditorHelper.js"),c=require("../models/TemplateMeta.js"),h=require("./ChatBtn.js"),m=require("./ChatUI.style.js"),j=require("./LimitedTimeOffer/LimitedTimeOffer.index.js"),T=require("./MediaCard.js");function C(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=C(l);const y=f.default.div`
2
2
  position: absolute;
3
3
  width: 8px;
4
4
  height: 8px;
5
5
  left: -7.7px;
6
6
  top: -8px;
7
- `,E=g.default.div`
7
+ `,g=f.default.div`
8
8
  font-family: 'Inter';
9
9
  font-style: normal;
10
10
  font-weight: 400;
11
11
  font-size: 14px;
12
12
  line-height: 20px;
13
13
  padding: 8px 12px 0px;
14
- color: ${c.COLORS.content.primary};
14
+ color: ${u.COLORS.content.primary};
15
15
  word-wrap: break-word;
16
- `,v=g.default(E)`
16
+ `,E=f.default(g)`
17
17
  font-weight: 600;
18
18
  margin-bottom: 8px;
19
- `,O=new x.VariableEditorHelper;exports.ChatUIV2=n=>{const{bodyText:c,footerText:x,headerMediaType:f,headerText:g,headerAssetLink:_,headerAssetName:I,quickReplybtn:S,ctaBtn:q,actionTypes:L,extras:P,showHeader:b,imagePreviewStyles:w,size:A,bodyVariableList:N,headerVariableList:R,buttons:M,limitedTimeOfferComponent:H,carouselCardIndex:B,isWhatsappCarousel:Y,isPreview:F,children:D,hideFooter:U=!1}=n,V=O.format(null==c?void 0:c.replace(/</g,"&lt;").replace(/>/g,"&gt;"),N),k=O.format(null==g?void 0:g.replace(/</g,"&lt;").replace(/>/g,"&gt;"),R),{selectedCarouselIndex:z,isProductCarouselType:Q,errorIndexes:W,isCarouselHovered:K}=d.useTemplateModalContext(),G={COPY_CODE:r.default,PHONE_NUMBER:i.default,URL:l.default,QUICK_REPLY:a.default,VOICE_CALL:i.default,CALL_PERMISSION:t.default,REQUEST_CONTACT_INFO:o.default};return e.jsxs(j.Container,Object.assign({isCarouselCard:null!=B&&B>-1,showBorder:null!=B&&B===z||Q&&null!=B&&B>-1&&null!=z&&z>-1,hasError:null==W?void 0:W.includes(null!=B?B:-2),isWhatsappCarousel:Y,isPreview:F,showDashedBorder:Q&&K&&(null!=z?z:-1)<0&&(null!=B?B:-1)>-1},{children:[!Y&&e.jsx(y,{children:e.jsx(s.default,{color:"white",height:8,width:8})}),f===h.HEADER_TYPES.TEXT?e.jsx(v,{dangerouslySetInnerHTML:{__html:k}}):f!==h.HEADER_TYPES.NONE?e.jsx(C.MediaCard,{headerAssetLink:_,headerAssetName:I,mediaType:f,imagePreviewStyles:f===h.HEADER_TYPES.IMAGE?w:{}}):e.jsx(e.Fragment,{}),(null==H?void 0:H.dateTime)?e.jsx(T.LimitedTimeOffer,{text:H.text,dateTime:H.dateTime,code:H.code}):e.jsx(e.Fragment,{}),!!c&&e.jsx(e.Fragment,{children:e.jsx(E,{dangerouslySetInnerHTML:{__html:V},style:{flex:1}})}),D,!U&&e.jsxs(j.FooterWrapper,{children:[e.jsx(p.Tooltip,Object.assign({body:null!=x?x:"",placement:"top"},{children:e.jsx(j.FooterText,Object.assign({style:{flex:1}},{children:x}))})),e.jsx(j.TimeStamp,{children:"16:48"})]}),M&&M.length>0?M.map(((t,r)=>e.jsx(m.ChatBtn,{text:"COPY_CODE"===t.type?"Copy code":t.text,Icon:G[t.type],size:A,iconPosition:"CALL_PERMISSION"===t.type?"right":"left",textTypography:"CALL_PERMISSION"===t.type?u.TitleSmall:void 0},r))):L===h.ACTIONS_TYPES.QUICK_REPLY?e.jsx("div",{children:null==S?void 0:S.map(((t,r)=>e.jsx(m.ChatBtn,{text:t.text},r)))}):L===h.ACTIONS_TYPES.CTA_BTN?e.jsx("div",{children:null==q?void 0:q.map(((t,r)=>e.jsx(m.ChatBtn,{textTypography:b?u.Caption:u.BodySecondary,extraContent:P?t.extra:void 0,placeholder:t.placeholder,text:t.text,Icon:"phoneNumber"===t.type?i.default:l.default,size:A},r)))}):e.jsx(e.Fragment,{})]}))},exports.HtmlContainer=E;
19
+ `,v=new x.VariableEditorHelper;exports.ChatUIV2=l=>{const{bodyText:u,footerText:x,headerMediaType:C,headerText:f,headerAssetLink:O,headerAssetName:I,quickReplybtn:S,ctaBtn:_,actionTypes:L,extras:q,showHeader:P,imagePreviewStyles:b,size:w,bodyVariableList:A,headerVariableList:N,buttons:R,limitedTimeOfferComponent:M,carouselCardIndex:H,isWhatsappCarousel:B,isPreview:Y,children:F,hideFooter:D=!1}=l,U=v.format(null==u?void 0:u.replace(/</g,"&lt;").replace(/>/g,"&gt;"),A),V=v.format(null==f?void 0:f.replace(/</g,"&lt;").replace(/>/g,"&gt;"),N),{selectedCarouselIndex:k,isProductCarouselType:z,errorIndexes:Q,isCarouselHovered:W}=n.useTemplateModalContext(),K={COPY_CODE:r.default,PHONE_NUMBER:i.default,URL:o.default,QUICK_REPLY:a.default,VOICE_CALL:i.default,CALL_PERMISSION:t.default,REQUEST_CONTACT_INFO:void 0};return e.jsxs(m.Container,Object.assign({isCarouselCard:null!=H&&H>-1,showBorder:null!=H&&H===k||z&&null!=H&&H>-1&&null!=k&&k>-1,hasError:null==Q?void 0:Q.includes(null!=H?H:-2),isWhatsappCarousel:B,isPreview:Y,showDashedBorder:z&&W&&(null!=k?k:-1)<0&&(null!=H?H:-1)>-1},{children:[!B&&e.jsx(y,{children:e.jsx(s.default,{color:"white",height:8,width:8})}),C===c.HEADER_TYPES.TEXT?e.jsx(E,{dangerouslySetInnerHTML:{__html:V}}):C!==c.HEADER_TYPES.NONE?e.jsx(T.MediaCard,{headerAssetLink:O,headerAssetName:I,mediaType:C,imagePreviewStyles:C===c.HEADER_TYPES.IMAGE?b:{}}):e.jsx(e.Fragment,{}),(null==M?void 0:M.dateTime)?e.jsx(j.LimitedTimeOffer,{text:M.text,dateTime:M.dateTime,code:M.code}):e.jsx(e.Fragment,{}),!!u&&e.jsx(e.Fragment,{children:e.jsx(g,{dangerouslySetInnerHTML:{__html:U},style:{flex:1}})}),F,!D&&e.jsxs(m.FooterWrapper,{children:[e.jsx(d.Tooltip,Object.assign({body:null!=x?x:"",placement:"top"},{children:e.jsx(m.FooterText,Object.assign({style:{flex:1}},{children:x}))})),e.jsx(m.TimeStamp,{children:"16:48"})]}),R&&R.length>0?R.map(((t,r)=>e.jsx(h.ChatBtn,{text:"COPY_CODE"===t.type?"Copy code":t.text,Icon:K[t.type],size:w,iconPosition:"CALL_PERMISSION"===t.type?"right":"left",textTypography:"CALL_PERMISSION"===t.type?p.TitleSmall:void 0},r))):L===c.ACTIONS_TYPES.QUICK_REPLY?e.jsx("div",{children:null==S?void 0:S.map(((t,r)=>e.jsx(h.ChatBtn,{text:t.text},r)))}):L===c.ACTIONS_TYPES.CTA_BTN?e.jsx("div",{children:null==_?void 0:_.map(((t,r)=>e.jsx(h.ChatBtn,{textTypography:P?p.Caption:p.BodySecondary,extraContent:q?t.extra:void 0,placeholder:t.placeholder,text:t.text,Icon:"phoneNumber"===t.type?i.default:o.default,size:w},r)))}):e.jsx(e.Fragment,{})]}))},exports.HtmlContainer=g;
@@ -1,19 +1,19 @@
1
- import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import r from"../../../assets/icons/chevronDownOutline.svg.js";import i from"../../../assets/icons/copy-code-icon.svg.js";import s from"../../../assets/icons/halfRectangle.svg.js";import l from"../../../assets/icons/phone.svg.js";import n from"../../../assets/icons/qrb.svg.js";import a from"../../../assets/icons/user_icon.svg.js";import p from"../../../assets/icons/RedirectToNew.svg.js";import d from"styled-components";import{useTemplateModalContext as m}from"../../template-context-mapper/context/templateModalContext.js";import{Tooltip as c}from"../../tooltips/Tooltip.js";import{TitleSmall as h,Caption as f,BodySecondary as x}from"../../TypographyStyle.js";import{COLORS as g}from"../../../constants/Theme.js";import{VariableEditorHelper as u}from"../helpers/VariableEditorHelper.js";import{HEADER_TYPES as y,ACTIONS_TYPES as C}from"../models/TemplateMeta.js";import{ChatBtn as T}from"./ChatBtn.js";import{Container as v,FooterWrapper as j,FooterText as I,TimeStamp as L}from"./ChatUI.style.js";import{LimitedTimeOffer as O}from"./LimitedTimeOffer/LimitedTimeOffer.index.js";import{MediaCard as w}from"./MediaCard.js";const E=d.div`
1
+ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import r from"../../../assets/icons/chevronDownOutline.svg.js";import i from"../../../assets/icons/copy-code-icon.svg.js";import s from"../../../assets/icons/halfRectangle.svg.js";import l from"../../../assets/icons/phone.svg.js";import n from"../../../assets/icons/qrb.svg.js";import a from"../../../assets/icons/RedirectToNew.svg.js";import p from"styled-components";import{useTemplateModalContext as d}from"../../template-context-mapper/context/templateModalContext.js";import{Tooltip as m}from"../../tooltips/Tooltip.js";import{TitleSmall as c,Caption as h,BodySecondary as f}from"../../TypographyStyle.js";import{COLORS as x}from"../../../constants/Theme.js";import{VariableEditorHelper as y}from"../helpers/VariableEditorHelper.js";import{HEADER_TYPES as g,ACTIONS_TYPES as u}from"../models/TemplateMeta.js";import{ChatBtn as C}from"./ChatBtn.js";import{Container as T,FooterWrapper as v,FooterText as j,TimeStamp as I}from"./ChatUI.style.js";import{LimitedTimeOffer as L}from"./LimitedTimeOffer/LimitedTimeOffer.index.js";import{MediaCard as O}from"./MediaCard.js";const w=p.div`
2
2
  position: absolute;
3
3
  width: 8px;
4
4
  height: 8px;
5
5
  left: -7.7px;
6
6
  top: -8px;
7
- `,_=d.div`
7
+ `,E=p.div`
8
8
  font-family: 'Inter';
9
9
  font-style: normal;
10
10
  font-weight: 400;
11
11
  font-size: 14px;
12
12
  line-height: 20px;
13
13
  padding: 8px 12px 0px;
14
- color: ${g.content.primary};
14
+ color: ${x.content.primary};
15
15
  word-wrap: break-word;
16
- `,b=d(_)`
16
+ `,b=p(E)`
17
17
  font-weight: 600;
18
18
  margin-bottom: 8px;
19
- `,N=new u,P=d=>{const{bodyText:g,footerText:u,headerMediaType:P,headerText:S,headerAssetLink:A,headerAssetName:M,quickReplybtn:R,ctaBtn:B,actionTypes:H,extras:U,showHeader:k,imagePreviewStyles:z,size:D,bodyVariableList:V,headerVariableList:Y,buttons:Q,limitedTimeOfferComponent:q,carouselCardIndex:F,isWhatsappCarousel:K,isPreview:W,children:G,hideFooter:X=!1}=d,$=N.format(null==g?void 0:g.replace(/</g,"&lt;").replace(/>/g,"&gt;"),V),J=N.format(null==S?void 0:S.replace(/</g,"&lt;").replace(/>/g,"&gt;"),Y),{selectedCarouselIndex:Z,isProductCarouselType:ee,errorIndexes:te,isCarouselHovered:oe}=m(),re={COPY_CODE:i,PHONE_NUMBER:l,URL:p,QUICK_REPLY:n,VOICE_CALL:l,CALL_PERMISSION:r,REQUEST_CONTACT_INFO:a};return e(v,Object.assign({isCarouselCard:null!=F&&F>-1,showBorder:null!=F&&F===Z||ee&&null!=F&&F>-1&&null!=Z&&Z>-1,hasError:null==te?void 0:te.includes(null!=F?F:-2),isWhatsappCarousel:K,isPreview:W,showDashedBorder:ee&&oe&&(null!=Z?Z:-1)<0&&(null!=F?F:-1)>-1},{children:[!K&&t(E,{children:t(s,{color:"white",height:8,width:8})}),P===y.TEXT?t(b,{dangerouslySetInnerHTML:{__html:J}}):P!==y.NONE?t(w,{headerAssetLink:A,headerAssetName:M,mediaType:P,imagePreviewStyles:P===y.IMAGE?z:{}}):t(o,{}),(null==q?void 0:q.dateTime)?t(O,{text:q.text,dateTime:q.dateTime,code:q.code}):t(o,{}),!!g&&t(o,{children:t(_,{dangerouslySetInnerHTML:{__html:$},style:{flex:1}})}),G,!X&&e(j,{children:[t(c,Object.assign({body:null!=u?u:"",placement:"top"},{children:t(I,Object.assign({style:{flex:1}},{children:u}))})),t(L,{children:"16:48"})]}),Q&&Q.length>0?Q.map(((e,o)=>t(T,{text:"COPY_CODE"===e.type?"Copy code":e.text,Icon:re[e.type],size:D,iconPosition:"CALL_PERMISSION"===e.type?"right":"left",textTypography:"CALL_PERMISSION"===e.type?h:void 0},o))):H===C.QUICK_REPLY?t("div",{children:null==R?void 0:R.map(((e,o)=>t(T,{text:e.text},o)))}):H===C.CTA_BTN?t("div",{children:null==B?void 0:B.map(((e,o)=>t(T,{textTypography:k?f:x,extraContent:U?e.extra:void 0,placeholder:e.placeholder,text:e.text,Icon:"phoneNumber"===e.type?l:p,size:D},o)))}):t(o,{})]}))};export{P as ChatUIV2,_ as HtmlContainer};
19
+ `,_=new y,N=p=>{const{bodyText:x,footerText:y,headerMediaType:N,headerText:P,headerAssetLink:S,headerAssetName:A,quickReplybtn:M,ctaBtn:R,actionTypes:B,extras:H,showHeader:U,imagePreviewStyles:k,size:z,bodyVariableList:D,headerVariableList:V,buttons:Y,limitedTimeOfferComponent:Q,carouselCardIndex:q,isWhatsappCarousel:F,isPreview:K,children:W,hideFooter:G=!1}=p,X=_.format(null==x?void 0:x.replace(/</g,"&lt;").replace(/>/g,"&gt;"),D),$=_.format(null==P?void 0:P.replace(/</g,"&lt;").replace(/>/g,"&gt;"),V),{selectedCarouselIndex:J,isProductCarouselType:Z,errorIndexes:ee,isCarouselHovered:te}=d(),oe={COPY_CODE:i,PHONE_NUMBER:l,URL:a,QUICK_REPLY:n,VOICE_CALL:l,CALL_PERMISSION:r,REQUEST_CONTACT_INFO:void 0};return e(T,Object.assign({isCarouselCard:null!=q&&q>-1,showBorder:null!=q&&q===J||Z&&null!=q&&q>-1&&null!=J&&J>-1,hasError:null==ee?void 0:ee.includes(null!=q?q:-2),isWhatsappCarousel:F,isPreview:K,showDashedBorder:Z&&te&&(null!=J?J:-1)<0&&(null!=q?q:-1)>-1},{children:[!F&&t(w,{children:t(s,{color:"white",height:8,width:8})}),N===g.TEXT?t(b,{dangerouslySetInnerHTML:{__html:$}}):N!==g.NONE?t(O,{headerAssetLink:S,headerAssetName:A,mediaType:N,imagePreviewStyles:N===g.IMAGE?k:{}}):t(o,{}),(null==Q?void 0:Q.dateTime)?t(L,{text:Q.text,dateTime:Q.dateTime,code:Q.code}):t(o,{}),!!x&&t(o,{children:t(E,{dangerouslySetInnerHTML:{__html:X},style:{flex:1}})}),W,!G&&e(v,{children:[t(m,Object.assign({body:null!=y?y:"",placement:"top"},{children:t(j,Object.assign({style:{flex:1}},{children:y}))})),t(I,{children:"16:48"})]}),Y&&Y.length>0?Y.map(((e,o)=>t(C,{text:"COPY_CODE"===e.type?"Copy code":e.text,Icon:oe[e.type],size:z,iconPosition:"CALL_PERMISSION"===e.type?"right":"left",textTypography:"CALL_PERMISSION"===e.type?c:void 0},o))):B===u.QUICK_REPLY?t("div",{children:null==M?void 0:M.map(((e,o)=>t(C,{text:e.text},o)))}):B===u.CTA_BTN?t("div",{children:null==R?void 0:R.map(((e,o)=>t(C,{textTypography:U?h:f,extraContent:H?e.extra:void 0,placeholder:e.placeholder,text:e.text,Icon:"phoneNumber"===e.type?l:a,size:z},o)))}):t(o,{})]}))};export{N as ChatUIV2,E as HtmlContainer};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.800-beta.0",
3
+ "version": "0.0.800-beta.1",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",