@bikdotai/bik-component-library 0.0.419-beta.16 → 0.0.419-beta.18
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/carousel-preview/CarouselPreview.js +5 -6
- package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
- package/dist/cjs/components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js +4 -4
- package/dist/esm/components/carousel-preview/CarouselPreview.js +5 -6
- package/dist/esm/components/template-preview/TemplatePreview.js +1 -1
- package/dist/esm/components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js +4 -4
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/chevronLeft.svg.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/chevronLeft.svg.js"),r=require("../../assets/icons/chevronRight.svg.js"),i=require("pure-react-carousel"),o=require("react"),n=require("styled-components"),s=require("./CarouselPreviewCard.js"),a=require("../../constants/Theme.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(o),c=l(n);const u=c.default.div`
|
|
2
2
|
background-image: url('https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F341dba50-e84e-4457-b5b5-d9d8a0b95a73?alt=media&token=6fd32f23-8bb2-4980-bbee-bef39b38fd9f');
|
|
3
3
|
border-color: ${a.COLORS.stroke.primary};
|
|
4
4
|
border-top-style: solid;
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
background-position: center;
|
|
10
10
|
background-size: cover;
|
|
11
11
|
position: relative;
|
|
12
|
-
|
|
13
|
-
// height: 80%;
|
|
12
|
+
height: 500px;
|
|
14
13
|
overflow-y: auto;
|
|
15
14
|
`,p=c.default.div`
|
|
16
15
|
flex-direction: row;
|
|
@@ -47,7 +46,7 @@
|
|
|
47
46
|
box-shadow: 0px 1.5px 6px 0px #0000001f;
|
|
48
47
|
}
|
|
49
48
|
.slider {
|
|
50
|
-
width:
|
|
51
|
-
height:
|
|
49
|
+
width: 800px;
|
|
50
|
+
height: 480px;
|
|
52
51
|
}
|
|
53
|
-
`,h=
|
|
52
|
+
`,h=d.default.forwardRef(((o,n)=>{let{channel:l,template:d,showSampleValues:c}=o;var h,b,x,g;const v=null===(h=null==d?void 0:d.components)||void 0===h?void 0:h[1].cards;return e.jsxs(u,{children:[e.jsx(s.default,{channel:l,template:d,isHeader:!0,carouselCardIndex:-1,contentWrapperStyles:{width:"480px"}}),(null==v?void 0:v.length)&&e.jsx("div",Object.assign({style:{marginTop:50}},{children:e.jsx(i.CarouselProvider,Object.assign({naturalSlideWidth:100,naturalSlideHeight:125,totalSlides:null!==(b=null==v?void 0:v.length)&&void 0!==b?b:1,orientation:"horizontal",visibleSlides:1.6},{children:e.jsxs(p,{children:[e.jsx(i.ButtonBack,Object.assign({className:"left_button"},{children:e.jsx(t.default,{height:10,width:10,color:a.COLORS.content.primary})})),e.jsx(i.Slider,Object.assign({className:"slider"},{children:null===(g=null===(x=null==d?void 0:d.components)||void 0===x?void 0:x[1].cards)||void 0===g?void 0:g.map(((t,r)=>{var o,n;const a={components:t.components,mapping:null===(n=null===(o=null==d?void 0:d.mapping)||void 0===o?void 0:o.cards)||void 0===n?void 0:n[r]};return e.jsx(i.Slide,Object.assign({index:r},{children:e.jsx(s.default,{channel:l,template:a,isHeader:!1,carouselCardIndex:r},r)}),r)}))})),e.jsx(i.ButtonNext,Object.assign({className:"right_button"},{children:e.jsx(r.default,{height:10,width:10,color:a.COLORS.content.primary})}))]})}))}))]})}));exports.CarouselPreview=h;
|
|
@@ -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"),s=require("./models/Channels.js"),r=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:C,onlyTemplateContent:j,emailSpecificMeta:S,smsSpecificMeta:x,showSampleValues:
|
|
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"),s=require("./models/Channels.js"),r=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:C,onlyTemplateContent:j,emailSpecificMeta:S,smsSpecificMeta:x,showSampleValues:T,carouselCardIndex:b,isWhatsappCarousel:g}=p;var y,O;const{setSelectedCarouselIndex:w}=l.useTemplateModalContext();return m===s.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==x?void 0:x.templateContainerStyles)},{children:e.jsx(r.default,{template:u,hideHeader:h,onlyTemplateContent:j,size:null!=C?C:"large",variableStore:null==x?void 0:x.smsVariableStore,display_content:null==x?void 0:x.smsDisplayContent})})):m===s.CHANNEL_TYPE.EMAIL?e.jsx("div",Object.assign({style:Object.assign({marginTop:v?16:0},null==S?void 0:S.templateContainerStyles)},{children:e.jsx(n.default,{template:u,handleViewTemplate:()=>{var e;null===(e=null==S?void 0:S.handleViewTemplate)||void 0===e||e.call(S)},hideHeader:h,hideViewButton:null==S?void 0:S.hideViewButtonForEmail,containerStyle:null==S?void 0:S.containerStyle,emailDisplayContent:null==S?void 0:S.emailDisplayContent,emailHtmlContainerId:null==S?void 0:S.emailHtmlContainerId})})):m===s.CHANNEL_TYPE.WHATSAPP?e.jsxs("div",Object.assign({style:Object.assign(Object.assign({},null==c?void 0:c.templateContainerStyles),v?d.WhatsAppWrapper:{}),onClick:()=>{w&&g&&w(null!=b?b:-1)}},{children:[v?e.jsx("div",Object.assign({style:{padding:16}},{children:e.jsx(i.TitleRegular,{children:t.default.convertToTitleCase(null!==(y=null==u?void 0:u.label)&&void 0!==y?y:"")})})):e.jsx(e.Fragment,{}),e.jsx(o.default,{showSampleValues:T,showHeader:null==c?void 0:c.showWhatsAppHeader,extras:null==c?void 0:c.whatsAppExtras,template:u,size:v?"small":null!=C?C:"large",containerStyle:Object.assign({borderWidth:v?0:1,borderTopWidth:1},null!==(O=null==c?void 0:c.containerStyle)&&void 0!==O?O:{}),zeroStateComponent:null==c?void 0:c.zeroStateComponent,usePlaceHolderName:null==c?void 0:c.usePlaceHolderName,carouselCardIndex:b,isWhatsappCarousel:g})]})):e.jsx(e.Fragment,{})};
|
|
@@ -1,10 +1,10 @@
|
|
|
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("styled-components"),t=require("../../TypographyStyle.js"),a=require("../../../constants/Theme.js"),s=require("../utils/getPreviewPropLen.js"),i=require("./ChatHeader.js"),o=require("./ChatUiV2.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=n(r);const p=d.default.div`
|
|
2
2
|
background-image: url(${e=>e.isWhatsappCarousel?void 0:"https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F341dba50-e84e-4457-b5b5-d9d8a0b95a73?alt=media&token=6fd32f23-8bb2-4980-bbee-bef39b38fd9f"});
|
|
3
3
|
border-radius: 4px;
|
|
4
4
|
background-repeat: no-repeat;
|
|
5
5
|
background-position: center;
|
|
6
6
|
background-size: cover;
|
|
7
7
|
position: relative;
|
|
8
|
-
`,
|
|
9
|
-
color: ${
|
|
10
|
-
`;exports.WhatsappLikePreviewV2=
|
|
8
|
+
`,l=d.default(t.TitleRegular)`
|
|
9
|
+
color: ${a.COLORS.content.primary};
|
|
10
|
+
`;exports.WhatsappLikePreviewV2=r=>3===s.getPreviewPropLen(r)?e.jsx(e.Fragment,{children:r.zeroStateComponent}):e.jsx(e.Fragment,{children:e.jsxs(p,Object.assign({style:r.containerStyle,showHeader:r.showHeader,isWhatsappCarousel:r.isWhatsappCarousel},{children:[r.showHeader&&e.jsx(i.default,{}),e.jsxs("div",Object.assign({style:{padding:"small"===r.size?"12px 32px 12px 12px":"16px 56px 12px 16px"}},{children:[!r.hidePreviewText&&e.jsx("div",Object.assign({style:{marginBottom:16}},{children:e.jsx(l,{children:"Preview"})})),e.jsx(o.ChatUIV2,Object.assign({showHeader:r.showHeader},r))]}))]}))});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as o}from"react/jsx-runtime";import t from"../../assets/icons/chevronLeft.svg.js";import i from"../../assets/icons/chevronRight.svg.js";import{CarouselProvider as r,ButtonBack as n,Slider as a,Slide as
|
|
1
|
+
import{jsxs as e,jsx as o}from"react/jsx-runtime";import t from"../../assets/icons/chevronLeft.svg.js";import i from"../../assets/icons/chevronRight.svg.js";import{CarouselProvider as r,ButtonBack as n,Slider as a,Slide as l,ButtonNext as s}from"pure-react-carousel";import d from"react";import c from"styled-components";import p from"./CarouselPreviewCard.js";import{COLORS as h}from"../../constants/Theme.js";const m=c.div`
|
|
2
2
|
background-image: url('https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F341dba50-e84e-4457-b5b5-d9d8a0b95a73?alt=media&token=6fd32f23-8bb2-4980-bbee-bef39b38fd9f');
|
|
3
3
|
border-color: ${h.stroke.primary};
|
|
4
4
|
border-top-style: solid;
|
|
@@ -9,8 +9,7 @@ import{jsxs as e,jsx as o}from"react/jsx-runtime";import t from"../../assets/ico
|
|
|
9
9
|
background-position: center;
|
|
10
10
|
background-size: cover;
|
|
11
11
|
position: relative;
|
|
12
|
-
|
|
13
|
-
// height: 80%;
|
|
12
|
+
height: 500px;
|
|
14
13
|
overflow-y: auto;
|
|
15
14
|
`,b=c.div`
|
|
16
15
|
flex-direction: row;
|
|
@@ -47,7 +46,7 @@ import{jsxs as e,jsx as o}from"react/jsx-runtime";import t from"../../assets/ico
|
|
|
47
46
|
box-shadow: 0px 1.5px 6px 0px #0000001f;
|
|
48
47
|
}
|
|
49
48
|
.slider {
|
|
50
|
-
width:
|
|
51
|
-
height:
|
|
49
|
+
width: 800px;
|
|
50
|
+
height: 480px;
|
|
52
51
|
}
|
|
53
|
-
`,g=
|
|
52
|
+
`,g=d.forwardRef(((d,c)=>{let{channel:g,template:u,showSampleValues:x}=d;var v,f,w,y;const j=null===(v=null==u?void 0:u.components)||void 0===v?void 0:v[1].cards;return e(m,{children:[o(p,{channel:g,template:u,isHeader:!0,carouselCardIndex:-1,contentWrapperStyles:{width:"480px"}}),(null==j?void 0:j.length)&&o("div",Object.assign({style:{marginTop:50}},{children:o(r,Object.assign({naturalSlideWidth:100,naturalSlideHeight:125,totalSlides:null!==(f=null==j?void 0:j.length)&&void 0!==f?f:1,orientation:"horizontal",visibleSlides:1.6},{children:e(b,{children:[o(n,Object.assign({className:"left_button"},{children:o(t,{height:10,width:10,color:h.content.primary})})),o(a,Object.assign({className:"slider"},{children:null===(y=null===(w=null==u?void 0:u.components)||void 0===w?void 0:w[1].cards)||void 0===y?void 0:y.map(((e,t)=>{var i,r;const n={components:e.components,mapping:null===(r=null===(i=null==u?void 0:u.mapping)||void 0===i?void 0:i.cards)||void 0===r?void 0:r[t]};return o(l,Object.assign({index:t},{children:o(p,{channel:g,template:n,isHeader:!1,carouselCardIndex:t},t)}),t)}))})),o(s,Object.assign({className:"right_button"},{children:o(i,{height:10,width:10,color:h.content.primary})}))]})}))}))]})}));export{g as CarouselPreview};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as l}from"react/jsx-runtime";import{useTemplateModalContext as a}from"../template-context-mapper/context/templateModalContext.js";import i from"../../utils/StringUtils.js";import{COLORS as o}from"../../constants/Theme.js";import{TitleRegular as n}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:u,channel:h,whatsAppSpecificMeta:v,templateCreationsInfo:C,hideHeader:S,size:b,onlyTemplateContent:y,emailSpecificMeta:g,smsSpecificMeta:j,showSampleValues:T,carouselCardIndex:f,isWhatsappCarousel:w}=m;var x,W;const{setSelectedCarouselIndex:H}=a();return h===s.SMS?e("div",Object.assign({style:Object.assign({marginTop:C?16:0,border:C?`1px solid ${o.stroke.primary}`:"none",borderRadius:4},null==j?void 0:j.templateContainerStyles)},{children:e(d,{template:u,hideHeader:S,onlyTemplateContent:y,size:null!=b?b:"large",variableStore:null==j?void 0:j.smsVariableStore,display_content:null==j?void 0:j.smsDisplayContent})})):h===s.EMAIL?e("div",Object.assign({style:Object.assign({marginTop:C?16:0},null==g?void 0:g.templateContainerStyles)},{children:e(r,{template:u,handleViewTemplate:()=>{var e;null===(e=null==g?void 0:g.handleViewTemplate)||void 0===e||e.call(g)},hideHeader:S,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})})):h===s.WHATSAPP?t("div",Object.assign({style:Object.assign(Object.assign({},null==v?void 0:v.templateContainerStyles),C?c.WhatsAppWrapper:{}),onClick:()=>{H&&w&&H(null!=f?f:-1)}},{children:[C?e("div",Object.assign({style:{padding:16}},{children:e(n,{children:i.convertToTitleCase(null!==(x=null==u?void 0:u.label)&&void 0!==x?x:"")})})):e(l,{}),e(p,{showSampleValues:T,showHeader:null==v?void 0:v.showWhatsAppHeader,extras:null==v?void 0:v.whatsAppExtras,template:u,size:C?"small":null!=b?b:"large",containerStyle:Object.assign({borderWidth:C?0:1,borderTopWidth:1},null!==(W=null==v?void 0:v.containerStyle)&&void 0!==W?W:{}),zeroStateComponent:null==v?void 0:v.zeroStateComponent,usePlaceHolderName:null==v?void 0:v.usePlaceHolderName,carouselCardIndex:f,isWhatsappCarousel:w})]})):e(l,{})},c={WhatsAppWrapper:{backgroundColor:o.surface.standard,borderRadius:4,border:`1px solid ${o.background.inactive}`,marginTop:16}};export{m as TemplatePreview};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{jsx as e,Fragment as
|
|
1
|
+
import{jsx as e,Fragment as r,jsxs as o}from"react/jsx-runtime";import t from"styled-components";import{TitleRegular as a}from"../../TypographyStyle.js";import{COLORS as i}from"../../../constants/Theme.js";import{getPreviewPropLen as s}from"../utils/getPreviewPropLen.js";import p from"./ChatHeader.js";import{ChatUIV2 as n}from"./ChatUiV2.js";const d=t.div`
|
|
2
2
|
background-image: url(${e=>e.isWhatsappCarousel?void 0:"https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F341dba50-e84e-4457-b5b5-d9d8a0b95a73?alt=media&token=6fd32f23-8bb2-4980-bbee-bef39b38fd9f"});
|
|
3
3
|
border-radius: 4px;
|
|
4
4
|
background-repeat: no-repeat;
|
|
5
5
|
background-position: center;
|
|
6
6
|
background-size: cover;
|
|
7
7
|
position: relative;
|
|
8
|
-
`,c=
|
|
9
|
-
color: ${
|
|
10
|
-
`,
|
|
8
|
+
`,c=t(a)`
|
|
9
|
+
color: ${i.content.primary};
|
|
10
|
+
`,m=t=>{const a=s(t);return e(r,3===a?{children:t.zeroStateComponent}:{children:o(d,Object.assign({style:t.containerStyle,showHeader:t.showHeader,isWhatsappCarousel:t.isWhatsappCarousel},{children:[t.showHeader&&e(p,{}),o("div",Object.assign({style:{padding:"small"===t.size?"12px 32px 12px 12px":"16px 56px 12px 16px"}},{children:[!t.hidePreviewText&&e("div",Object.assign({style:{marginBottom:16}},{children:e(c,{children:"Preview"})})),e(n,Object.assign({showHeader:t.showHeader},t))]}))]}))})};export{m as WhatsappLikePreviewV2};
|