@bikdotai/bik-component-library 0.0.530-beta0.rt16 → 0.0.530-beta0.rt17
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/SMS/SMSBubble.d.ts +1 -2
- package/dist/cjs/components/template-preview/SMS/SMSBubble.js +4 -4
- package/dist/cjs/components/template-preview/SmsTemplatePreview.js +1 -1
- package/dist/cjs/components/template-preview/helpers/SmsTemplateHelper.d.ts +1 -1
- package/dist/cjs/components/template-preview/helpers/SmsTemplateHelper.js +1 -1
- package/dist/esm/components/template-preview/SMS/SMSBubble.d.ts +1 -2
- package/dist/esm/components/template-preview/SMS/SMSBubble.js +4 -4
- package/dist/esm/components/template-preview/SmsTemplatePreview.js +1 -1
- package/dist/esm/components/template-preview/helpers/SmsTemplateHelper.d.ts +1 -1
- package/dist/esm/components/template-preview/helpers/SmsTemplateHelper.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/template-preview/RenderVariableUIForPreview.js +0 -1
- package/dist/esm/components/template-preview/RenderVariableUIForPreview.js +0 -1
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
1
|
export declare const SideCaret: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
2
|
export declare const SMSContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
3
|
export type SMSBubbleProps = {
|
|
5
|
-
content:
|
|
4
|
+
content: string;
|
|
6
5
|
size?: 'small' | 'large';
|
|
7
6
|
};
|
|
8
7
|
declare const SMSBubble: (props: SMSBubbleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/union.svg.js"),r=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/union.svg.js"),r=require("styled-components"),s=require("../../../constants/Theme.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=o(r);const i=n.default.div`
|
|
2
2
|
position: absolute;
|
|
3
3
|
width: 30px;
|
|
4
4
|
height: 30px;
|
|
5
5
|
left: -10px;
|
|
6
6
|
bottom: -1px;
|
|
7
|
-
`,
|
|
7
|
+
`,a=n.default.div`
|
|
8
8
|
padding: 12px;
|
|
9
|
-
background: ${
|
|
9
|
+
background: ${s.COLORS.background.base};
|
|
10
10
|
border-radius: 16px;
|
|
11
11
|
position: relative;
|
|
12
|
-
`;exports.SMSContainer=
|
|
12
|
+
`;exports.SMSContainer=a,exports.SideCaret=i,exports.default=r=>{const{content:o,size:n}=r;return e.jsxs(a,{children:[e.jsx(i,{children:e.jsx(t.default,{color:s.COLORS.background.base,height:27,width:27})}),e.jsx("div",{style:{fontSize:"small"===n?12:14},dangerouslySetInnerHTML:{__html:o}})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../assets/icons/arrow_left.svg.js"),t=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:v,uniqueId:g}=c;var S;const m=null==u?void 0:u.content,{hideDeviceContainerInPreview:b}=n.useTemplateModalContext();return b?e.jsx(d.SMSBubbleContainer,Object.assign({size:v},{children:e.jsx(o.default,{size:null!=v?v:"large",content:null!=x?x:a.renderVariableUIForPreview(m,null!=j?j:[],void 0,null!=g?g:"")})})):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(r.default,{width:16,height:16,color:l.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(s.default,{width:16,height:16,color:l.COLORS.content.secondary}),e.jsx(t.default,{width:16,height:16,color:l.COLORS.content.secondary})]}))]})}),e.jsx(d.SMSBubbleContainer,Object.assign({size:v},{children:e.jsx(o.default,{size:null!=v?v:"large",content:null!=x?x:a.renderVariableUIForPreview(m,null!=j?j:[],"",null!=g?g:"")})}))]})};
|
|
@@ -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, variablStore?: CUSTOM_VARIABLE[], brandColor?: string, uniqueId?: 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
|
|
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,l=arguments.length>3?arguments[3]:void 0;const o=(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==o?void 0:o[n])?`${e}<span></span><span id="${l||""}connectors_variable_${n+1}" style="color: ${t}; text-decoration: underline; word-break: break-word;">${null!==(r=null==o?void 0:o[n])&&void 0!==r?r:""}</span><span> </span>`:e})).join("")};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
1
|
export declare const SideCaret: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
2
|
export declare const SMSContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
3
|
export type SMSBubbleProps = {
|
|
5
|
-
content:
|
|
4
|
+
content: string;
|
|
6
5
|
size?: 'small' | 'large';
|
|
7
6
|
};
|
|
8
7
|
declare const SMSBubble: (props: SMSBubbleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{jsxs as t,jsx as o}from"react/jsx-runtime";import e from"../../../assets/icons/union.svg.js";import
|
|
1
|
+
import{jsxs as t,jsx as o}from"react/jsx-runtime";import e from"../../../assets/icons/union.svg.js";import i from"styled-components";import{COLORS as n}from"../../../constants/Theme.js";const r=i.div`
|
|
2
2
|
position: absolute;
|
|
3
3
|
width: 30px;
|
|
4
4
|
height: 30px;
|
|
5
5
|
left: -10px;
|
|
6
6
|
bottom: -1px;
|
|
7
|
-
`,
|
|
7
|
+
`,s=i.div`
|
|
8
8
|
padding: 12px;
|
|
9
|
-
background: ${
|
|
9
|
+
background: ${n.background.base};
|
|
10
10
|
border-radius: 16px;
|
|
11
11
|
position: relative;
|
|
12
|
-
`,
|
|
12
|
+
`,d=i=>{const{content:d,size:a}=i;return t(s,{children:[o(r,{children:o(e,{color:n.background.base,height:27,width:27})}),o("div",{style:{fontSize:"small"===a?12:14},dangerouslySetInnerHTML:{__html:d}})]})};export{s as SMSContainer,r as SideCaret,d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as l}from"react/jsx-runtime";import n from"../../assets/icons/arrow_left.svg.js";import i from"../../assets/icons/more_vertical.svg.js";import r from"../../assets/icons/search.svg.js";import{COLORS as o}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 d}from"./helpers/SmsTemplateHelper.js";import m from"./SMS/SMSBubble.js";import{SMSBubbleContainer as p,SMSCardHeader as h,SMSHeader as u}from"./SmsTemplatePreview.styled.js";const f=f=>{let{template:g,variableStore:v,hideHeader:j,display_content:y,onlyTemplateContent:x,size:b,uniqueId:w}=f;var S;const z=null==g?void 0:g.content,{hideDeviceContainerInPreview:O}=s();return O?e(p,Object.assign({size:b},{children:e(m,{size:null!=b?b:"large",content:null!=y?y:d(z,null!=v?v:[],void 0,null!=w?w:"")})})):t(l,{children:[!j&&!x&&e(h,{children:e(a,Object.assign({style:{maxWidth:"100%"}},{children:g.name}))}),!x&&e(u,{children:t(l,{children:[t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e(n,{width:16,height:16,color:o.content.secondary}),e(c,{children:null===(S=null==g?void 0:g.headers)||void 0===S?void 0:S[0]})]})),t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8}},{children:[e(r,{width:16,height:16,color:o.content.secondary}),e(i,{width:16,height:16,color:o.content.secondary})]}))]})}),e(p,Object.assign({size:b},{children:e(m,{size:null!=b?b:"large",content:null!=y?y:d(z,null!=v?v:[],"",null!=w?w:"")})}))]})};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, variablStore?: CUSTOM_VARIABLE[], brandColor?: string, uniqueId?: 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
|
|
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,l=arguments.length>3?arguments[3]:void 0;const s=(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==s?void 0:s[t])?`${n}<span></span><span id="${l||""}connectors_variable_${t+1}" style="color: ${r}; text-decoration: underline; word-break: break-word;">${null!==(o=null==s?void 0:s[t])&&void 0!==o?o:""}</span><span> </span>`:n})).join("")};export{e as renderVariableUIForPreview};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
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)))})};
|
|
@@ -1 +0,0 @@
|
|
|
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};
|