@bikdotai/bik-component-library 0.0.575-beta-05 → 0.0.575
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/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/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 -12
- 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/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/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/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 -12
- 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/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 -57
- 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 -78
- 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 -57
- 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 -78
- 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,57 +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
|
-
redirectionLink?: string[] | undefined;
|
|
27
|
-
};
|
|
28
|
-
template: {
|
|
29
|
-
name: string;
|
|
30
|
-
label: string;
|
|
31
|
-
templateId?: string | undefined;
|
|
32
|
-
channel: import("../../template-preview").CHANNEL_TYPE;
|
|
33
|
-
templateCategory: string;
|
|
34
|
-
category: string;
|
|
35
|
-
mapping?: {
|
|
36
|
-
title?: string[] | undefined;
|
|
37
|
-
body?: string[] | undefined;
|
|
38
|
-
buttons?: string[] | undefined;
|
|
39
|
-
icon?: string[] | undefined;
|
|
40
|
-
image?: string[] | undefined;
|
|
41
|
-
} | undefined;
|
|
42
|
-
templateVariables?: import("../../template-preview/models/WebpushTemplate").WebpushTemplateVariables | undefined;
|
|
43
|
-
webpushBroadcastConfig?: {
|
|
44
|
-
title?: string[] | undefined;
|
|
45
|
-
body?: string[] | undefined;
|
|
46
|
-
icon?: string[] | undefined;
|
|
47
|
-
image?: string[] | undefined;
|
|
48
|
-
buttons?: string[] | undefined;
|
|
49
|
-
redirectionLink?: string[] | undefined;
|
|
50
|
-
} | undefined;
|
|
51
|
-
components: WebPushTemplateComponent;
|
|
52
|
-
whatsappSpecificPickerMeta?: import("../../template-preview").WhatsAppPickerMeta | undefined;
|
|
53
|
-
};
|
|
54
|
-
}>;
|
|
55
|
-
isValidUrl: (url: string) => boolean;
|
|
56
|
-
};
|
|
57
|
-
export default useWebPushTemplate;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js");require("../../template-preview/TemplatePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../../constants/Theme.js"),require("../../curtain/CurtainHelper.js"),require("../../variable-picker-v3/model.js"),require("../../template-preview/models/TemplateMeta.js");var t=require("../../template-preview/models/WhatsAppTemplate.js");require("../../template-preview/models/Channels.js");var i=require("../../template-preview/constants/TemplateConstants.js"),l=require("../../../utils/variableUtils.js");exports.default=()=>{function n(e,t,i,n){const r=t.map(((t,r)=>{const u=a(t);if(n)return{variableName:t,isEditableVariable:!1,updatedValue:t,index:r,variableValue:t,type:"string"};const s=function(e,t,i){const n=i&&i.length?i:l.extractVariables(e);if(!n||!n.length)return[];const a=[];return n.forEach(((e,i)=>{const l=o(t,`{{${e}}}`);if(l){const{actualValue:e,defaultValue:t}=l,n="{{custom.text}}"===e||"{{custom.url}}"===e;a.push({editable:n,variableVal:t,editableDefaultValues:t,variableName:e,idx:i})}})),a}(u?t:i,e);if(s.length>0){const e=s[0];return{variableName:e.variableName,isEditableVariable:!0,updatedValue:(null==e?void 0:e.updatedValue)?null==e?void 0:e.updatedValue:u?e.variableName:t,index:r,variableValue:e.variableVal,type:"string"}}return null})).filter((e=>null!==e));return r}const a=e=>e.includes("{{")&&e.includes("}}"),r=(e,t)=>e&&e.length?e.flatMap(((e,i)=>{var n;return a(e)?e.includes("editableVariable")?(null===(n=null==t?void 0:t[i])||void 0===n?void 0:n.value)||e:l.extractVariables(e).map((e=>`{{${e}}}`))||[]:e})):[];const o=(e,t)=>{for(const i of e)for(const e in i.variables){const l=i.variables[e];if(l.actualValue===t||t.includes("editableVariable")&&l.actualValue.includes("custom.text"))return l}return null};return{processWebpushTemplate:function(o,u,s,d){var b,v,c,p,m,h,f,L;return e.__awaiter(this,void 0,void 0,(function*(){const e=Object.assign({},o);e.components=function(e){let t;if("string"==typeof e)try{t=JSON.parse(e)}catch(e){console.error("Error parsing webpush component JSON:",e),t={}}else t=e;return t}(e.components);const{components:{title:V,body:g,buttons:w,icon:y,image:_},webpushBroadcastConfig:C}=e;let x={title:r(null!==(b=null==C?void 0:C.title)&&void 0!==b?b:[]),body:r(null!==(v=null==C?void 0:C.body)&&void 0!==v?v:[],null==g?void 0:g.variables),buttonsW:null!==(c=null==C?void 0:C.buttons)&&void 0!==c?c:[]};if(!e.webpushBroadcastConfig){const t=null!==(p=null==g?void 0:g.text)&&void 0!==p?p:"string"==typeof g?g:"",n=w&&(null==w?void 0:w.length)?w.map((e=>(null==e?void 0:e.websiteLink)==i.CUSTOM_URL_PLACEHOLDER?null==e?void 0:e.redirectionLink:null==e?void 0:e.websiteLink)).filter((e=>void 0!==e)):[],a=l.extractVariables(t).map(((e,t)=>{var i,l;return e.includes("editableVariable")?(null===(l=null===(i=null==g?void 0:g.variables)||void 0===i?void 0:i[t])||void 0===l?void 0:l.value)||e:`{{${e}}}`}));x={title:l.extractVariables(V).map((e=>`{{${e}}}`)),body:a,buttonsW:[]};const r={title:null!==(m=x.title)&&void 0!==m?m:[],body:null!==(h=x.body)&&void 0!==h?h:[],buttons:n,icon:y?[y]:void 0,image:_?[_]:void 0,redirectionLink:(null==g?void 0:g.redirectionLink)?[null==g?void 0:g.redirectionLink]:[]};e.webpushBroadcastConfig=r}const W=w&&w.length?w.map(((e,l)=>({type:t.BUTTON_TYPE.URL,text:null==e?void 0:e.text,url:"https://d.bik.ai/{{1}}",example:x.buttonsW&&x.buttonsW.length?a(x.buttonsW[l])?[""]:[x.buttonsW[l]]:e.redirectionLink?[e.redirectionLink]:void 0,buttonVariable:x.buttonsW&&x.buttonsW.length?a(x.buttonsW[l])?x.buttonsW[l]:i.CUSTOM_URL_PLACEHOLDER_VAR:e.websiteLink?e.websiteLink==i.CUSTOM_URL_PLACEHOLDER?i.CUSTOM_URL_PLACEHOLDER_VAR:e.websiteLink:i.CUSTOM_URL_PLACEHOLDER_VAR,index:l}))):[],k={title:n(u,x.title,V,d),body:n(u,x.body,(null==g?void 0:g.text)||"",d),buttons:W};return{templateVariableMapping:{title:(null===(f=null==s?void 0:s.title)||void 0===f?void 0:f.length)?s.title:k.title,body:(null===(L=null==s?void 0:s.body)||void 0===L?void 0:L.length)?s.body:k.body,buttons:k.buttons,icon:[],header:[]},webpushBroadcastConfig:e.webpushBroadcastConfig,template:e}}))},isValidUrl:e=>{try{return new URL(e),!0}catch(e){return!1}}}};
|
|
@@ -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
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lodash"),a=require("react"),i=require("../../template-preview/models/TemplateMeta.js"),n=require("../context/templateModalContext.js"),l=require("../helpers/WebpushTemplateHelper.js"),o=require("../utils/getDataFromTemplateComponent.js"),s=require("./EditMediaModal.js"),d=require("./EditMediaV2.js"),r=require("./EditMediaV2.style.js"),p=require("./useEditWhtasappTemplateMedia.js"),u=require("./VariableConnectorsPanel.js"),c=require("./VariableConnectorWhatsApp.js"),m=require("./VariableEditorHeader.js"),h=require("./WhatsAppTemplateCardButtonV2.js"),b=require("../../input/Input.js");exports.default=g=>{let{template:f,onTemplateChange:M,whatsappSpecificPickerMeta:j,showVariableModal:E}=g;var x,C,T;const[v,V]=a.useState(null),[y,L]=a.useState(null),{variableList:I,disableEditVariable:w,originalVariableList:O,setOriginalVariableList:q}=n.useTemplateModalContext(),{processWebpushTemplate:R,isValidUrl:A}=l.default(),[k,D]=a.useState(null),[S,B]=a.useState(null),[W,F]=a.useState(null);a.useEffect((()=>{I&&R(f,I,O,w).then((e=>{let{templateVariableMapping:t,template:a,webpushBroadcastConfig:i}=e;V(t),null==q||q(t),null==M||M(Object.assign({},a)),L(i)}))}),[I,w]);const{descriptionComponents:H,bodyVariables:P,titleVariables:U}=a.useMemo((()=>{if(v&&y){const e=o.getAllDataFromWebpushTemplateComponent(y,v);return k||D(e.iconImage),S||B(e.bannerImage),W||F(e.redirectionLink),{descriptionComponents:e.descriptionComponents,bodyVariables:e.bodyVariables,titleVariables:e.titleVariables}}return{descriptionComponents:[],bodyVariables:[],titleVariables:[],iconImage:null,bannerImage:null}}),[v,y]),{uploadMediaLink:_,uploadMediaFiles:G,validateMimeType:Y}=j,N=a.useRef(null),$=p.useEditWhatsappTemplateMedia({uploadMediaLink:_,uploadMediaFiles:G,updateTemplateImageUrl:e=>z(e,"icon"),validateMimeType:Y,mediaComponent:k,fileRef:N}),K=p.useEditWhatsappTemplateMedia({uploadMediaLink:_,uploadMediaFiles:G,updateTemplateImageUrl:e=>z(e,"image"),validateMimeType:Y,mediaComponent:S,fileRef:N});function z(e,a){const i=Object.assign({},f),n=t.cloneDeep(i);"icon"===a?(n.webpushBroadcastConfig.icon=[e],D([e])):"image"===a&&(n.webpushBroadcastConfig.image=[e],B([e])),null==M||M(Object.assign({},n))}function J(e,a,i){var n;const l=Object.assign({},f),o=t.cloneDeep(l),s="custom"===a&&"string"==typeof e,d=null===(n=null==o?void 0:o.webpushBroadcastConfig)||void 0===n?void 0:n.buttons;if(d&&d.length>0){d[i]=s?e:"string"!=typeof e?e.placeHolder:"";const t=Object.assign(Object.assign({},o.webpushBroadcastConfig),{buttons:d});o.webpushBroadcastConfig=t}null==M||M(o)}const Q=$.openEditMedia?$:K.openEditMedia?K:null;if(Q)return e.jsx(u.Container,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460}},{children:e.jsx(s.default,{mediaComponentFormat:i.HEADER_TYPES.IMAGE,uploadMedia:Q.uploadMedia,variableListForImage:[],useEditWhatsappTemplateMediaResponse:Q,setOpenEditMedia:Q.setOpenEditMedia,openEditMedia:Q.openEditMedia,editIconRef:Q.editIconRef,fileRef:N,skipAddVariable:!0})}));return e.jsxs(u.Container,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460,minWidth:"auto"}},{children:[k&&k.length?e.jsx(r.EditTemplateMediaContainer,{children:e.jsx(d.default,{imageName:k,handleImageChange:$.handleImageChange,mediaType:i.HEADER_TYPES.IMAGE,error:$.error,isLoading:$.loading,setOpenEditMedia:$.setOpenEditMedia})}):null,S&&S.length?e.jsx(r.EditTemplateMediaContainer,{children:e.jsx(d.default,{imageName:S,handleImageChange:K.handleImageChange,mediaType:i.HEADER_TYPES.IMAGE,error:K.error,isLoading:K.loading,setOpenEditMedia:K.setOpenEditMedia})}):null,(null==P?void 0:P.length)||(null==U?void 0:U.length)?e.jsx(m.default,{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==H?void 0:H.map(((t,a)=>e.jsx(c.default,{originalVariableList:v,type:t.type,descriptionComponent:t.component,showVariableModal:E},a))),W&&W.length?e.jsx("div",Object.assign({style:{padding:"16px 14px"}},{children:e.jsx(b.Input,{labelText:"Redirection Link",id:"redirection-link",value:W[0].replace("https://",""),errorMessage:A(W[0])?"":"Please enter a valid URL",maxCharLimit:2e3,noKeyDownChange:!0,state:w?"disabled":"none",prefixText:"https://",placeholder:"Enter custom URL here",onChangeText:e=>{!function(e){var a;const i=`https://${e}`;F([i]);const n=t.cloneDeep(f);(null===(a=n.webpushBroadcastConfig)||void 0===a?void 0:a.redirectionLink)&&(n.webpushBroadcastConfig.redirectionLink=[i]),null==M||M(Object.assign({},n))}(e)}})})):e.jsx(e.Fragment,{}),(null===(C=null===(x=null==v?void 0:v.buttons)||void 0===x?void 0:x.filter((e=>"URL"===e.type)))||void 0===C?void 0:C.length)>0&&e.jsx(m.default,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(T=null==v?void 0:v.buttons)||void 0===T?void 0:T.map(((t,a)=>e.jsx(h.default,{variableListIndex:a,CTAoptions:null==j?void 0:j.CTAoptions,button:t,currentVariableList:v,updateSelectedURLTemplateBtn:J},`${a}`)))]}))};
|
|
@@ -1,78 +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
|
-
redirectionLink = "redirectionLink"
|
|
38
|
-
}
|
|
39
|
-
export type WebpushComponentKeyType = {
|
|
40
|
-
type: WEB_PUSH_COMPONENT_TYPE;
|
|
41
|
-
};
|
|
42
|
-
export type WebPushComponentType = {
|
|
43
|
-
text: string;
|
|
44
|
-
redirectionLink?: string;
|
|
45
|
-
websiteLink?: string;
|
|
46
|
-
variables?: {
|
|
47
|
-
name: string;
|
|
48
|
-
value: string;
|
|
49
|
-
}[];
|
|
50
|
-
};
|
|
51
|
-
export type WebPushTemplateComponent = {
|
|
52
|
-
[WEB_PUSH_COMPONENT_TYPE.TITLE]: string;
|
|
53
|
-
[WEB_PUSH_COMPONENT_TYPE.BODY]: WebPushComponentType;
|
|
54
|
-
[WEB_PUSH_COMPONENT_TYPE.ICON]: string;
|
|
55
|
-
[WEB_PUSH_COMPONENT_TYPE.IMAGE]: string;
|
|
56
|
-
[WEB_PUSH_COMPONENT_TYPE.BUTTONS]: WebPushComponentType[];
|
|
57
|
-
[WEB_PUSH_COMPONENT_TYPE.redirectionLink]?: string;
|
|
58
|
-
};
|
|
59
|
-
export interface WebpushTemplateVariables extends WhatsAppTemplateVariables {
|
|
60
|
-
title: CUSTOM_VARIABLE[];
|
|
61
|
-
body: CUSTOM_VARIABLE[];
|
|
62
|
-
buttons: TEMPLATE_BUTTON[];
|
|
63
|
-
image?: CUSTOM_VARIABLE[];
|
|
64
|
-
icon: CUSTOM_VARIABLE[];
|
|
65
|
-
}
|
|
66
|
-
export interface VariableList {
|
|
67
|
-
description: string;
|
|
68
|
-
displayName: string;
|
|
69
|
-
orderId: number;
|
|
70
|
-
variables: Variable;
|
|
71
|
-
}
|
|
72
|
-
export type TemplateVariable = {
|
|
73
|
-
editable: boolean;
|
|
74
|
-
variableName: string;
|
|
75
|
-
variableVal: string;
|
|
76
|
-
editableDefaultValues?: string | null;
|
|
77
|
-
idx: number;
|
|
78
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.WEB_PUSH_COMPONENT_TYPE=void 0,(e=exports.WEB_PUSH_COMPONENT_TYPE||(exports.WEB_PUSH_COMPONENT_TYPE={})).TITLE="title",e.BODY="body",e.ICON="icon",e.IMAGE="image",e.BUTTONS="buttons",e.redirectionLink="redirectionLink";
|
|
@@ -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
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../models/WebpushTemplate.js"),t=require("../utils/TemplateHelperUtils.js"),i=require("./WebpushPreview.styled.js");exports.default=n=>{var l,a,r,E,O,c;const{components:P,webpushBroadcastConfig:_}=n.template,o=(new t.TemplateHelperUtils).parseJsonString(P),T="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",N=(e,s)=>{let t=0;return e?e.replace(/{{(.*?)}}/g,((e,i)=>{const n=i.trim();if(s&&s.length&&t<s.length){const e=s[t];return t++,`${e} `}return`{{${n}}}`})):""},d=N(o[s.WEB_PUSH_COMPONENT_TYPE.TITLE],null==_?void 0:_.title),g=N(null!==(r=null!==(a=null===(l=o[s.WEB_PUSH_COMPONENT_TYPE.BODY])||void 0===l?void 0:l.text)&&void 0!==a?a:o[s.WEB_PUSH_COMPONENT_TYPE.BODY])&&void 0!==r?r:"",null==_?void 0:_.body);return e.jsxs(i.WebpushPreviewContainer,Object.assign({style:Object.assign({},n.extraContainerCss)},{children:[e.jsxs("div",Object.assign({className:"icon--header"},{children:[e.jsx("div",Object.assign({className:"icon-img-container"},{children:e.jsx("img",{src:(null===(E=null==_?void 0:_[s.WEB_PUSH_COMPONENT_TYPE.ICON])||void 0===E?void 0:E.length)?_[s.WEB_PUSH_COMPONENT_TYPE.ICON][0]:o[s.WEB_PUSH_COMPONENT_TYPE.ICON]||T,alt:"icon-image"})})),e.jsxs("div",Object.assign({className:"text--container"},{children:[e.jsx("div",{children:d}),e.jsx("div",Object.assign({style:{marginTop:3}},{children:g}))]}))]})),o[s.WEB_PUSH_COMPONENT_TYPE.IMAGE]&&o[s.WEB_PUSH_COMPONENT_TYPE.IMAGE].length&&e.jsx("div",Object.assign({className:"banner-img-container"},{children:e.jsx("img",{src:(null===(O=null==_?void 0:_[s.WEB_PUSH_COMPONENT_TYPE.IMAGE])||void 0===O?void 0:O.length)?_[s.WEB_PUSH_COMPONENT_TYPE.IMAGE][0]:null!==(c=o[s.WEB_PUSH_COMPONENT_TYPE.IMAGE])&&void 0!==c?c:T,alt:"icon-image"})})),o[s.WEB_PUSH_COMPONENT_TYPE.BUTTONS]&&o[s.WEB_PUSH_COMPONENT_TYPE.BUTTONS].length&&e.jsx("div",Object.assign({className:"button-container "+(1===o[s.WEB_PUSH_COMPONENT_TYPE.BUTTONS].length?"single-button":"")},{children:o[s.WEB_PUSH_COMPONENT_TYPE.BUTTONS].map(((t,i)=>e.jsx("div",Object.assign({className:"each--btn",style:{flex:1===o[s.WEB_PUSH_COMPONENT_TYPE.BUTTONS].length?"0 0 50%":"1"}},{children:e.jsx("div",Object.assign({className:"text-btn"},{children:t.text}))}),`webpush-buttons-${i}`)))}))]}))};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const WebpushPreviewContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../../constants/Theme.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const n=i(e).default.div`
|
|
2
|
-
max-width: 345px;
|
|
3
|
-
min-width: 242px;
|
|
4
|
-
background-color: ${t.COLORS.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
|
-
`;exports.WebpushPreviewContainer=n;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function extractVariables(text: string | string[]): string[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.extractVariables=function(e){if(!e||!e.length)return[];const r=/\{\{(.*?)\}\}/g,t=[],s=e=>{let s;for(;null!==(s=r.exec(e));)t.push(s[1].trim())};return Array.isArray(e)?e.forEach(s):s(e),t};
|