@bikdotai/bik-component-library 0.0.530-beta0.rt14 → 0.0.530-beta0.rt16

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.
@@ -4,5 +4,6 @@ declare const RenderVariableUIForPreview: React.FC<{
4
4
  content: string;
5
5
  variablStore?: CUSTOM_VARIABLE[];
6
6
  brandColor?: string;
7
+ uniqueId?: string;
7
8
  }>;
8
9
  export default RenderVariableUIForPreview;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../constants/Theme.js"),t=require("./constants/regexPatterns.js");exports.default=a=>{let{content:n,variablStore:s,brandColor:l=r.COLORS.content.brand}=a;const o=(null==s?void 0:s.length)?s.map((e=>e.updatedValue)):n.match(t.variablePatternGlobal)||[];return t.variablePatternGlobal.lastIndex=0,e.jsx(e.Fragment,{children:n.split(t.variablePattern).map(((r,t)=>o[t]?e.jsxs("span",{children:[r,e.jsx("span",Object.assign({id:`connectors_variable_${t+1}`,style:{color:l,textDecoration:"underline",wordBreak:"break-word"}},{children:o[t]})),e.jsx("span",{children:" "})]},t):e.jsx("span",{children:r},t)))})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../constants/Theme.js"),n=require("./constants/regexPatterns.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(r);exports.default=r=>{let{content:a,variablStore:l,brandColor:o=t.COLORS.content.brand,uniqueId:i}=r;const u=s.default.useMemo((()=>{if(null==l?void 0:l.length)return l.map((e=>e.updatedValue));{const e=a.match(n.variablePatternGlobal)||[];return n.variablePatternGlobal.lastIndex=0,e}}),[a,l]);return e.jsx(e.Fragment,{children:a.split(n.variablePattern).map(((r,t)=>u[t]?e.jsxs("span",{children:[r,e.jsx("span",Object.assign({id:`${i||""}connectors_variable_${t+1}`,style:{color:o,textDecoration:"underline",wordBreak:"break-word"}},{children:u[t]})),e.jsx("span",{children:" "})]},t):e.jsx("span",{children:r},t)))})};
@@ -8,5 +8,6 @@ declare const SmsTemplatePreview: React.FC<{
8
8
  onlyTemplateContent?: boolean;
9
9
  display_content?: string;
10
10
  size?: 'small' | 'large';
11
+ uniqueId?: string;
11
12
  }>;
12
13
  export default SmsTemplatePreview;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),r=require("../../assets/icons/more_vertical.svg.js"),l=require("../../assets/icons/search.svg.js"),s=require("../../constants/Theme.js"),n=require("../template-context-mapper/context/templateModalContext.js"),i=require("../TypographyStyle.js"),a=require("./RenderVariableUIForPreview.js"),o=require("./SMS/SMSBubble.js"),d=require("./SmsTemplatePreview.styled.js");exports.default=c=>{let{template:u,variableStore:j,hideHeader:x,display_content:h,onlyTemplateContent:v,size:g}=c;var p,S,m;const b=null==u?void 0:u.content,{hideDeviceContainerInPreview:y,originalVariableList:f}=n.useTemplateModalContext();return console.log("templateContent in smsTemplatePreview",f),y?e.jsx(d.SMSBubbleContainer,Object.assign({size:g},{children:e.jsx(o.default,{size:null!=g?g:"large",content:null!==(p=null!=h?h:a.default({content:b,variablStore:null!=j?j:[]}))&&void 0!==p?p:e.jsx(e.Fragment,{})})})):e.jsxs(e.Fragment,{children:[!x&&!v&&e.jsx(d.SMSCardHeader,{children:e.jsx(i.TitleRegular,Object.assign({style:{maxWidth:"100%"}},{children:u.name}))}),!v&&e.jsx(d.SMSHeader,{children:e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e.jsx(t.default,{width:16,height:16,color:s.COLORS.content.secondary}),e.jsx(i.Caption,{children:null===(S=null==u?void 0:u.headers)||void 0===S?void 0:S[0]})]})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e.jsx(l.default,{width:16,height:16,color:s.COLORS.content.secondary}),e.jsx(r.default,{width:16,height:16,color:s.COLORS.content.secondary})]}))]})}),e.jsx(d.SMSBubbleContainer,Object.assign({size:g},{children:e.jsx(o.default,{size:null!=g?g:"large",content:null!==(m=null!=h?h:a.default({content:b,variablStore:null!=j?j:[]}))&&void 0!==m?m:""})}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),l=require("../../assets/icons/more_vertical.svg.js"),n=require("../../assets/icons/search.svg.js"),r=require("../../constants/Theme.js"),s=require("../template-context-mapper/context/templateModalContext.js"),i=require("../TypographyStyle.js"),a=require("./RenderVariableUIForPreview.js"),o=require("./SMS/SMSBubble.js"),d=require("./SmsTemplatePreview.styled.js");exports.default=u=>{let{template:c,variableStore:j,hideHeader:x,display_content:h,onlyTemplateContent:v,size:g,uniqueId:p}=u;var S,m,b;const y=null==c?void 0:c.content,{hideDeviceContainerInPreview:f,originalVariableList:q}=s.useTemplateModalContext();return console.log("templateContent in smsTemplatePreview",q),f?e.jsx(d.SMSBubbleContainer,Object.assign({size:g},{children:e.jsx(o.default,{size:null!=g?g:"large",content:null!==(S=null!=h?h:a.default({content:y,variablStore:null!=j?j:[],uniqueId:null!=p?p:""}))&&void 0!==S?S:e.jsx(e.Fragment,{})})})):e.jsxs(e.Fragment,{children:[!x&&!v&&e.jsx(d.SMSCardHeader,{children:e.jsx(i.TitleRegular,Object.assign({style:{maxWidth:"100%"}},{children:c.name}))}),!v&&e.jsx(d.SMSHeader,{children:e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e.jsx(t.default,{width:16,height:16,color:r.COLORS.content.secondary}),e.jsx(i.Caption,{children:null===(m=null==c?void 0:c.headers)||void 0===m?void 0:m[0]})]})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e.jsx(n.default,{width:16,height:16,color:r.COLORS.content.secondary}),e.jsx(l.default,{width:16,height:16,color:r.COLORS.content.secondary})]}))]})}),e.jsx(d.SMSBubbleContainer,Object.assign({size:g},{children:e.jsx(o.default,{size:null!=g?g:"large",content:null!==(b=null!=h?h:a.default({content:y,variablStore:null!=j?j:[],uniqueId:null!=p?p:""}))&&void 0!==b?b:""})}))]})};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("../template-context-mapper/context/templateModalContext.js"),t=require("../../utils/StringUtils.js"),a=require("../../constants/Theme.js"),i=require("../TypographyStyle.js"),n=require("./EmailTemplateThumbnailPreview.js"),r=require("./models/Channels.js"),s=require("./SmsTemplatePreview.js"),o=require("./WhatsAppTemplatePreview.js");const d={WhatsAppWrapper:{backgroundColor:a.COLORS.surface.standard,borderRadius:4,border:`1px solid ${a.COLORS.background.inactive}`,marginTop:16}};exports.TemplatePreview=p=>{let{template:u,channel:m,whatsAppSpecificMeta:c,templateCreationsInfo:v,hideHeader:h,size:j,onlyTemplateContent:C,emailSpecificMeta:g,smsSpecificMeta:S,showSampleValues:b,carouselCardIndex:x,isWhatsappCarousel:y,isPreview:T}=p;var O,w;const{setSelectedCarouselIndex:P}=l.useTemplateModalContext();return m===r.CHANNEL_TYPE.SMS?e.jsx("div",Object.assign({style:Object.assign({marginTop:v?16:0,border:v?`1px solid ${a.COLORS.stroke.primary}`:"none",borderRadius:4},null==S?void 0:S.templateContainerStyles)},{children:e.jsx(s.default,{template:u,hideHeader:h,onlyTemplateContent:C,size:null!=j?j:"large",variableStore:null==S?void 0:S.smsVariableStore,display_content:null==S?void 0:S.smsDisplayContent})})):m===r.CHANNEL_TYPE.EMAIL?e.jsx("div",Object.assign({style:Object.assign({marginTop:v?16:0},null==g?void 0:g.templateContainerStyles)},{children:e.jsx(n.default,{template:u,handleViewTemplate:()=>{var e;null===(e=null==g?void 0:g.handleViewTemplate)||void 0===e||e.call(g)},hideHeader:h,hideViewButton:null==g?void 0:g.hideViewButtonForEmail,containerStyle:null==g?void 0:g.containerStyle,emailDisplayContent:null==g?void 0:g.emailDisplayContent,emailHtmlContainerId:null==g?void 0:g.emailHtmlContainerId})})):m===r.CHANNEL_TYPE.WHATSAPP?e.jsxs("div",Object.assign({style:Object.assign(Object.assign({},null==c?void 0:c.templateContainerStyles),v?d.WhatsAppWrapper:{}),onClick:()=>{var e,l;if(P&&y){if(-1===x&&!(null===(l=null===(e=null==u?void 0:u.mapping)||void 0===e?void 0:e.body)||void 0===l?void 0:l.length))return;P(null!=x?x:-1)}}},{children:[v?e.jsx("div",Object.assign({style:{padding:16}},{children:e.jsx(i.TitleRegular,{children:t.default.convertToTitleCase(null!==(O=null==u?void 0:u.label)&&void 0!==O?O:"")})})):e.jsx(e.Fragment,{}),e.jsx(o.default,{showSampleValues:b,showHeader:null==c?void 0:c.showWhatsAppHeader,extras:null==c?void 0:c.whatsAppExtras,template:u,size:v?"small":null!=j?j:"large",containerStyle:Object.assign(Object.assign({borderWidth:v?0:1,borderTopWidth:1},null!==(w=null==c?void 0:c.containerStyle)&&void 0!==w?w:{}),{height:"100%"}),zeroStateComponent:null==c?void 0:c.zeroStateComponent,usePlaceHolderName:null==c?void 0:c.usePlaceHolderName,carouselCardIndex:x,isWhatsappCarousel:y,isPreview:T})]})):e.jsx(e.Fragment,{})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("../template-context-mapper/context/templateModalContext.js"),t=require("../../utils/StringUtils.js"),a=require("../../constants/Theme.js"),i=require("../TypographyStyle.js"),n=require("./EmailTemplateThumbnailPreview.js"),r=require("./models/Channels.js"),s=require("./SmsTemplatePreview.js"),o=require("./WhatsAppTemplatePreview.js");const d={WhatsAppWrapper:{backgroundColor:a.COLORS.surface.standard,borderRadius:4,border:`1px solid ${a.COLORS.background.inactive}`,marginTop:16}};exports.TemplatePreview=u=>{let{template:p,channel:m,whatsAppSpecificMeta:c,templateCreationsInfo:v,hideHeader:h,size:j,onlyTemplateContent:C,emailSpecificMeta:g,smsSpecificMeta:S,showSampleValues:b,carouselCardIndex:x,isWhatsappCarousel:y,isPreview:T}=u;var O,w;const{setSelectedCarouselIndex:P}=l.useTemplateModalContext();return m===r.CHANNEL_TYPE.SMS?e.jsx("div",Object.assign({style:Object.assign({marginTop:v?16:0,border:v?`1px solid ${a.COLORS.stroke.primary}`:"none",borderRadius:4},null==S?void 0:S.templateContainerStyles)},{children:e.jsx(s.default,{template:p,hideHeader:h,onlyTemplateContent:C,size:null!=j?j:"large",variableStore:null==S?void 0:S.smsVariableStore,display_content:null==S?void 0:S.smsDisplayContent,uniqueId:null==S?void 0:S.uniqueId})})):m===r.CHANNEL_TYPE.EMAIL?e.jsx("div",Object.assign({style:Object.assign({marginTop:v?16:0},null==g?void 0:g.templateContainerStyles)},{children:e.jsx(n.default,{template:p,handleViewTemplate:()=>{var e;null===(e=null==g?void 0:g.handleViewTemplate)||void 0===e||e.call(g)},hideHeader:h,hideViewButton:null==g?void 0:g.hideViewButtonForEmail,containerStyle:null==g?void 0:g.containerStyle,emailDisplayContent:null==g?void 0:g.emailDisplayContent,emailHtmlContainerId:null==g?void 0:g.emailHtmlContainerId})})):m===r.CHANNEL_TYPE.WHATSAPP?e.jsxs("div",Object.assign({style:Object.assign(Object.assign({},null==c?void 0:c.templateContainerStyles),v?d.WhatsAppWrapper:{}),onClick:()=>{var e,l;if(P&&y){if(-1===x&&!(null===(l=null===(e=null==p?void 0:p.mapping)||void 0===e?void 0:e.body)||void 0===l?void 0:l.length))return;P(null!=x?x:-1)}}},{children:[v?e.jsx("div",Object.assign({style:{padding:16}},{children:e.jsx(i.TitleRegular,{children:t.default.convertToTitleCase(null!==(O=null==p?void 0:p.label)&&void 0!==O?O:"")})})):e.jsx(e.Fragment,{}),e.jsx(o.default,{showSampleValues:b,showHeader:null==c?void 0:c.showWhatsAppHeader,extras:null==c?void 0:c.whatsAppExtras,template:p,size:v?"small":null!=j?j:"large",containerStyle:Object.assign(Object.assign({borderWidth:v?0:1,borderTopWidth:1},null!==(w=null==c?void 0:c.containerStyle)&&void 0!==w?w:{}),{height:"100%"}),zeroStateComponent:null==c?void 0:c.zeroStateComponent,usePlaceHolderName:null==c?void 0:c.usePlaceHolderName,carouselCardIndex:x,isWhatsappCarousel:y,isPreview:T})]})):e.jsx(e.Fragment,{})};
@@ -32,4 +32,5 @@ export type SMSMeta = {
32
32
  smsVariableStore?: CUSTOM_VARIABLE[];
33
33
  smsDisplayContent?: string;
34
34
  templateContainerStyles?: React.CSSProperties | undefined;
35
+ uniqueId?: string;
35
36
  };
@@ -4,5 +4,6 @@ declare const RenderVariableUIForPreview: React.FC<{
4
4
  content: string;
5
5
  variablStore?: CUSTOM_VARIABLE[];
6
6
  brandColor?: string;
7
+ uniqueId?: string;
7
8
  }>;
8
9
  export default RenderVariableUIForPreview;
@@ -1 +1 @@
1
- import{jsx as e,Fragment as n,jsxs as t}from"react/jsx-runtime";import{COLORS as r}from"../../constants/Theme.js";import{variablePatternGlobal as a,variablePattern as o}from"./constants/regexPatterns.js";const s=s=>{let{content:l,variablStore:c,brandColor:i=r.content.brand}=s;const d=(null==c?void 0:c.length)?c.map((e=>e.updatedValue)):l.match(a)||[];return a.lastIndex=0,e(n,{children:l.split(o).map(((n,r)=>d[r]?t("span",{children:[n,e("span",Object.assign({id:`connectors_variable_${r+1}`,style:{color:i,textDecoration:"underline",wordBreak:"break-word"}},{children:d[r]})),e("span",{children:" "})]},r):e("span",{children:n},r)))})};export{s as default};
1
+ import{jsx as e,Fragment as r,jsxs as t}from"react/jsx-runtime";import n from"react";import{COLORS as o}from"../../constants/Theme.js";import{variablePatternGlobal as a,variablePattern as s}from"./constants/regexPatterns.js";const c=c=>{let{content:i,variablStore:l,brandColor:d=o.content.brand,uniqueId:m}=c;const p=n.useMemo((()=>{if(null==l?void 0:l.length)return l.map((e=>e.updatedValue));{const e=i.match(a)||[];return a.lastIndex=0,e}}),[i,l]);return e(r,{children:i.split(s).map(((r,n)=>p[n]?t("span",{children:[r,e("span",Object.assign({id:`${m||""}connectors_variable_${n+1}`,style:{color:d,textDecoration:"underline",wordBreak:"break-word"}},{children:p[n]})),e("span",{children:" "})]},n):e("span",{children:r},n)))})};export{c as default};
@@ -8,5 +8,6 @@ declare const SmsTemplatePreview: React.FC<{
8
8
  onlyTemplateContent?: boolean;
9
9
  display_content?: string;
10
10
  size?: 'small' | 'large';
11
+ uniqueId?: string;
11
12
  }>;
12
13
  export default SmsTemplatePreview;
@@ -1 +1 @@
1
- import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import n from"../../assets/icons/arrow_left.svg.js";import o from"../../assets/icons/more_vertical.svg.js";import r from"../../assets/icons/search.svg.js";import{COLORS as l}from"../../constants/Theme.js";import{useTemplateModalContext as s}from"../template-context-mapper/context/templateModalContext.js";import{TitleRegular as a,Caption as c}from"../TypographyStyle.js";import d from"./RenderVariableUIForPreview.js";import m from"./SMS/SMSBubble.js";import{SMSBubbleContainer as p,SMSCardHeader as h,SMSHeader as v}from"./SmsTemplatePreview.styled.js";const g=g=>{let{template:f,variableStore:j,hideHeader:u,display_content:y,onlyTemplateContent:b,size:w}=g;var x,S,z;const O=null==f?void 0:f.content,{hideDeviceContainerInPreview:T,originalVariableList:C}=s();return console.log("templateContent in smsTemplatePreview",C),T?e(p,Object.assign({size:w},{children:e(m,{size:null!=w?w:"large",content:null!==(x=null!=y?y:d({content:O,variablStore:null!=j?j:[]}))&&void 0!==x?x:e(t,{})})})):i(t,{children:[!u&&!b&&e(h,{children:e(a,Object.assign({style:{maxWidth:"100%"}},{children:f.name}))}),!b&&e(v,{children:i(t,{children:[i("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e(n,{width:16,height:16,color:l.content.secondary}),e(c,{children:null===(S=null==f?void 0:f.headers)||void 0===S?void 0:S[0]})]})),i("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e(r,{width:16,height:16,color:l.content.secondary}),e(o,{width:16,height:16,color:l.content.secondary})]}))]})}),e(p,Object.assign({size:w},{children:e(m,{size:null!=w?w:"large",content:null!==(z=null!=y?y:d({content:O,variablStore:null!=j?j:[]}))&&void 0!==z?z:""})}))]})};export{g as default};
1
+ import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import i from"../../assets/icons/arrow_left.svg.js";import l from"../../assets/icons/more_vertical.svg.js";import o from"../../assets/icons/search.svg.js";import{COLORS as r}from"../../constants/Theme.js";import{useTemplateModalContext as s}from"../template-context-mapper/context/templateModalContext.js";import{TitleRegular as a,Caption as c}from"../TypographyStyle.js";import d from"./RenderVariableUIForPreview.js";import m from"./SMS/SMSBubble.js";import{SMSBubbleContainer as p,SMSCardHeader as h,SMSHeader as u}from"./SmsTemplatePreview.styled.js";const v=v=>{let{template:g,variableStore:f,hideHeader:j,display_content:y,onlyTemplateContent:b,size:w,uniqueId:x}=v;var S,z,I;const O=null==g?void 0:g.content,{hideDeviceContainerInPreview:T,originalVariableList:C}=s();return console.log("templateContent in smsTemplatePreview",C),T?e(p,Object.assign({size:w},{children:e(m,{size:null!=w?w:"large",content:null!==(S=null!=y?y:d({content:O,variablStore:null!=f?f:[],uniqueId:null!=x?x:""}))&&void 0!==S?S:e(t,{})})})):n(t,{children:[!j&&!b&&e(h,{children:e(a,Object.assign({style:{maxWidth:"100%"}},{children:g.name}))}),!b&&e(u,{children:n(t,{children:[n("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e(i,{width:16,height:16,color:r.content.secondary}),e(c,{children:null===(z=null==g?void 0:g.headers)||void 0===z?void 0:z[0]})]})),n("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e(o,{width:16,height:16,color:r.content.secondary}),e(l,{width:16,height:16,color:r.content.secondary})]}))]})}),e(p,Object.assign({size:w},{children:e(m,{size:null!=w?w:"large",content:null!==(I=null!=y?y:d({content:O,variablStore:null!=f?f:[],uniqueId:null!=x?x:""}))&&void 0!==I?I:""})}))]})};export{v as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as l,Fragment as t}from"react/jsx-runtime";import{useTemplateModalContext as i}from"../template-context-mapper/context/templateModalContext.js";import a from"../../utils/StringUtils.js";import{COLORS as n}from"../../constants/Theme.js";import{TitleRegular as o}from"../TypographyStyle.js";import r from"./EmailTemplateThumbnailPreview.js";import{CHANNEL_TYPE as s}from"./models/Channels.js";import d from"./SmsTemplatePreview.js";import p from"./WhatsAppTemplatePreview.js";const m=m=>{let{template:c,channel:v,whatsAppSpecificMeta:h,templateCreationsInfo:b,hideHeader:g,size:C,onlyTemplateContent:S,emailSpecificMeta:y,smsSpecificMeta:j,showSampleValues:T,carouselCardIndex:f,isWhatsappCarousel:w,isPreview:x}=m;var W,H;const{setSelectedCarouselIndex:O}=i();return v===s.SMS?e("div",Object.assign({style:Object.assign({marginTop:b?16:0,border:b?`1px solid ${n.stroke.primary}`:"none",borderRadius:4},null==j?void 0:j.templateContainerStyles)},{children:e(d,{template:c,hideHeader:g,onlyTemplateContent:S,size:null!=C?C:"large",variableStore:null==j?void 0:j.smsVariableStore,display_content:null==j?void 0:j.smsDisplayContent})})):v===s.EMAIL?e("div",Object.assign({style:Object.assign({marginTop:b?16:0},null==y?void 0:y.templateContainerStyles)},{children:e(r,{template:c,handleViewTemplate:()=>{var e;null===(e=null==y?void 0:y.handleViewTemplate)||void 0===e||e.call(y)},hideHeader:g,hideViewButton:null==y?void 0:y.hideViewButtonForEmail,containerStyle:null==y?void 0:y.containerStyle,emailDisplayContent:null==y?void 0:y.emailDisplayContent,emailHtmlContainerId:null==y?void 0:y.emailHtmlContainerId})})):v===s.WHATSAPP?l("div",Object.assign({style:Object.assign(Object.assign({},null==h?void 0:h.templateContainerStyles),b?u.WhatsAppWrapper:{}),onClick:()=>{var e,l;if(O&&w){if(-1===f&&!(null===(l=null===(e=null==c?void 0:c.mapping)||void 0===e?void 0:e.body)||void 0===l?void 0:l.length))return;O(null!=f?f:-1)}}},{children:[b?e("div",Object.assign({style:{padding:16}},{children:e(o,{children:a.convertToTitleCase(null!==(W=null==c?void 0:c.label)&&void 0!==W?W:"")})})):e(t,{}),e(p,{showSampleValues:T,showHeader:null==h?void 0:h.showWhatsAppHeader,extras:null==h?void 0:h.whatsAppExtras,template:c,size:b?"small":null!=C?C:"large",containerStyle:Object.assign(Object.assign({borderWidth:b?0:1,borderTopWidth:1},null!==(H=null==h?void 0:h.containerStyle)&&void 0!==H?H:{}),{height:"100%"}),zeroStateComponent:null==h?void 0:h.zeroStateComponent,usePlaceHolderName:null==h?void 0:h.usePlaceHolderName,carouselCardIndex:f,isWhatsappCarousel:w,isPreview:x})]})):e(t,{})},u={WhatsAppWrapper:{backgroundColor:n.surface.standard,borderRadius:4,border:`1px solid ${n.background.inactive}`,marginTop:16}};export{m as TemplatePreview};
1
+ import{jsx as e,jsxs as l,Fragment as t}from"react/jsx-runtime";import{useTemplateModalContext as i}from"../template-context-mapper/context/templateModalContext.js";import a from"../../utils/StringUtils.js";import{COLORS as n}from"../../constants/Theme.js";import{TitleRegular as o}from"../TypographyStyle.js";import r from"./EmailTemplateThumbnailPreview.js";import{CHANNEL_TYPE as s}from"./models/Channels.js";import d from"./SmsTemplatePreview.js";import p from"./WhatsAppTemplatePreview.js";const m=m=>{let{template:c,channel:v,whatsAppSpecificMeta:h,templateCreationsInfo:b,hideHeader:g,size:C,onlyTemplateContent:S,emailSpecificMeta:y,smsSpecificMeta:j,showSampleValues:T,carouselCardIndex:f,isWhatsappCarousel:w,isPreview:x}=m;var W,H;const{setSelectedCarouselIndex:O}=i();return v===s.SMS?e("div",Object.assign({style:Object.assign({marginTop:b?16:0,border:b?`1px solid ${n.stroke.primary}`:"none",borderRadius:4},null==j?void 0:j.templateContainerStyles)},{children:e(d,{template:c,hideHeader:g,onlyTemplateContent:S,size:null!=C?C:"large",variableStore:null==j?void 0:j.smsVariableStore,display_content:null==j?void 0:j.smsDisplayContent,uniqueId:null==j?void 0:j.uniqueId})})):v===s.EMAIL?e("div",Object.assign({style:Object.assign({marginTop:b?16:0},null==y?void 0:y.templateContainerStyles)},{children:e(r,{template:c,handleViewTemplate:()=>{var e;null===(e=null==y?void 0:y.handleViewTemplate)||void 0===e||e.call(y)},hideHeader:g,hideViewButton:null==y?void 0:y.hideViewButtonForEmail,containerStyle:null==y?void 0:y.containerStyle,emailDisplayContent:null==y?void 0:y.emailDisplayContent,emailHtmlContainerId:null==y?void 0:y.emailHtmlContainerId})})):v===s.WHATSAPP?l("div",Object.assign({style:Object.assign(Object.assign({},null==h?void 0:h.templateContainerStyles),b?u.WhatsAppWrapper:{}),onClick:()=>{var e,l;if(O&&w){if(-1===f&&!(null===(l=null===(e=null==c?void 0:c.mapping)||void 0===e?void 0:e.body)||void 0===l?void 0:l.length))return;O(null!=f?f:-1)}}},{children:[b?e("div",Object.assign({style:{padding:16}},{children:e(o,{children:a.convertToTitleCase(null!==(W=null==c?void 0:c.label)&&void 0!==W?W:"")})})):e(t,{}),e(p,{showSampleValues:T,showHeader:null==h?void 0:h.showWhatsAppHeader,extras:null==h?void 0:h.whatsAppExtras,template:c,size:b?"small":null!=C?C:"large",containerStyle:Object.assign(Object.assign({borderWidth:b?0:1,borderTopWidth:1},null!==(H=null==h?void 0:h.containerStyle)&&void 0!==H?H:{}),{height:"100%"}),zeroStateComponent:null==h?void 0:h.zeroStateComponent,usePlaceHolderName:null==h?void 0:h.usePlaceHolderName,carouselCardIndex:f,isWhatsappCarousel:w,isPreview:x})]})):e(t,{})},u={WhatsAppWrapper:{backgroundColor:n.surface.standard,borderRadius:4,border:`1px solid ${n.background.inactive}`,marginTop:16}};export{m as TemplatePreview};
@@ -32,4 +32,5 @@ export type SMSMeta = {
32
32
  smsVariableStore?: CUSTOM_VARIABLE[];
33
33
  smsDisplayContent?: string;
34
34
  templateContainerStyles?: React.CSSProperties | undefined;
35
+ uniqueId?: string;
35
36
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.530-beta0.rt14",
3
+ "version": "0.0.530-beta0.rt16",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",