@bikdotai/bik-component-library 0.0.530-beta0.rt11 → 0.0.530-beta0.rt12
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/template-preview/SmsTemplatePreview.js +1 -1
- package/dist/cjs/components/template-preview/helpers/SmsTemplateHelper.d.ts +1 -3
- package/dist/cjs/components/template-preview/helpers/SmsTemplateHelper.js +1 -1
- package/dist/esm/components/template-preview/SmsTemplatePreview.js +1 -1
- package/dist/esm/components/template-preview/helpers/SmsTemplateHelper.d.ts +1 -3
- package/dist/esm/components/template-preview/helpers/SmsTemplateHelper.js +1 -1
- package/package.json +1 -1
|
@@ -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"),s=require("../../assets/icons/search.svg.js"),l=require("../../constants/Theme.js"),i=require("../template-context-mapper/context/templateModalContext.js"),n=require("../TypographyStyle.js"),a=require("./helpers/SmsTemplateHelper.js"),o=require("./SMS/SMSBubble.js"),d=require("./SmsTemplatePreview.styled.js");exports.default=c=>{let{template:u,variableStore:j,hideHeader:h,display_content:x,onlyTemplateContent:p,size:g}=c;var m;const
|
|
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"),s=require("../../assets/icons/search.svg.js"),l=require("../../constants/Theme.js"),i=require("../template-context-mapper/context/templateModalContext.js"),n=require("../TypographyStyle.js"),a=require("./helpers/SmsTemplateHelper.js"),o=require("./SMS/SMSBubble.js"),d=require("./SmsTemplatePreview.styled.js");exports.default=c=>{let{template:u,variableStore:j,hideHeader:h,display_content:x,onlyTemplateContent:p,size:g}=c;var v,m;const S=null==u?void 0:u.content,{hideDeviceContainerInPreview:b,originalVariableList:y}=i.useTemplateModalContext();return console.log("templateContent in smsTemplatePreview",y),b?e.jsx(d.SMSBubbleContainer,Object.assign({size:g},{children:e.jsx(o.default,{size:null!=g?g:"large",content:null!=x?x:a.renderVariableUIForPreview(S,null!=j?j:[])})})):e.jsxs(e.Fragment,{children:[!h&&!p&&e.jsx(d.SMSCardHeader,{children:e.jsx(n.TitleRegular,Object.assign({style:{maxWidth:"100%"}},{children:u.name}))}),!p&&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:l.COLORS.content.secondary}),e.jsx(n.Caption,{children:null===(v=null==u?void 0:u.headers)||void 0===v?void 0:v[0]})]})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e.jsx(s.default,{width:16,height:16,color:l.COLORS.content.secondary}),e.jsx(r.default,{width:16,height:16,color:l.COLORS.content.secondary})]}))]})}),e.jsx(d.SMSBubbleContainer,Object.assign({size:g},{children:e.jsx(o.default,{size:null!=g?g:"large",content:null!=x?x:a.renderVariableUIForPreview(S,null!==(m=y)&&void 0!==m?m:[])})}))]})};
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { CUSTOM_VARIABLE } from '../models/TemplateMeta';
|
|
2
|
-
|
|
3
|
-
import { WhatsAppTemplateVariables } from '../models/WhatsAppTemplate';
|
|
4
|
-
export declare const renderVariableUIForPreview: (content: string, variablStore?: CUSTOM_VARIABLE[], originalVariables?: CUSTOM_VARIABLE[] | WhatsAppTemplateVariables | WhatsAppCarouselTemplateVariables, brandColor?: string) => string;
|
|
2
|
+
export declare const renderVariableUIForPreview: (content: string, variablStore?: CUSTOM_VARIABLE[], brandColor?: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../constants/Theme.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../constants/Theme.js"),n=require("../constants/regexPatterns.js");exports.renderVariableUIForPreview=function(r,a){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.COLORS.content.brand;const l=(null==a?void 0:a.length)?null==a?void 0:a.map((e=>e.updatedValue)):r.match(n.variablePatternGlobal);return n.variablePatternGlobal.lastIndex=0,r.split(n.variablePattern).map(((e,n)=>{var r;return(null==l?void 0:l[n])?`${e}<span></span><span id="connectors_variable_${n+1}" style="color: ${t}; text-decoration: underline; word-break: break-word;">${null!==(r=null==l?void 0:l[n])&&void 0!==r?r:""}</span><span> </span>`:e})).join("")};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import o from"../../assets/icons/arrow_left.svg.js";import l from"../../assets/icons/more_vertical.svg.js";import n 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{renderVariableUIForPreview as m}from"./helpers/SmsTemplateHelper.js";import d from"./SMS/SMSBubble.js";import{SMSBubbleContainer as p,SMSCardHeader as h,SMSHeader as g}from"./SmsTemplatePreview.styled.js";const v=v=>{let{template:f,variableStore:j,hideHeader:y,display_content:u,onlyTemplateContent:x,size:b}=v;var w,S;const T=null==f?void 0:f.content,{hideDeviceContainerInPreview:z,originalVariableList:O}=s();return console.log("templateContent in smsTemplatePreview",O),z?e(p,Object.assign({size:b},{children:e(d,{size:null!=b?b:"large",content:null!=u?u:m(T,null!=j?j:[])})})):t(i,{children:[!y&&!x&&e(h,{children:e(a,Object.assign({style:{maxWidth:"100%"}},{children:f.name}))}),!x&&e(g,{children:t(i,{children:[t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e(o,{width:16,height:16,color:r.content.secondary}),e(c,{children:null===(w=null==f?void 0:f.headers)||void 0===w?void 0:w[0]})]})),t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e(n,{width:16,height:16,color:r.content.secondary}),e(l,{width:16,height:16,color:r.content.secondary})]}))]})}),e(p,Object.assign({size:b},{children:e(d,{size:null!=b?b:"large",content:null!=u?u:m(T,null!==(S=O)&&void 0!==S?S:[])})}))]})};export{v as default};
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { CUSTOM_VARIABLE } from '../models/TemplateMeta';
|
|
2
|
-
|
|
3
|
-
import { WhatsAppTemplateVariables } from '../models/WhatsAppTemplate';
|
|
4
|
-
export declare const renderVariableUIForPreview: (content: string, variablStore?: CUSTOM_VARIABLE[], originalVariables?: CUSTOM_VARIABLE[] | WhatsAppTemplateVariables | WhatsAppCarouselTemplateVariables, brandColor?: string) => string;
|
|
2
|
+
export declare const renderVariableUIForPreview: (content: string, variablStore?: CUSTOM_VARIABLE[], brandColor?: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{COLORS as
|
|
1
|
+
import{COLORS as n}from"../../../constants/Theme.js";import{variablePatternGlobal as t,variablePattern as o}from"../constants/regexPatterns.js";const e=function(e,a){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.content.brand;const l=(null==a?void 0:a.length)?null==a?void 0:a.map((n=>n.updatedValue)):e.match(t);return t.lastIndex=0,e.split(o).map(((n,t)=>{var o;return(null==l?void 0:l[t])?`${n}<span></span><span id="connectors_variable_${t+1}" style="color: ${r}; text-decoration: underline; word-break: break-word;">${null!==(o=null==l?void 0:l[t])&&void 0!==o?o:""}</span><span> </span>`:n})).join("")};export{e as renderVariableUIForPreview};
|