@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.
@@ -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 v=null==u?void 0:u.content,{hideDeviceContainerInPreview:S,originalVariableList:b}=i.useTemplateModalContext();return console.log("templateContent in smsTemplatePreview",b),S?e.jsx(d.SMSBubbleContainer,Object.assign({size:g},{children:e.jsx(o.default,{size:null!=g?g:"large",content:null!=x?x:a.renderVariableUIForPreview(v,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===(m=null==u?void 0:u.headers)||void 0===m?void 0:m[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(v,null!=j?j:[],b)})}))]})};
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
- import { WhatsAppCarouselTemplateVariables } from '../models/WhatsappCarouselTemplate';
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"),r=require("../constants/regexPatterns.js");exports.renderVariableUIForPreview=function(a,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.COLORS.content.brand;console.log("originalVariableList",n);let l,o=0,i="";for(;null!==(l=r.variablePattern.exec(a));){const e=l[1];i+=a.slice(o,l.index);const t=n&&Array.isArray(n)&&n.length&&n.find((r=>r.variableName===`{{${e}}}`));console.log("vaaa",t),i+=t?`<span style="color: ${s};">${t.updatedValue||`{{${e}}}`}</span>`:`<span style="color: ${s};">{{${e}}}</span>`,o=r.variablePattern.lastIndex}return i+=a.slice(o),i};
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 l from"../../assets/icons/arrow_left.svg.js";import n 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{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 f=f=>{let{template:v,variableStore:j,hideHeader:y,display_content:u,onlyTemplateContent:x,size:b}=f;var w;const S=null==v?void 0:v.content,{hideDeviceContainerInPreview:T,originalVariableList:z}=s();return console.log("templateContent in smsTemplatePreview",z),T?e(p,Object.assign({size:b},{children:e(d,{size:null!=b?b:"large",content:null!=u?u:m(S,null!=j?j:[])})})):t(i,{children:[!y&&!x&&e(h,{children:e(a,Object.assign({style:{maxWidth:"100%"}},{children:v.name}))}),!x&&e(g,{children:t(i,{children:[t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e(l,{width:16,height:16,color:r.content.secondary}),e(c,{children:null===(w=null==v?void 0:v.headers)||void 0===w?void 0:w[0]})]})),t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e(o,{width:16,height:16,color:r.content.secondary}),e(n,{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(S,null!=j?j:[],z)})}))]})};export{f as default};
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
- import { WhatsAppCarouselTemplateVariables } from '../models/WhatsappCarouselTemplate';
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 e}from"../../../constants/Theme.js";import{variablePattern as n}from"../constants/regexPatterns.js";const o=function(o,t,s){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.content.brand;console.log("originalVariableList",s);let l,r=0,c="";for(;null!==(l=n.exec(o));){const e=l[1];c+=o.slice(r,l.index);const t=s&&Array.isArray(s)&&s.length&&s.find((n=>n.variableName===`{{${e}}}`));console.log("vaaa",t),c+=t?`<span style="color: ${a};">${t.updatedValue||`{{${e}}}`}</span>`:`<span style="color: ${a};">{{${e}}}</span>`,r=n.lastIndex}return c+=o.slice(r),c};export{o as renderVariableUIForPreview};
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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.530-beta0.rt11",
3
+ "version": "0.0.530-beta0.rt12",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",