@bikdotai/bik-component-library 0.0.570-beta-28 → 0.0.570
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/assets/icons/halfRectangle.svg.js +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/cjs/components/bik-layout/BikSidebar.js +1 -1
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/cjs/components/carousel-preview/CarouselPreview.d.ts +5 -2
- package/dist/cjs/components/carousel-preview/CarouselPreviewCard.js +1 -1
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.d.ts +9 -9
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/cjs/components/template-context-mapper/context/templateModalContext.d.ts +13 -11
- package/dist/cjs/components/template-context-mapper/index.d.ts +0 -1
- package/dist/cjs/components/template-context-mapper/modalElements/Body.d.ts +0 -1
- package/dist/cjs/components/template-context-mapper/modalElements/Body.js +9 -9
- package/dist/cjs/components/template-context-mapper/modalElements/EditMediaModal.d.ts +0 -1
- package/dist/cjs/components/template-context-mapper/modalElements/EditMediaModal.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.d.ts +5 -2
- package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/TemplateSelectModalContent.d.ts +1 -2
- package/dist/cjs/components/template-context-mapper/modalElements/TemplateSelectModalContent.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.d.ts +1 -2
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.js +4 -4
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.d.ts +4 -6
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
- package/dist/cjs/components/template-context-mapper/utils/getDataFromTemplateComponent.d.ts +0 -11
- package/dist/cjs/components/template-context-mapper/utils/getDataFromTemplateComponent.js +1 -1
- package/dist/cjs/components/template-preview/TemplatePreview.d.ts +6 -8
- package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.js +2 -2
- package/dist/cjs/components/template-preview/WhatsApp/ChatUiV2.js +2 -2
- package/dist/cjs/components/template-preview/constants/TemplateConstants.d.ts +0 -2
- package/dist/cjs/components/template-preview/constants/TemplateConstants.js +1 -1
- package/dist/cjs/components/template-preview/index.d.ts +0 -2
- package/dist/cjs/components/template-preview/utils/TemplateHelperUtils.d.ts +0 -2
- package/dist/cjs/components/template-preview/utils/TemplateHelperUtils.js +1 -1
- package/dist/cjs/components/variable-picker-v3/Content.js +1 -1
- package/dist/cjs/components/variable-picker-v3/model.d.ts +0 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/assets/icons/halfRectangle.svg.js +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/esm/components/bik-layout/BikSidebar.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/esm/components/carousel-preview/CarouselPreview.d.ts +5 -2
- package/dist/esm/components/carousel-preview/CarouselPreviewCard.js +1 -1
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.d.ts +9 -9
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/esm/components/template-context-mapper/context/templateModalContext.d.ts +13 -11
- package/dist/esm/components/template-context-mapper/index.d.ts +0 -1
- package/dist/esm/components/template-context-mapper/modalElements/Body.d.ts +0 -1
- package/dist/esm/components/template-context-mapper/modalElements/Body.js +8 -8
- package/dist/esm/components/template-context-mapper/modalElements/EditMediaModal.d.ts +0 -1
- package/dist/esm/components/template-context-mapper/modalElements/EditMediaModal.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.d.ts +5 -2
- package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.js +2 -2
- package/dist/esm/components/template-context-mapper/modalElements/TemplateSelectModalContent.d.ts +1 -2
- package/dist/esm/components/template-context-mapper/modalElements/TemplateSelectModalContent.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.d.ts +1 -2
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.js +3 -3
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.d.ts +4 -6
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
- package/dist/esm/components/template-context-mapper/utils/getDataFromTemplateComponent.d.ts +0 -11
- package/dist/esm/components/template-context-mapper/utils/getDataFromTemplateComponent.js +1 -1
- package/dist/esm/components/template-preview/TemplatePreview.d.ts +6 -8
- package/dist/esm/components/template-preview/TemplatePreview.js +1 -1
- package/dist/esm/components/template-preview/WhatsApp/ChatUI.js +2 -2
- package/dist/esm/components/template-preview/WhatsApp/ChatUiV2.js +2 -2
- package/dist/esm/components/template-preview/constants/TemplateConstants.d.ts +0 -2
- package/dist/esm/components/template-preview/constants/TemplateConstants.js +1 -1
- package/dist/esm/components/template-preview/index.d.ts +0 -2
- package/dist/esm/components/template-preview/utils/TemplateHelperUtils.d.ts +0 -2
- package/dist/esm/components/template-preview/utils/TemplateHelperUtils.js +1 -1
- package/dist/esm/components/variable-picker-v3/Content.js +1 -1
- package/dist/esm/components/variable-picker-v3/model.d.ts +0 -1
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/template-context-mapper/Mocks/constants.d.ts +0 -4364
- package/dist/cjs/components/template-context-mapper/helpers/WebpushTemplateHelper.d.ts +0 -54
- package/dist/cjs/components/template-context-mapper/helpers/WebpushTemplateHelper.js +0 -1
- package/dist/cjs/components/template-context-mapper/modalElements/EditWebpushTemplate.d.ts +0 -10
- package/dist/cjs/components/template-context-mapper/modalElements/EditWebpushTemplate.js +0 -1
- package/dist/cjs/components/template-preview/models/WebpushTemplate.d.ts +0 -72
- package/dist/cjs/components/template-preview/models/WebpushTemplate.js +0 -1
- package/dist/cjs/components/template-preview/models/types.d.ts +0 -9
- package/dist/cjs/components/template-preview/webpush/WebpushPreview.d.ts +0 -8
- package/dist/cjs/components/template-preview/webpush/WebpushPreview.js +0 -1
- package/dist/cjs/components/template-preview/webpush/WebpushPreview.styled.d.ts +0 -1
- package/dist/cjs/components/template-preview/webpush/WebpushPreview.styled.js +0 -70
- package/dist/cjs/utils/variableUtils.d.ts +0 -1
- package/dist/cjs/utils/variableUtils.js +0 -1
- package/dist/esm/components/template-context-mapper/Mocks/constants.d.ts +0 -4364
- package/dist/esm/components/template-context-mapper/helpers/WebpushTemplateHelper.d.ts +0 -54
- package/dist/esm/components/template-context-mapper/helpers/WebpushTemplateHelper.js +0 -1
- package/dist/esm/components/template-context-mapper/modalElements/EditWebpushTemplate.d.ts +0 -10
- package/dist/esm/components/template-context-mapper/modalElements/EditWebpushTemplate.js +0 -1
- package/dist/esm/components/template-preview/models/WebpushTemplate.d.ts +0 -72
- package/dist/esm/components/template-preview/models/WebpushTemplate.js +0 -1
- package/dist/esm/components/template-preview/models/types.d.ts +0 -9
- package/dist/esm/components/template-preview/webpush/WebpushPreview.d.ts +0 -8
- package/dist/esm/components/template-preview/webpush/WebpushPreview.js +0 -1
- package/dist/esm/components/template-preview/webpush/WebpushPreview.styled.d.ts +0 -1
- package/dist/esm/components/template-preview/webpush/WebpushPreview.styled.js +0 -70
- package/dist/esm/utils/variableUtils.d.ts +0 -1
- package/dist/esm/utils/variableUtils.js +0 -1
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { VariableListInterfaceV2 } from "../../add-variableV2";
|
|
2
|
-
import { AllTemplateVariables, BUTTON_TYPE, CUSTOM_VARIABLE } from "../../template-preview";
|
|
3
|
-
import { WebPushTemplateComponent, WebpushTemplateType } from "../../template-preview/models/WebpushTemplate";
|
|
4
|
-
declare const useWebPushTemplate: () => {
|
|
5
|
-
processWebpushTemplate: (template: WebpushTemplateType, variableList: VariableListInterfaceV2[], originalVar?: AllTemplateVariables, disableEditVariable?: boolean) => Promise<{
|
|
6
|
-
templateVariableMapping: {
|
|
7
|
-
title: any;
|
|
8
|
-
body: any;
|
|
9
|
-
buttons: {
|
|
10
|
-
type: BUTTON_TYPE;
|
|
11
|
-
text: string;
|
|
12
|
-
url: string;
|
|
13
|
-
example: string[] | undefined;
|
|
14
|
-
buttonVariable: string;
|
|
15
|
-
index: number;
|
|
16
|
-
}[];
|
|
17
|
-
icon: CUSTOM_VARIABLE[];
|
|
18
|
-
header: CUSTOM_VARIABLE[];
|
|
19
|
-
};
|
|
20
|
-
webpushBroadcastConfig: {
|
|
21
|
-
title?: string[] | undefined;
|
|
22
|
-
body?: string[] | undefined;
|
|
23
|
-
icon?: string[] | undefined;
|
|
24
|
-
image?: string[] | undefined;
|
|
25
|
-
buttons?: string[] | undefined;
|
|
26
|
-
};
|
|
27
|
-
template: {
|
|
28
|
-
name: string;
|
|
29
|
-
label: string;
|
|
30
|
-
templateId?: string | undefined;
|
|
31
|
-
channel: import("../../template-preview").CHANNEL_TYPE;
|
|
32
|
-
templateCategory: string;
|
|
33
|
-
category: string;
|
|
34
|
-
mapping?: {
|
|
35
|
-
title?: string[] | undefined;
|
|
36
|
-
body?: string[] | undefined;
|
|
37
|
-
buttons?: string[] | undefined;
|
|
38
|
-
icon?: string[] | undefined;
|
|
39
|
-
image?: string[] | undefined;
|
|
40
|
-
} | undefined;
|
|
41
|
-
templateVariables?: import("../../template-preview/models/WebpushTemplate").WebpushTemplateVariables | undefined;
|
|
42
|
-
webpushBroadcastConfig?: {
|
|
43
|
-
title?: string[] | undefined;
|
|
44
|
-
body?: string[] | undefined;
|
|
45
|
-
icon?: string[] | undefined;
|
|
46
|
-
image?: string[] | undefined;
|
|
47
|
-
buttons?: string[] | undefined;
|
|
48
|
-
} | undefined;
|
|
49
|
-
components: WebPushTemplateComponent;
|
|
50
|
-
whatsappSpecificPickerMeta?: import("../../template-preview").WhatsAppPickerMeta | undefined;
|
|
51
|
-
};
|
|
52
|
-
}>;
|
|
53
|
-
};
|
|
54
|
-
export default useWebPushTemplate;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__awaiter as t}from"../../../_virtual/_tslib.js";import"../../template-preview/TemplatePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import"../../../constants/Theme.js";import"../../curtain/CurtainHelper.js";import"../../variable-picker-v3/model.js";import"../../template-preview/models/TemplateMeta.js";import{BUTTON_TYPE as e}from"../../template-preview/models/WhatsAppTemplate.js";import"../../template-preview/models/Channels.js";import{CUSTOM_URL_PLACEHOLDER_VAR as i,CUSTOM_URL_PLACEHOLDER as l}from"../../template-preview/constants/TemplateConstants.js";import{extractVariables as n}from"../../../utils/variableUtils.js";const o=()=>{function o(t,e,i,l){const o=e.map(((e,o)=>{const s=a(e);if(l)return{variableName:e,isEditableVariable:!1,updatedValue:e,index:o,variableValue:e,type:"string"};const u=function(t,e,i){const l=i&&i.length?i:n(t);if(!l||!l.length)return[];const o=[];return l.forEach(((t,i)=>{const l=r(e,`{{${t}}}`);if(l){const{actualValue:t,defaultValue:e,variableText:n}=l;o.push({editable:"editableVariable"===n,variableVal:e,editableDefaultValues:e,variableName:t,idx:i})}})),o}(s?e:i,t);if(u.length>0){const t=u[0];return{variableName:t.variableName,isEditableVariable:!0,updatedValue:s?t.variableName:e,index:o,variableValue:t.variableVal,type:"string"}}return null})).filter((t=>null!==t));return o}const a=t=>t.includes("{{")&&t.includes("}}"),s=t=>t&&t.length?t.flatMap((t=>a(t)?n(t).map((t=>`{{${t}}}`))||[]:t)):[];const r=(t,e)=>{for(const i of t)for(const t in i.variables){const l=i.variables[t];if(l.actualValue===e)return l}return null};return{processWebpushTemplate:function(r,u,p,d){var b,m,v,c,f,h,g,w;return t(this,void 0,void 0,(function*(){const t=Object.assign({},r);t.components=function(t){let e;if("string"==typeof t)try{e=JSON.parse(t)}catch(t){console.error("Error parsing webpush component JSON:",t),e={}}else e=t;return e}(t.components);const{components:{title:y,body:V,buttons:W,icon:j,image:x},webpushBroadcastConfig:k}=t;let L={title:s(null!==(b=null==k?void 0:k.title)&&void 0!==b?b:[]),body:s(null!==(m=null==k?void 0:k.body)&&void 0!==m?m:[]),buttonsW:null!==(v=null==k?void 0:k.buttons)&&void 0!==v?v:[]};if(!t.webpushBroadcastConfig){const e=null!==(c=null==V?void 0:V.text)&&void 0!==c?c:"string"==typeof V?V:"",i=W&&(null==W?void 0:W.length)?W.map((t=>null==t?void 0:t.websiteLink)).filter((t=>void 0!==t)):[];L={title:n(y).map((t=>`{{${t}}}`)),body:n(e).map((t=>`{{${t}}}`)),buttonsW:[]};const l={title:null!==(f=L.title)&&void 0!==f?f:[],body:null!==(h=L.body)&&void 0!==h?h:[],buttons:i,icon:j?[j]:void 0,image:x?[x]:void 0};t.webpushBroadcastConfig=l}const C=W&&W.length?W.map(((t,n)=>({type:e.URL,text:null==t?void 0:t.text,url:"https://d.bik.ai/{{1}}",example:L.buttonsW&&L.buttonsW.length?a(L.buttonsW[n])?[""]:[L.buttonsW[n]]:t.redirectionLink?[t.redirectionLink]:void 0,buttonVariable:L.buttonsW&&L.buttonsW.length?a(L.buttonsW[n])?L.buttonsW[n]:i:t.websiteLink?t.websiteLink==l?i:t.websiteLink:i,index:n}))):[],N={title:o(u,L.title,y,d),body:o(u,L.body,(null==V?void 0:V.text)||"",d),buttons:C};return{templateVariableMapping:{title:(null===(g=null==p?void 0:p.title)||void 0===g?void 0:g.length)?p.title:N.title,body:(null===(w=null==p?void 0:p.body)||void 0===w?void 0:w.length)?p.body:N.body,buttons:N.buttons,icon:[],header:[]},webpushBroadcastConfig:t.webpushBroadcastConfig,template:t}}))}}};export{o as default};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { WebpushTemplateType } from "../../template-preview/models/WebpushTemplate";
|
|
2
|
-
import { WhatsAppPickerMeta } from "../../template-preview/models/WhatsAppTemplate";
|
|
3
|
-
export interface EditWebpushTemplateV2Props {
|
|
4
|
-
whatsappSpecificPickerMeta?: WhatsAppPickerMeta;
|
|
5
|
-
template: WebpushTemplateType;
|
|
6
|
-
onTemplateChange?: (template: WebpushTemplateType) => void;
|
|
7
|
-
showVariableModal?: boolean;
|
|
8
|
-
}
|
|
9
|
-
declare const EditWebpushTemplate: ({ template, onTemplateChange, whatsappSpecificPickerMeta, showVariableModal }: EditWebpushTemplateV2Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export default EditWebpushTemplate;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{cloneDeep as i}from"lodash";import{useState as a,useEffect as o,useMemo as n,useRef as l}from"react";import{HEADER_TYPES as d}from"../../template-preview/models/TemplateMeta.js";import{useTemplateModalContext as r}from"../context/templateModalContext.js";import s from"../helpers/WebpushTemplateHelper.js";import{getAllDataFromWebpushTemplateComponent as p}from"../utils/getDataFromTemplateComponent.js";import m from"./EditMediaModal.js";import u from"./EditMediaV2.js";import{EditTemplateMediaContainer as c}from"./EditMediaV2.style.js";import{useEditWhatsappTemplateMedia as b}from"./useEditWhtasappTemplateMedia.js";import{Container as g}from"./VariableConnectorsPanel.js";import h from"./VariableConnectorWhatsApp.js";import f from"./VariableEditorHeader.js";import M from"./WhatsAppTemplateCardButtonV2.js";const v=v=>{let{template:C,onTemplateChange:T,whatsappSpecificPickerMeta:E,showVariableModal:V}=v;var j,y,I;const[w,x]=a(null),[O,L]=a(null),{variableList:A,disableEditVariable:B,originalVariableList:R,setOriginalVariableList:W}=r(),{processWebpushTemplate:k}=s(),[F,H]=a(null),[U,D]=a(null);o((()=>{A&&k(C,A,R,B).then((e=>{let{templateVariableMapping:t,template:i,webpushBroadcastConfig:a}=e;x(t),null==W||W(t),null==T||T(Object.assign({},i)),L(a)}))}),[A,B]);const{descriptionComponents:G,bodyVariables:S,titleVariables:N}=n((()=>{if(w&&O){const e=p(O,w);return F||H(e.iconImage),U||D(e.bannerImage),{descriptionComponents:e.descriptionComponents,bodyVariables:e.bodyVariables,titleVariables:e.titleVariables}}return{descriptionComponents:[],bodyVariables:[],titleVariables:[],iconImage:null,bannerImage:null}}),[w,O]),{uploadMediaLink:P,uploadMediaFiles:$,validateMimeType:q}=E,z=l(null),J=b({uploadMediaLink:P,uploadMediaFiles:$,updateTemplateImageUrl:e=>Q(e,"icon"),validateMimeType:q,mediaComponent:F,fileRef:z}),K=b({uploadMediaLink:P,uploadMediaFiles:$,updateTemplateImageUrl:e=>Q(e,"image"),validateMimeType:q,mediaComponent:U,fileRef:z});function Q(e,t){const a=Object.assign({},C),o=i(a);"icon"===t?(o.webpushBroadcastConfig.icon=[e],H([e])):"image"===t&&(o.webpushBroadcastConfig.image=[e],D([e])),null==T||T(Object.assign({},o))}function X(e,t,a){var o;const n=Object.assign({},C),l=i(n),d="custom"===t&&"string"==typeof e,r=null===(o=null==l?void 0:l.webpushBroadcastConfig)||void 0===o?void 0:o.buttons;if(r&&r.length>0){r[a]=d?e:"string"!=typeof e?e.placeHolder:"";const t=Object.assign(Object.assign({},l.webpushBroadcastConfig),{buttons:r});l.webpushBroadcastConfig=t}null==T||T(l)}const Y=J.openEditMedia?J:K.openEditMedia?K:null;return Y?e(g,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460}},{children:e(m,{mediaComponentFormat:d.IMAGE,uploadMedia:Y.uploadMedia,variableListForImage:[],useEditWhatsappTemplateMediaResponse:Y,setOpenEditMedia:Y.setOpenEditMedia,openEditMedia:Y.openEditMedia,editIconRef:Y.editIconRef,fileRef:z,skipAddVariable:!0})})):t(g,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460,minWidth:"auto"}},{children:[F&&F.length?e(c,{children:e(u,{imageName:F,handleImageChange:J.handleImageChange,mediaType:d.IMAGE,error:J.error,isLoading:J.loading,setOpenEditMedia:J.setOpenEditMedia})}):null,U&&U.length?e(c,{children:e(u,{imageName:U,handleImageChange:K.handleImageChange,mediaType:d.IMAGE,error:K.error,isLoading:K.loading,setOpenEditMedia:K.setOpenEditMedia})}):null,(null==S?void 0:S.length)||(null==N?void 0:N.length)?e(f,{containerStyle:{paddingTop:8},headerText:"Edit variable values",subText:"Edit values for the variables used in template",toolTipInfo:"Variables are placeholder texts which can either be filled through data or custom texts. These can be edited through the dropdowns below"}):null,null==G?void 0:G.map(((t,i)=>e(h,{originalVariableList:w,type:t.type,descriptionComponent:t.component,showVariableModal:V},i))),(null===(y=null===(j=null==w?void 0:w.buttons)||void 0===j?void 0:j.filter((e=>"URL"===e.type)))||void 0===y?void 0:y.length)>0&&e(f,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(I=null==w?void 0:w.buttons)||void 0===I?void 0:I.map(((t,i)=>e(M,{variableListIndex:i,CTAoptions:null==E?void 0:E.CTAoptions,button:t,currentVariableList:w,updateSelectedURLTemplateBtn:X},`${i}`)))]}))};export{v as default};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Variable } from "../../add-variableV2";
|
|
3
|
-
import { CHANNEL_TYPE } from './Channels';
|
|
4
|
-
import { CUSTOM_VARIABLE } from './TemplateMeta';
|
|
5
|
-
import { TEMPLATE_BUTTON, WhatsAppPickerMeta, WhatsAppTemplateVariables } from './WhatsAppTemplate';
|
|
6
|
-
export type WebpushTemplateType = {
|
|
7
|
-
name: string;
|
|
8
|
-
label: string;
|
|
9
|
-
templateId?: string;
|
|
10
|
-
channel: CHANNEL_TYPE;
|
|
11
|
-
templateCategory: string;
|
|
12
|
-
category: string;
|
|
13
|
-
mapping?: {
|
|
14
|
-
title?: string[];
|
|
15
|
-
body?: string[];
|
|
16
|
-
buttons?: string[];
|
|
17
|
-
icon?: string[];
|
|
18
|
-
image?: string[];
|
|
19
|
-
};
|
|
20
|
-
templateVariables?: WebpushTemplateVariables;
|
|
21
|
-
webpushBroadcastConfig?: {
|
|
22
|
-
[k in WEB_PUSH_COMPONENT_TYPE]?: string[];
|
|
23
|
-
};
|
|
24
|
-
components: WebPushTemplateComponent;
|
|
25
|
-
whatsappSpecificPickerMeta?: WhatsAppPickerMeta;
|
|
26
|
-
};
|
|
27
|
-
export type WebpushMetaType = {
|
|
28
|
-
containerStyle?: React.CSSProperties | undefined;
|
|
29
|
-
extraContainerCss?: React.CSSProperties | undefined;
|
|
30
|
-
};
|
|
31
|
-
export declare enum WEB_PUSH_COMPONENT_TYPE {
|
|
32
|
-
TITLE = "title",
|
|
33
|
-
BODY = "body",
|
|
34
|
-
ICON = "icon",
|
|
35
|
-
IMAGE = "image",
|
|
36
|
-
BUTTONS = "buttons"
|
|
37
|
-
}
|
|
38
|
-
export type WebpushComponentKeyType = {
|
|
39
|
-
type: WEB_PUSH_COMPONENT_TYPE;
|
|
40
|
-
};
|
|
41
|
-
export type WebPushComponentType = {
|
|
42
|
-
text: string;
|
|
43
|
-
redirectionLink?: string;
|
|
44
|
-
websiteLink?: string;
|
|
45
|
-
};
|
|
46
|
-
export type WebPushTemplateComponent = {
|
|
47
|
-
[WEB_PUSH_COMPONENT_TYPE.TITLE]: string;
|
|
48
|
-
[WEB_PUSH_COMPONENT_TYPE.BODY]: WebPushComponentType;
|
|
49
|
-
[WEB_PUSH_COMPONENT_TYPE.ICON]: string;
|
|
50
|
-
[WEB_PUSH_COMPONENT_TYPE.IMAGE]: string;
|
|
51
|
-
[WEB_PUSH_COMPONENT_TYPE.BUTTONS]: WebPushComponentType[];
|
|
52
|
-
};
|
|
53
|
-
export interface WebpushTemplateVariables extends WhatsAppTemplateVariables {
|
|
54
|
-
title: CUSTOM_VARIABLE[];
|
|
55
|
-
body: CUSTOM_VARIABLE[];
|
|
56
|
-
buttons: TEMPLATE_BUTTON[];
|
|
57
|
-
image?: CUSTOM_VARIABLE[];
|
|
58
|
-
icon: CUSTOM_VARIABLE[];
|
|
59
|
-
}
|
|
60
|
-
export interface VariableList {
|
|
61
|
-
description: string;
|
|
62
|
-
displayName: string;
|
|
63
|
-
orderId: number;
|
|
64
|
-
variables: Variable;
|
|
65
|
-
}
|
|
66
|
-
export type TemplateVariable = {
|
|
67
|
-
editable: boolean;
|
|
68
|
-
variableName: string;
|
|
69
|
-
variableVal: string;
|
|
70
|
-
editableDefaultValues?: string | null;
|
|
71
|
-
idx: number;
|
|
72
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t;!function(t){t.TITLE="title",t.BODY="body",t.ICON="icon",t.IMAGE="image",t.BUTTONS="buttons"}(t||(t={}));export{t as WEB_PUSH_COMPONENT_TYPE};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { EmailTemplateType } from './EmailTemplate';
|
|
2
|
-
import { SMSTemplateType } from './SmsTemplate';
|
|
3
|
-
import { CUSTOM_VARIABLE } from './TemplateMeta';
|
|
4
|
-
import { WebpushTemplateType, WebpushTemplateVariables } from './WebpushTemplate';
|
|
5
|
-
import { WhatsAppCarouselTemplate, WhatsAppCarouselTemplateVariables } from './WhatsappCarouselTemplate';
|
|
6
|
-
import { WhatsAppTemplate, WhatsAppTemplateVariables } from './WhatsAppTemplate';
|
|
7
|
-
export type AllTemplateTypes = WhatsAppTemplate | EmailTemplateType | SMSTemplateType | WhatsAppCarouselTemplate | WebpushTemplateType | null;
|
|
8
|
-
export type NonNullTemplateTypes = NonNullable<AllTemplateTypes>;
|
|
9
|
-
export type AllTemplateVariables = CUSTOM_VARIABLE[] | WhatsAppTemplateVariables | WhatsAppCarouselTemplateVariables | WebpushTemplateVariables;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { WebpushTemplateType } from '../models/WebpushTemplate';
|
|
3
|
-
interface WebpushPreviewProps {
|
|
4
|
-
template: WebpushTemplateType;
|
|
5
|
-
extraContainerCss?: React.CSSProperties;
|
|
6
|
-
}
|
|
7
|
-
declare const WebpushPreview: (props: WebpushPreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export default WebpushPreview;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{WEB_PUSH_COMPONENT_TYPE as i}from"../models/WebpushTemplate.js";import{TemplateHelperUtils as n}from"../utils/TemplateHelperUtils.js";import{WebpushPreviewContainer as s}from"./WebpushPreview.styled.js";const a=a=>{var l,o,c,r,d,m;const{components:g,webpushBroadcastConfig:b}=a.template,h=(new n).parseJsonString(g),u="https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F4daae031-3902-4e58-a57c-32f29ea90812?alt=media&token=a7655ba9-6843-47df-91ba-422345e925c3",v=(e,t)=>{let i=0;return e?e.replace(/{{(.*?)}}/g,((e,n)=>{const s=n.trim();if(t&&t.length&&i<t.length){const e=t[i];return i++,e}return`{{${s}}}`})):""},p=v(h[i.TITLE],null==b?void 0:b.title),O=v(null!==(c=null!==(o=null===(l=h[i.BODY])||void 0===l?void 0:l.text)&&void 0!==o?o:h[i.BODY])&&void 0!==c?c:"",null==b?void 0:b.body);return e(s,Object.assign({style:Object.assign({},a.extraContainerCss)},{children:[e("div",Object.assign({className:"icon--header"},{children:[t("div",Object.assign({className:"icon-img-container"},{children:t("img",{src:(null===(r=null==b?void 0:b[i.ICON])||void 0===r?void 0:r.length)?b[i.ICON][0]:h[i.ICON]||u,alt:"icon-image"})})),e("div",Object.assign({className:"text--container"},{children:[t("div",{children:p}),t("div",Object.assign({style:{marginTop:3}},{children:O}))]}))]})),h[i.IMAGE]&&h[i.IMAGE].length&&t("div",Object.assign({className:"banner-img-container"},{children:t("img",{src:(null===(d=null==b?void 0:b[i.IMAGE])||void 0===d?void 0:d.length)?b[i.IMAGE][0]:null!==(m=h[i.IMAGE])&&void 0!==m?m:u,alt:"icon-image"})})),h[i.BUTTONS]&&h[i.BUTTONS].length&&t("div",Object.assign({className:"button-container "+(1===h[i.BUTTONS].length?"single-button":"")},{children:h[i.BUTTONS].map(((e,n)=>t("div",Object.assign({className:"each--btn",style:{flex:1===h[i.BUTTONS].length?"0 0 50%":"1"}},{children:t("div",Object.assign({className:"text-btn"},{children:e.text}))}),`webpush-buttons-${n}`)))}))]}))};export{a as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const WebpushPreviewContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import t from"styled-components";import{COLORS as e}from"../../../constants/Theme.js";const i=t.div`
|
|
2
|
-
max-width: 345px;
|
|
3
|
-
min-width: 242px;
|
|
4
|
-
background-color: ${e.content.primary};
|
|
5
|
-
.icon--header {
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: row;
|
|
8
|
-
justify-content: flex-start;
|
|
9
|
-
align-items: flex-start;
|
|
10
|
-
gap: 10px;
|
|
11
|
-
padding: 10px;
|
|
12
|
-
}
|
|
13
|
-
.icon-img-container {
|
|
14
|
-
border-radius: 4px;
|
|
15
|
-
width: 48px;
|
|
16
|
-
height: 48px;
|
|
17
|
-
}
|
|
18
|
-
.banner-img-container {
|
|
19
|
-
padding: 8px 10px 8px 10px;
|
|
20
|
-
height: 180px;
|
|
21
|
-
}
|
|
22
|
-
.text--container {
|
|
23
|
-
max-width: 180px;
|
|
24
|
-
color: #f0f0f0;
|
|
25
|
-
font-family: Inter;
|
|
26
|
-
font-size: 10.44px;
|
|
27
|
-
font-weight: 400;
|
|
28
|
-
line-height: 15.66px;
|
|
29
|
-
text-align: left;
|
|
30
|
-
}
|
|
31
|
-
img {
|
|
32
|
-
width: 100%;
|
|
33
|
-
height: 100%;
|
|
34
|
-
object-fit: cover;
|
|
35
|
-
border-radius: 3px;
|
|
36
|
-
}
|
|
37
|
-
.button-container {
|
|
38
|
-
display: flex;
|
|
39
|
-
flex-direction: row;
|
|
40
|
-
justify-content: space-between;
|
|
41
|
-
align-items: center;
|
|
42
|
-
padding: 10px;
|
|
43
|
-
gap: 10px;
|
|
44
|
-
}
|
|
45
|
-
.each--btn {
|
|
46
|
-
background-color: #444345;
|
|
47
|
-
color: #f0f0f0;
|
|
48
|
-
display: flex;
|
|
49
|
-
flex-direction: row;
|
|
50
|
-
justify-content: center;
|
|
51
|
-
align-items: center;
|
|
52
|
-
height: 26px;
|
|
53
|
-
flex: 1;
|
|
54
|
-
max-width: 100%;
|
|
55
|
-
}
|
|
56
|
-
.text-btn {
|
|
57
|
-
font-family: Inter;
|
|
58
|
-
font-size: 10.5px;
|
|
59
|
-
font-weight: 500;
|
|
60
|
-
line-height: 13.13px;
|
|
61
|
-
text-align: center;
|
|
62
|
-
white-space: nowrap;
|
|
63
|
-
overflow: hidden;
|
|
64
|
-
text-overflow: ellipsis;
|
|
65
|
-
max-width: 100px;
|
|
66
|
-
}
|
|
67
|
-
.single-button {
|
|
68
|
-
justify-content: flex-end;
|
|
69
|
-
}
|
|
70
|
-
`;export{i as WebpushPreviewContainer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function extractVariables(text: string | string[]): string[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function r(r){if(!r||!r.length)return[];const t=/\{\{(.*?)\}\}/g,e=[],n=r=>{let n;for(;null!==(n=t.exec(r));)e.push(n[1].trim())};return Array.isArray(r)?r.forEach(n):n(r),e}export{r as extractVariables};
|