@bikdotai/bik-component-library 0.0.530-beta0.357899 → 0.0.530-beta0.rt

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"),n=require("../template-context-mapper/context/templateModalContext.js"),i=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}=n.useTemplateModalContext();return console.log("templateContent in smsTemplateProview",u,x,j),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(i.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(i.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:[])})}))]})};
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"),n=require("../template-context-mapper/context/templateModalContext.js"),i=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}=n.useTemplateModalContext();return console.log("templateContent in smsTemplatePreview",u,x,j),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(i.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(i.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:[])})}))]})};
@@ -1,2 +1,2 @@
1
1
  import { CUSTOM_VARIABLE } from '../models/TemplateMeta';
2
- export declare const renderVariableUIForPreview: (content: string, variablStore?: CUSTOM_VARIABLE[], brandColor?: string) => string;
2
+ export declare const renderVariableUIForPreview: (content: string, variableStore?: CUSTOM_VARIABLE[], brandColor?: string) => string;
@@ -1 +1 @@
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
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../constants/Theme.js"),r=require("../constants/regexPatterns.js");exports.renderVariableUIForPreview=function(t,n){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.COLORS.content.brand;if(!n||!n.length)return t;const l=n.reduce(((e,r)=>{let{variableName:t,updatedValue:n,index:a}=r;return void 0!==a?e[a]=n:e[t]=n,e}),{});r.variablePatternGlobal.lastIndex=0;const o=[...t.matchAll(r.variablePatternGlobal)];let i="",s=0;return o.forEach(((e,r)=>{var n,o;const d=e[0].slice(2,-2),c=null!==(o=null!==(n=l[r])&&void 0!==n?n:l[d])&&void 0!==o?o:e[0];i+=t.slice(s,e.index)+`<span id="connectors_variable_${r}" style="color: ${a}; text-decoration: underline; word-break: break-word;">${c}</span>`,s=e.index+e[0].length})),i+=t.slice(s),i};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import n from"../../assets/icons/arrow_left.svg.js";import l from"../../assets/icons/more_vertical.svg.js";import r from"../../assets/icons/search.svg.js";import{COLORS as i}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:w}=f;var b;const S=null==v?void 0:v.content,{hideDeviceContainerInPreview:T}=s();return console.log("templateContent in smsTemplateProview",v,u,j),T?e(p,Object.assign({size:w},{children:e(d,{size:null!=w?w:"large",content:null!=u?u:m(S,null!=j?j:[])})})):t(o,{children:[!y&&!x&&e(h,{children:e(a,Object.assign({style:{maxWidth:"100%"}},{children:v.name}))}),!x&&e(g,{children:t(o,{children:[t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e(n,{width:16,height:16,color:i.content.secondary}),e(c,{children:null===(b=null==v?void 0:v.headers)||void 0===b?void 0:b[0]})]})),t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e(r,{width:16,height:16,color:i.content.secondary}),e(l,{width:16,height:16,color:i.content.secondary})]}))]})}),e(p,Object.assign({size:w},{children:e(d,{size:null!=w?w:"large",content:null!=u?u:m(S,null!=j?j:[])})}))]})};export{f as default};
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import o from"../../assets/icons/arrow_left.svg.js";import l from"../../assets/icons/more_vertical.svg.js";import r from"../../assets/icons/search.svg.js";import{COLORS as i}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:w}=f;var b;const S=null==v?void 0:v.content,{hideDeviceContainerInPreview:T}=s();return console.log("templateContent in smsTemplatePreview",v,u,j),T?e(p,Object.assign({size:w},{children:e(d,{size:null!=w?w:"large",content:null!=u?u:m(S,null!=j?j:[])})})):t(n,{children:[!y&&!x&&e(h,{children:e(a,Object.assign({style:{maxWidth:"100%"}},{children:v.name}))}),!x&&e(g,{children:t(n,{children:[t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e(o,{width:16,height:16,color:i.content.secondary}),e(c,{children:null===(b=null==v?void 0:v.headers)||void 0===b?void 0:b[0]})]})),t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e(r,{width:16,height:16,color:i.content.secondary}),e(l,{width:16,height:16,color:i.content.secondary})]}))]})}),e(p,Object.assign({size:w},{children:e(d,{size:null!=w?w:"large",content:null!=u?u:m(S,null!=j?j:[])})}))]})};export{f as default};
@@ -1,2 +1,2 @@
1
1
  import { CUSTOM_VARIABLE } from '../models/TemplateMeta';
2
- export declare const renderVariableUIForPreview: (content: string, variablStore?: CUSTOM_VARIABLE[], brandColor?: string) => string;
2
+ export declare const renderVariableUIForPreview: (content: string, variableStore?: CUSTOM_VARIABLE[], brandColor?: string) => string;
@@ -1 +1 @@
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};
1
+ import{COLORS as e}from"../../../constants/Theme.js";import{variablePatternGlobal as n}from"../constants/regexPatterns.js";const t=function(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.content.brand;if(!r||!r.length)return t;const l=r.reduce(((e,n)=>{let{variableName:t,updatedValue:r,index:o}=n;return void 0!==o?e[o]=r:e[t]=r,e}),{});n.lastIndex=0;const a=[...t.matchAll(n)];let i="",s=0;return a.forEach(((e,n)=>{var r,a;const c=e[0].slice(2,-2),d=null!==(a=null!==(r=l[n])&&void 0!==r?r:l[c])&&void 0!==a?a:e[0];i+=t.slice(s,e.index)+`<span id="connectors_variable_${n}" style="color: ${o}; text-decoration: underline; word-break: break-word;">${d}</span>`,s=e.index+e[0].length})),i+=t.slice(s),i};export{t 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.357899",
3
+ "version": "0.0.530-beta0.rt",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",