@bikdotai/bik-component-library 0.0.647--beta--analytics0.1 → 0.0.647--beta--analytics0.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../template-context-mapper/context/templateModalContext.js"),t=require("../helpers/VariableEditorHelper.js"),a=require("../models/TemplateMeta.js"),s=require("./RCSButtons.js"),l=require("./RCSMediaCard.js"),i=require("./RCSPreview.styled.js");const n=new t.VariableEditorHelper;exports.RCSChatPreview=t=>{const{bodyText:d,titleText:o,headerMediaType:u,headerText:x,headerAssetLink:p,headerAssetName:C,imagePreviewStyles:m,size:h,bodyVariableList:T,headerVariableList:c,buttons:g,carouselCardIndex:E,isWhatsappCarousel:j,isPreview:S,titleVariableList:y}=t,M=n.format(null==d?void 0:d.replace(/</g,"&lt;").replace(/>/g,"&gt;"),T),P=n.format(null==x?void 0:x.replace(/</g,"&lt;").replace(/>/g,"&gt;"),c),v=n.format(null==o?void 0:o.replace(/</g,"&lt;").replace(/>/g,"&gt;"),y),{selectedCarouselIndex:H,isProductCarouselType:R,errorIndexes:_,isCarouselHovered:A}=r.useTemplateModalContext();return e.jsxs(i.RCSPreviewContainer,Object.assign({isCarouselCard:null!=E&&E>-1,showBorder:null!=E&&E===H||R&&null!=E&&E>-1&&null!=H&&H>-1,hasError:null==_?void 0:_.includes(null!=E?E:-2),isWhatsappCarousel:j,isPreview:S,showDashedBorder:R&&A&&(null!=H?H:-1)<0&&(null!=E?E:-1)>-1},{children:[u===a.HEADER_TYPES.TEXT?e.jsx(i.HeaderTextContainer,{dangerouslySetInnerHTML:{__html:P}}):u!==a.HEADER_TYPES.NONE&&p&&u!==a.HEADER_TYPES.DOCUMENT?e.jsx(l.RCSMediaCard,{headerAssetLink:p||"",headerAssetName:C,mediaType:u,imagePreviewStyles:u===a.HEADER_TYPES.IMAGE?m:{}}):e.jsx(e.Fragment,{}),!!o&&e.jsx(e.Fragment,{children:e.jsx(i.TitleTextContainer,{dangerouslySetInnerHTML:{__html:v},style:{flex:1}})}),!!d&&e.jsx(e.Fragment,{children:e.jsx(i.RcsHtmlContainer,{dangerouslySetInnerHTML:{__html:M},style:{flex:1,paddingTop:o?0:12}})}),u===a.HEADER_TYPES.DOCUMENT?e.jsx(l.PdfMediaCard,Object.assign({},{headerAssetLink:p,headerAssetName:C,headerMediaType:u})):e.jsx(e.Fragment,{}),g&&g.length>0?g.map(((r,t)=>e.jsx(s.RCSButtons,{text:r.text,size:h},t))):e.jsx(e.Fragment,{})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../template-context-mapper/context/templateModalContext.js"),t=require("../helpers/VariableEditorHelper.js"),a=require("../models/TemplateMeta.js"),s=require("./RCSButtons.js"),l=require("./RCSMediaCard.js"),i=require("./RCSPreview.styled.js");const n=new t.VariableEditorHelper;exports.RCSChatPreview=t=>{const{bodyText:d,titleText:o,headerMediaType:u,headerText:p,headerAssetLink:x,headerAssetName:C,imagePreviewStyles:m,size:h,bodyVariableList:T,headerVariableList:c,buttons:g,carouselCardIndex:E,isWhatsappCarousel:j,isPreview:S,titleVariableList:M}=t,P=n.format(null==d?void 0:d.replace(/</g,"&lt;").replace(/>/g,"&gt;"),T),v=n.format(null==p?void 0:p.replace(/</g,"&lt;").replace(/>/g,"&gt;"),c),y=n.format(null==o?void 0:o.replace(/</g,"&lt;").replace(/>/g,"&gt;"),M),{selectedCarouselIndex:H,isProductCarouselType:R,errorIndexes:_,isCarouselHovered:A}=r.useTemplateModalContext();return e.jsxs(i.RCSPreviewContainer,Object.assign({isCarouselCard:null!=E&&E>-1,showBorder:null!=E&&E===H||R&&null!=E&&E>-1&&null!=H&&H>-1,hasError:null==_?void 0:_.includes(null!=E?E:-2),isWhatsappCarousel:j,isPreview:S,showDashedBorder:R&&A&&(null!=H?H:-1)<0&&(null!=E?E:-1)>-1},{children:[u===a.HEADER_TYPES.TEXT?e.jsx(i.HeaderTextContainer,{dangerouslySetInnerHTML:{__html:v}}):u!==a.HEADER_TYPES.NONE&&x&&u!==a.HEADER_TYPES.DOCUMENT?e.jsx(l.RCSMediaCard,{headerAssetLink:x||"",headerAssetName:C,mediaType:u,imagePreviewStyles:u===a.HEADER_TYPES.IMAGE?m:{}}):e.jsx(e.Fragment,{}),!!o&&e.jsx(e.Fragment,{children:e.jsx(i.TitleTextContainer,{dangerouslySetInnerHTML:{__html:y}})}),!!d&&e.jsx(e.Fragment,{children:e.jsx(i.RcsHtmlContainer,{dangerouslySetInnerHTML:{__html:P},style:{paddingTop:o?0:12}})}),u===a.HEADER_TYPES.DOCUMENT?e.jsx(l.PdfMediaCard,Object.assign({},{headerAssetLink:x,headerAssetName:C,headerMediaType:u})):e.jsx(e.Fragment,{}),g&&g.length>0?g.map(((r,t)=>e.jsx(s.RCSButtons,{text:r.text,size:h},t))):e.jsx(e.Fragment,{})]}))};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{useTemplateModalContext as l}from"../../template-context-mapper/context/templateModalContext.js";import{VariableEditorHelper as a}from"../helpers/VariableEditorHelper.js";import{HEADER_TYPES as s}from"../models/TemplateMeta.js";import{RCSButtons as o}from"./RCSButtons.js";import{RCSMediaCard as i,PdfMediaCard as d}from"./RCSMediaCard.js";import{RCSPreviewContainer as n,HeaderTextContainer as m,TitleTextContainer as p,RcsHtmlContainer as u}from"./RCSPreview.styled.js";const h=new a,c=a=>{const{bodyText:c,titleText:g,headerMediaType:T,headerText:x,headerAssetLink:C,headerAssetName:y,imagePreviewStyles:f,size:M,bodyVariableList:v,headerVariableList:b,buttons:j,carouselCardIndex:L,isWhatsappCarousel:w,isPreview:S,titleVariableList:A}=a,E=h.format(null==c?void 0:c.replace(/</g,"&lt;").replace(/>/g,"&gt;"),v),I=h.format(null==x?void 0:x.replace(/</g,"&lt;").replace(/>/g,"&gt;"),b),N=h.format(null==g?void 0:g.replace(/</g,"&lt;").replace(/>/g,"&gt;"),A),{selectedCarouselIndex:P,isProductCarouselType:_,errorIndexes:H,isCarouselHovered:O}=l();return e(n,Object.assign({isCarouselCard:null!=L&&L>-1,showBorder:null!=L&&L===P||_&&null!=L&&L>-1&&null!=P&&P>-1,hasError:null==H?void 0:H.includes(null!=L?L:-2),isWhatsappCarousel:w,isPreview:S,showDashedBorder:_&&O&&(null!=P?P:-1)<0&&(null!=L?L:-1)>-1},{children:[T===s.TEXT?r(m,{dangerouslySetInnerHTML:{__html:I}}):T!==s.NONE&&C&&T!==s.DOCUMENT?r(i,{headerAssetLink:C||"",headerAssetName:y,mediaType:T,imagePreviewStyles:T===s.IMAGE?f:{}}):r(t,{}),!!g&&r(t,{children:r(p,{dangerouslySetInnerHTML:{__html:N},style:{flex:1}})}),!!c&&r(t,{children:r(u,{dangerouslySetInnerHTML:{__html:E},style:{flex:1,paddingTop:g?0:12}})}),T===s.DOCUMENT?r(d,Object.assign({},{headerAssetLink:C,headerAssetName:y,headerMediaType:T})):r(t,{}),j&&j.length>0?j.map(((e,t)=>r(o,{text:e.text,size:M},t))):r(t,{})]}))};export{c as RCSChatPreview};
1
+ import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{useTemplateModalContext as l}from"../../template-context-mapper/context/templateModalContext.js";import{VariableEditorHelper as a}from"../helpers/VariableEditorHelper.js";import{HEADER_TYPES as s}from"../models/TemplateMeta.js";import{RCSButtons as o}from"./RCSButtons.js";import{RCSMediaCard as i,PdfMediaCard as d}from"./RCSMediaCard.js";import{RCSPreviewContainer as n,HeaderTextContainer as m,TitleTextContainer as p,RcsHtmlContainer as u}from"./RCSPreview.styled.js";const h=new a,c=a=>{const{bodyText:c,titleText:g,headerMediaType:T,headerText:C,headerAssetLink:x,headerAssetName:y,imagePreviewStyles:M,size:f,bodyVariableList:v,headerVariableList:b,buttons:j,carouselCardIndex:L,isWhatsappCarousel:w,isPreview:S,titleVariableList:A}=a,E=h.format(null==c?void 0:c.replace(/</g,"&lt;").replace(/>/g,"&gt;"),v),I=h.format(null==C?void 0:C.replace(/</g,"&lt;").replace(/>/g,"&gt;"),b),N=h.format(null==g?void 0:g.replace(/</g,"&lt;").replace(/>/g,"&gt;"),A),{selectedCarouselIndex:P,isProductCarouselType:_,errorIndexes:H,isCarouselHovered:O}=l();return e(n,Object.assign({isCarouselCard:null!=L&&L>-1,showBorder:null!=L&&L===P||_&&null!=L&&L>-1&&null!=P&&P>-1,hasError:null==H?void 0:H.includes(null!=L?L:-2),isWhatsappCarousel:w,isPreview:S,showDashedBorder:_&&O&&(null!=P?P:-1)<0&&(null!=L?L:-1)>-1},{children:[T===s.TEXT?r(m,{dangerouslySetInnerHTML:{__html:I}}):T!==s.NONE&&x&&T!==s.DOCUMENT?r(i,{headerAssetLink:x||"",headerAssetName:y,mediaType:T,imagePreviewStyles:T===s.IMAGE?M:{}}):r(t,{}),!!g&&r(t,{children:r(p,{dangerouslySetInnerHTML:{__html:N}})}),!!c&&r(t,{children:r(u,{dangerouslySetInnerHTML:{__html:E},style:{paddingTop:g?0:12}})}),T===s.DOCUMENT?r(d,Object.assign({},{headerAssetLink:x,headerAssetName:y,headerMediaType:T})):r(t,{}),j&&j.length>0?j.map(((e,t)=>r(o,{text:e.text,size:f},t))):r(t,{})]}))};export{c as RCSChatPreview};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.647--beta--analytics0.1",
3
+ "version": "0.0.647--beta--analytics0.2",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",