@bikdotai/bik-component-library 0.0.566-webpush-beta0.3 → 0.0.566-webpush-beta0.4
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/TemplatePreview.d.ts +3 -1
- package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
- package/dist/cjs/components/template-preview/models/WebpushTemplate.d.ts +4 -0
- package/dist/esm/components/template-preview/TemplatePreview.d.ts +3 -1
- package/dist/esm/components/template-preview/TemplatePreview.js +1 -1
- package/dist/esm/components/template-preview/models/WebpushTemplate.d.ts +4 -0
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import { CHANNEL_TYPE } from './models/Channels';
|
|
|
3
3
|
import { EmailMeta } from './models/EmailTemplate';
|
|
4
4
|
import { SMSMeta } from './models/SmsTemplate';
|
|
5
5
|
import { AllTemplateTypes } from './models/types';
|
|
6
|
+
import { WebpushMetaType } from './models/WebpushTemplate';
|
|
6
7
|
import { WhatsappMeta } from './models/WhatsAppTemplate';
|
|
7
8
|
export interface TemplatePreviewProps {
|
|
8
9
|
template?: AllTemplateTypes;
|
|
@@ -21,5 +22,6 @@ export interface TemplatePreviewProps {
|
|
|
21
22
|
isWhatsappCarousel?: boolean;
|
|
22
23
|
isPreview?: boolean;
|
|
23
24
|
applyBorderBottom?: boolean;
|
|
25
|
+
webPushSpecificMeta?: WebpushMetaType;
|
|
24
26
|
}
|
|
25
|
-
export declare const TemplatePreview: ({ template, channel, whatsAppSpecificMeta, templateCreationsInfo, hideHeader, size, onlyTemplateContent, emailSpecificMeta, smsSpecificMeta, showSampleValues, carouselCardIndex, isWhatsappCarousel, isPreview, applyBorderBottom, }: TemplatePreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const TemplatePreview: ({ template, channel, whatsAppSpecificMeta, templateCreationsInfo, hideHeader, size, onlyTemplateContent, emailSpecificMeta, smsSpecificMeta, showSampleValues, carouselCardIndex, isWhatsappCarousel, isPreview, applyBorderBottom, webPushSpecificMeta }: TemplatePreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -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"),
|
|
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("./webpush/WebpushPreview.js"),d=require("./WhatsAppTemplatePreview.js");const p={WhatsAppWrapper:{backgroundColor:a.COLORS.surface.standard,borderRadius:4,border:`1px solid ${a.COLORS.background.inactive}`,marginTop:16}};exports.TemplatePreview=u=>{let{template:m,channel:c,whatsAppSpecificMeta:v,templateCreationsInfo:h,hideHeader:j,size:C,onlyTemplateContent:b,emailSpecificMeta:S,smsSpecificMeta:g,showSampleValues:y,carouselCardIndex:x,isWhatsappCarousel:T,isPreview:w,applyBorderBottom:O,webPushSpecificMeta:P}=u;var H,f;const{setSelectedCarouselIndex:A}=l.useTemplateModalContext();return c===s.CHANNEL_TYPE.SMS?e.jsx("div",Object.assign({style:Object.assign({marginTop:h?16:0,border:h?`1px solid ${a.COLORS.stroke.primary}`:"none",borderRadius:4},null==g?void 0:g.templateContainerStyles)},{children:e.jsx(r.default,{template:m,hideHeader:j,onlyTemplateContent:b,size:null!=C?C:"large",variableStore:null==g?void 0:g.smsVariableStore,display_content:null==g?void 0:g.smsDisplayContent,uniqueId:null==g?void 0:g.uniqueId})})):c===s.CHANNEL_TYPE.EMAIL?e.jsx("div",Object.assign({style:Object.assign({marginTop:h?16:0},null==S?void 0:S.templateContainerStyles)},{children:e.jsx(n.default,{template:m,handleViewTemplate:()=>{var e;null===(e=null==S?void 0:S.handleViewTemplate)||void 0===e||e.call(S)},hideHeader:j,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,applyBorderBottom:O})})):c===s.CHANNEL_TYPE.WHATSAPP?e.jsxs("div",Object.assign({style:Object.assign(Object.assign({},null==v?void 0:v.templateContainerStyles),h?p.WhatsAppWrapper:{}),onClick:()=>{var e,l;if(A&&T){if(-1===x&&!(null===(l=null===(e=null==m?void 0:m.mapping)||void 0===e?void 0:e.body)||void 0===l?void 0:l.length))return;A(null!=x?x:-1)}}},{children:[h?e.jsx("div",Object.assign({style:{padding:16}},{children:e.jsx(i.TitleRegular,{children:t.default.convertToTitleCase(null!==(H=null==m?void 0:m.label)&&void 0!==H?H:"")})})):e.jsx(e.Fragment,{}),e.jsx(d.default,{showSampleValues:y,showHeader:null==v?void 0:v.showWhatsAppHeader,extras:null==v?void 0:v.whatsAppExtras,template:m,size:h?"small":null!=C?C:"large",containerStyle:Object.assign(Object.assign({borderWidth:h?0:1,borderTopWidth:1},null!==(f=null==v?void 0:v.containerStyle)&&void 0!==f?f:{}),{height:"100%"}),zeroStateComponent:null==v?void 0:v.zeroStateComponent,usePlaceHolderName:null==v?void 0:v.usePlaceHolderName,carouselCardIndex:x,isWhatsappCarousel:T,isPreview:w})]})):c==s.CHANNEL_TYPE.WEBPUSH?e.jsxs("div",Object.assign({style:Object.assign({},null==P?void 0:P.containerStyle)},{children:[e.jsx(o.default,{template:m}),";"]})):e.jsx(e.Fragment,{})};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { CHANNEL_TYPE } from './Channels';
|
|
2
3
|
import { CUSTOM_VARIABLE } from './TemplateMeta';
|
|
3
4
|
import { TEMPLATE_BUTTON, WhatsAppPickerMeta, WhatsAppTemplateVariables } from './WhatsAppTemplate';
|
|
@@ -22,6 +23,9 @@ export type WebpushTemplateType = {
|
|
|
22
23
|
components: WebPushTemplateComponent;
|
|
23
24
|
whatsappSpecificPickerMeta?: WhatsAppPickerMeta;
|
|
24
25
|
};
|
|
26
|
+
export type WebpushMetaType = {
|
|
27
|
+
containerStyle?: React.CSSProperties | undefined;
|
|
28
|
+
};
|
|
25
29
|
export declare enum WEB_PUSH_COMPONENT_TYPE {
|
|
26
30
|
TITLE = "title",
|
|
27
31
|
BODY = "body",
|
|
@@ -3,6 +3,7 @@ import { CHANNEL_TYPE } from './models/Channels';
|
|
|
3
3
|
import { EmailMeta } from './models/EmailTemplate';
|
|
4
4
|
import { SMSMeta } from './models/SmsTemplate';
|
|
5
5
|
import { AllTemplateTypes } from './models/types';
|
|
6
|
+
import { WebpushMetaType } from './models/WebpushTemplate';
|
|
6
7
|
import { WhatsappMeta } from './models/WhatsAppTemplate';
|
|
7
8
|
export interface TemplatePreviewProps {
|
|
8
9
|
template?: AllTemplateTypes;
|
|
@@ -21,5 +22,6 @@ export interface TemplatePreviewProps {
|
|
|
21
22
|
isWhatsappCarousel?: boolean;
|
|
22
23
|
isPreview?: boolean;
|
|
23
24
|
applyBorderBottom?: boolean;
|
|
25
|
+
webPushSpecificMeta?: WebpushMetaType;
|
|
24
26
|
}
|
|
25
|
-
export declare const TemplatePreview: ({ template, channel, whatsAppSpecificMeta, templateCreationsInfo, hideHeader, size, onlyTemplateContent, emailSpecificMeta, smsSpecificMeta, showSampleValues, carouselCardIndex, isWhatsappCarousel, isPreview, applyBorderBottom, }: TemplatePreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const TemplatePreview: ({ template, channel, whatsAppSpecificMeta, templateCreationsInfo, hideHeader, size, onlyTemplateContent, emailSpecificMeta, smsSpecificMeta, showSampleValues, carouselCardIndex, isWhatsappCarousel, isPreview, applyBorderBottom, webPushSpecificMeta }: TemplatePreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -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 i}from"../template-context-mapper/context/templateModalContext.js";import a 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"./webpush/WebpushPreview.js";import m from"./WhatsAppTemplatePreview.js";const u=u=>{let{template:v,channel:h,whatsAppSpecificMeta:b,templateCreationsInfo:y,hideHeader:S,size:g,onlyTemplateContent:C,emailSpecificMeta:j,smsSpecificMeta:f,showSampleValues:w,carouselCardIndex:T,isWhatsappCarousel:W,isPreview:x,applyBorderBottom:O,webPushSpecificMeta:P}=u;var H,A;const{setSelectedCarouselIndex:I}=i();return h===s.SMS?e("div",Object.assign({style:Object.assign({marginTop:y?16:0,border:y?`1px solid ${o.stroke.primary}`:"none",borderRadius:4},null==f?void 0:f.templateContainerStyles)},{children:e(d,{template:v,hideHeader:S,onlyTemplateContent:C,size:null!=g?g:"large",variableStore:null==f?void 0:f.smsVariableStore,display_content:null==f?void 0:f.smsDisplayContent,uniqueId:null==f?void 0:f.uniqueId})})):h===s.EMAIL?e("div",Object.assign({style:Object.assign({marginTop:y?16:0},null==j?void 0:j.templateContainerStyles)},{children:e(r,{template:v,handleViewTemplate:()=>{var e;null===(e=null==j?void 0:j.handleViewTemplate)||void 0===e||e.call(j)},hideHeader:S,hideViewButton:null==j?void 0:j.hideViewButtonForEmail,containerStyle:null==j?void 0:j.containerStyle,emailDisplayContent:null==j?void 0:j.emailDisplayContent,emailHtmlContainerId:null==j?void 0:j.emailHtmlContainerId,applyBorderBottom:O})})):h===s.WHATSAPP?t("div",Object.assign({style:Object.assign(Object.assign({},null==b?void 0:b.templateContainerStyles),y?c.WhatsAppWrapper:{}),onClick:()=>{var e,t;if(I&&W){if(-1===T&&!(null===(t=null===(e=null==v?void 0:v.mapping)||void 0===e?void 0:e.body)||void 0===t?void 0:t.length))return;I(null!=T?T:-1)}}},{children:[y?e("div",Object.assign({style:{padding:16}},{children:e(n,{children:a.convertToTitleCase(null!==(H=null==v?void 0:v.label)&&void 0!==H?H:"")})})):e(l,{}),e(m,{showSampleValues:w,showHeader:null==b?void 0:b.showWhatsAppHeader,extras:null==b?void 0:b.whatsAppExtras,template:v,size:y?"small":null!=g?g:"large",containerStyle:Object.assign(Object.assign({borderWidth:y?0:1,borderTopWidth:1},null!==(A=null==b?void 0:b.containerStyle)&&void 0!==A?A:{}),{height:"100%"}),zeroStateComponent:null==b?void 0:b.zeroStateComponent,usePlaceHolderName:null==b?void 0:b.usePlaceHolderName,carouselCardIndex:T,isWhatsappCarousel:W,isPreview:x})]})):h==s.WEBPUSH?t("div",Object.assign({style:Object.assign({},null==P?void 0:P.containerStyle)},{children:[e(p,{template:v}),";"]})):e(l,{})},c={WhatsAppWrapper:{backgroundColor:o.surface.standard,borderRadius:4,border:`1px solid ${o.background.inactive}`,marginTop:16}};export{u as TemplatePreview};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { CHANNEL_TYPE } from './Channels';
|
|
2
3
|
import { CUSTOM_VARIABLE } from './TemplateMeta';
|
|
3
4
|
import { TEMPLATE_BUTTON, WhatsAppPickerMeta, WhatsAppTemplateVariables } from './WhatsAppTemplate';
|
|
@@ -22,6 +23,9 @@ export type WebpushTemplateType = {
|
|
|
22
23
|
components: WebPushTemplateComponent;
|
|
23
24
|
whatsappSpecificPickerMeta?: WhatsAppPickerMeta;
|
|
24
25
|
};
|
|
26
|
+
export type WebpushMetaType = {
|
|
27
|
+
containerStyle?: React.CSSProperties | undefined;
|
|
28
|
+
};
|
|
25
29
|
export declare enum WEB_PUSH_COMPONENT_TYPE {
|
|
26
30
|
TITLE = "title",
|
|
27
31
|
BODY = "body",
|