@bikdotai/bik-component-library 0.0.570-beta-29 → 0.0.571
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/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/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
|
-
"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 a(e,t,i,a){const r=t.map(((t,r)=>{const s=n(t);if(a)return{variableName:t,isEditableVariable:!1,updatedValue:t,index:r,variableValue:t,type:"string"};const u=function(e,t,i){const a=i&&i.length?i:l.extractVariables(e);if(!a||!a.length)return[];const n=[];return a.forEach(((e,i)=>{const l=o(t,`{{${e}}}`);if(l){const{actualValue:e,defaultValue:t,variableText:a}=l;n.push({editable:"editableVariable"===a,variableVal:t,editableDefaultValues:t,variableName:e,idx:i})}})),n}(s?t:i,e);if(u.length>0){const e=u[0];return{variableName:e.variableName,isEditableVariable:!0,updatedValue:s?e.variableName:t,index:r,variableValue:e.variableVal,type:"string"}}return null})).filter((e=>null!==e));return r}const n=e=>e.includes("{{")&&e.includes("}}"),r=e=>e&&e.length?e.flatMap((e=>n(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)return l}return null};return{processWebpushTemplate:function(o,s,u,b){var d,p,v,c,m,f,h,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:g,body:V,buttons:w,icon:_,image:y},webpushBroadcastConfig:C}=e;let x={title:r(null!==(d=null==C?void 0:C.title)&&void 0!==d?d:[]),body:r(null!==(p=null==C?void 0:C.body)&&void 0!==p?p:[]),buttonsW:null!==(v=null==C?void 0:C.buttons)&&void 0!==v?v:[]};if(!e.webpushBroadcastConfig){const t=null!==(c=null==V?void 0:V.text)&&void 0!==c?c:"string"==typeof V?V:"",a=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)):[];x={title:l.extractVariables(g).map((e=>`{{${e}}}`)),body:l.extractVariables(t).map((e=>`{{${e}}}`)),buttonsW:[]};const n={title:null!==(m=x.title)&&void 0!==m?m:[],body:null!==(f=x.body)&&void 0!==f?f:[],buttons:a,icon:_?[_]:void 0,image:y?[y]:void 0};e.webpushBroadcastConfig=n}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?n(x.buttonsW[l])?[""]:[x.buttonsW[l]]:e.redirectionLink?[e.redirectionLink]:void 0,buttonVariable:x.buttonsW&&x.buttonsW.length?n(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}))):[],E={title:a(s,x.title,g,b),body:a(s,x.body,(null==V?void 0:V.text)||"",b),buttons:W};return{templateVariableMapping:{title:(null===(h=null==u?void 0:u.title)||void 0===h?void 0:h.length)?u.title:E.title,body:(null===(L=null==u?void 0:u.body)||void 0===L?void 0:L.length)?u.body:E.body,buttons:E.buttons,icon:[],header:[]},webpushBroadcastConfig:e.webpushBroadcastConfig,template:e}}))}}};
|
|
@@ -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"),l=require("../context/templateModalContext.js"),n=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"),m=require("./VariableConnectorWhatsApp.js"),c=require("./VariableEditorHeader.js"),b=require("./WhatsAppTemplateCardButtonV2.js");exports.default=h=>{let{template:g,onTemplateChange:M,whatsappSpecificPickerMeta:f,showVariableModal:E}=h;var T,j,C;const[v,x]=a.useState(null),[V,y]=a.useState(null),{variableList:I,disableEditVariable:O,originalVariableList:q,setOriginalVariableList:w}=l.useTemplateModalContext(),{processWebpushTemplate:L}=n.default(),[A,R]=a.useState(null),[S,W]=a.useState(null);a.useEffect((()=>{I&&L(g,I,q,O).then((e=>{let{templateVariableMapping:t,template:a,webpushBroadcastConfig:i}=e;x(t),null==w||w(t),null==M||M(Object.assign({},a)),y(i)}))}),[I,O]);const{descriptionComponents:D,bodyVariables:B,titleVariables:H}=a.useMemo((()=>{if(v&&V){const e=o.getAllDataFromWebpushTemplateComponent(V,v);return A||R(e.iconImage),S||W(e.bannerImage),{descriptionComponents:e.descriptionComponents,bodyVariables:e.bodyVariables,titleVariables:e.titleVariables}}return{descriptionComponents:[],bodyVariables:[],titleVariables:[],iconImage:null,bannerImage:null}}),[v,V]),{uploadMediaLink:F,uploadMediaFiles:k,validateMimeType:P}=f,_=a.useRef(null),U=p.useEditWhatsappTemplateMedia({uploadMediaLink:F,uploadMediaFiles:k,updateTemplateImageUrl:e=>Y(e,"icon"),validateMimeType:P,mediaComponent:A,fileRef:_}),G=p.useEditWhatsappTemplateMedia({uploadMediaLink:F,uploadMediaFiles:k,updateTemplateImageUrl:e=>Y(e,"image"),validateMimeType:P,mediaComponent:S,fileRef:_});function Y(e,a){const i=Object.assign({},g),l=t.cloneDeep(i);"icon"===a?(l.webpushBroadcastConfig.icon=[e],R([e])):"image"===a&&(l.webpushBroadcastConfig.image=[e],W([e])),null==M||M(Object.assign({},l))}function N(e,a,i){var l;const n=Object.assign({},g),o=t.cloneDeep(n),s="custom"===a&&"string"==typeof e,d=null===(l=null==o?void 0:o.webpushBroadcastConfig)||void 0===l?void 0:l.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 $=U.openEditMedia?U:G.openEditMedia?G:null;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:$.uploadMedia,variableListForImage:[],useEditWhatsappTemplateMediaResponse:$,setOpenEditMedia:$.setOpenEditMedia,openEditMedia:$.openEditMedia,editIconRef:$.editIconRef,fileRef:_,skipAddVariable:!0})})):e.jsxs(u.Container,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460,minWidth:"auto"}},{children:[A&&A.length?e.jsx(r.EditTemplateMediaContainer,{children:e.jsx(d.default,{imageName:A,handleImageChange:U.handleImageChange,mediaType:i.HEADER_TYPES.IMAGE,error:U.error,isLoading:U.loading,setOpenEditMedia:U.setOpenEditMedia})}):null,S&&S.length?e.jsx(r.EditTemplateMediaContainer,{children:e.jsx(d.default,{imageName:S,handleImageChange:G.handleImageChange,mediaType:i.HEADER_TYPES.IMAGE,error:G.error,isLoading:G.loading,setOpenEditMedia:G.setOpenEditMedia})}):null,(null==B?void 0:B.length)||(null==H?void 0:H.length)?e.jsx(c.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==D?void 0:D.map(((t,a)=>e.jsx(m.default,{originalVariableList:v,type:t.type,descriptionComponent:t.component,showVariableModal:E},a))),(null===(j=null===(T=null==v?void 0:v.buttons)||void 0===T?void 0:T.filter((e=>"URL"===e.type)))||void 0===j?void 0:j.length)>0&&e.jsx(c.default,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(C=null==v?void 0:v.buttons)||void 0===C?void 0:C.map(((t,a)=>e.jsx(b.default,{variableListIndex:a,CTAoptions:null==f?void 0:f.CTAoptions,button:t,currentVariableList:v,updateSelectedURLTemplateBtn:N},`${a}`)))]}))};
|
|
@@ -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
|
-
"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";
|
|
@@ -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};
|