@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.
Files changed (107) hide show
  1. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  2. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  3. package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  4. package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  5. package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  6. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
  7. package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
  8. package/dist/cjs/components/carousel-preview/CarouselPreview.d.ts +5 -2
  9. package/dist/cjs/components/carousel-preview/CarouselPreviewCard.js +1 -1
  10. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.d.ts +9 -9
  11. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
  12. package/dist/cjs/components/template-context-mapper/context/templateModalContext.d.ts +13 -11
  13. package/dist/cjs/components/template-context-mapper/index.d.ts +0 -1
  14. package/dist/cjs/components/template-context-mapper/modalElements/Body.d.ts +0 -1
  15. package/dist/cjs/components/template-context-mapper/modalElements/Body.js +9 -9
  16. package/dist/cjs/components/template-context-mapper/modalElements/EditMediaModal.d.ts +0 -1
  17. package/dist/cjs/components/template-context-mapper/modalElements/EditMediaModal.js +1 -1
  18. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
  19. package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.d.ts +5 -2
  20. package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.js +1 -1
  21. package/dist/cjs/components/template-context-mapper/modalElements/TemplateSelectModalContent.d.ts +1 -2
  22. package/dist/cjs/components/template-context-mapper/modalElements/TemplateSelectModalContent.js +1 -1
  23. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.d.ts +1 -2
  24. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.js +4 -4
  25. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.d.ts +4 -6
  26. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
  27. package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  28. package/dist/cjs/components/template-context-mapper/utils/getDataFromTemplateComponent.d.ts +0 -12
  29. package/dist/cjs/components/template-context-mapper/utils/getDataFromTemplateComponent.js +1 -1
  30. package/dist/cjs/components/template-preview/TemplatePreview.d.ts +6 -8
  31. package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
  32. package/dist/cjs/components/template-preview/constants/TemplateConstants.d.ts +0 -2
  33. package/dist/cjs/components/template-preview/constants/TemplateConstants.js +1 -1
  34. package/dist/cjs/components/template-preview/index.d.ts +0 -2
  35. package/dist/cjs/components/template-preview/utils/TemplateHelperUtils.d.ts +0 -2
  36. package/dist/cjs/components/template-preview/utils/TemplateHelperUtils.js +1 -1
  37. package/dist/cjs/components/variable-picker-v3/Content.js +1 -1
  38. package/dist/cjs/components/variable-picker-v3/model.d.ts +0 -1
  39. package/dist/cjs/index.js +1 -1
  40. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  41. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  42. package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  43. package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  44. package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  45. package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
  46. package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
  47. package/dist/esm/components/carousel-preview/CarouselPreview.d.ts +5 -2
  48. package/dist/esm/components/carousel-preview/CarouselPreviewCard.js +1 -1
  49. package/dist/esm/components/template-context-mapper/TemplateContextMapper.d.ts +9 -9
  50. package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
  51. package/dist/esm/components/template-context-mapper/context/templateModalContext.d.ts +13 -11
  52. package/dist/esm/components/template-context-mapper/index.d.ts +0 -1
  53. package/dist/esm/components/template-context-mapper/modalElements/Body.d.ts +0 -1
  54. package/dist/esm/components/template-context-mapper/modalElements/Body.js +8 -8
  55. package/dist/esm/components/template-context-mapper/modalElements/EditMediaModal.d.ts +0 -1
  56. package/dist/esm/components/template-context-mapper/modalElements/EditMediaModal.js +1 -1
  57. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
  58. package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.d.ts +5 -2
  59. package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.js +2 -2
  60. package/dist/esm/components/template-context-mapper/modalElements/TemplateSelectModalContent.d.ts +1 -2
  61. package/dist/esm/components/template-context-mapper/modalElements/TemplateSelectModalContent.js +1 -1
  62. package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.d.ts +1 -2
  63. package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.js +3 -3
  64. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.d.ts +4 -6
  65. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
  66. package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  67. package/dist/esm/components/template-context-mapper/utils/getDataFromTemplateComponent.d.ts +0 -12
  68. package/dist/esm/components/template-context-mapper/utils/getDataFromTemplateComponent.js +1 -1
  69. package/dist/esm/components/template-preview/TemplatePreview.d.ts +6 -8
  70. package/dist/esm/components/template-preview/TemplatePreview.js +1 -1
  71. package/dist/esm/components/template-preview/constants/TemplateConstants.d.ts +0 -2
  72. package/dist/esm/components/template-preview/constants/TemplateConstants.js +1 -1
  73. package/dist/esm/components/template-preview/index.d.ts +0 -2
  74. package/dist/esm/components/template-preview/utils/TemplateHelperUtils.d.ts +0 -2
  75. package/dist/esm/components/template-preview/utils/TemplateHelperUtils.js +1 -1
  76. package/dist/esm/components/variable-picker-v3/Content.js +1 -1
  77. package/dist/esm/components/variable-picker-v3/model.d.ts +0 -1
  78. package/dist/esm/index.js +1 -1
  79. package/package.json +1 -1
  80. package/dist/cjs/components/template-context-mapper/Mocks/constants.d.ts +0 -4364
  81. package/dist/cjs/components/template-context-mapper/helpers/WebpushTemplateHelper.d.ts +0 -57
  82. package/dist/cjs/components/template-context-mapper/helpers/WebpushTemplateHelper.js +0 -1
  83. package/dist/cjs/components/template-context-mapper/modalElements/EditWebpushTemplate.d.ts +0 -10
  84. package/dist/cjs/components/template-context-mapper/modalElements/EditWebpushTemplate.js +0 -1
  85. package/dist/cjs/components/template-preview/models/WebpushTemplate.d.ts +0 -78
  86. package/dist/cjs/components/template-preview/models/WebpushTemplate.js +0 -1
  87. package/dist/cjs/components/template-preview/models/types.d.ts +0 -9
  88. package/dist/cjs/components/template-preview/webpush/WebpushPreview.d.ts +0 -8
  89. package/dist/cjs/components/template-preview/webpush/WebpushPreview.js +0 -1
  90. package/dist/cjs/components/template-preview/webpush/WebpushPreview.styled.d.ts +0 -1
  91. package/dist/cjs/components/template-preview/webpush/WebpushPreview.styled.js +0 -70
  92. package/dist/cjs/utils/variableUtils.d.ts +0 -1
  93. package/dist/cjs/utils/variableUtils.js +0 -1
  94. package/dist/esm/components/template-context-mapper/Mocks/constants.d.ts +0 -4364
  95. package/dist/esm/components/template-context-mapper/helpers/WebpushTemplateHelper.d.ts +0 -57
  96. package/dist/esm/components/template-context-mapper/helpers/WebpushTemplateHelper.js +0 -1
  97. package/dist/esm/components/template-context-mapper/modalElements/EditWebpushTemplate.d.ts +0 -10
  98. package/dist/esm/components/template-context-mapper/modalElements/EditWebpushTemplate.js +0 -1
  99. package/dist/esm/components/template-preview/models/WebpushTemplate.d.ts +0 -78
  100. package/dist/esm/components/template-preview/models/WebpushTemplate.js +0 -1
  101. package/dist/esm/components/template-preview/models/types.d.ts +0 -9
  102. package/dist/esm/components/template-preview/webpush/WebpushPreview.d.ts +0 -8
  103. package/dist/esm/components/template-preview/webpush/WebpushPreview.js +0 -1
  104. package/dist/esm/components/template-preview/webpush/WebpushPreview.styled.d.ts +0 -1
  105. package/dist/esm/components/template-preview/webpush/WebpushPreview.styled.js +0 -70
  106. package/dist/esm/utils/variableUtils.d.ts +0 -1
  107. 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
- 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 as i,CUSTOM_URL_PLACEHOLDER_VAR 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 r=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=s(e,`{{${t}}}`);if(l){const{actualValue:t,defaultValue:e}=l,n="{{custom.text}}"===t||"{{custom.url}}"===t;o.push({editable:n,variableVal:e,editableDefaultValues:e,variableName:t,idx:i})}})),o}(r?e:i,t);if(u.length>0){const t=u[0];return{variableName:t.variableName,isEditableVariable:!0,updatedValue:(null==t?void 0:t.updatedValue)?null==t?void 0:t.updatedValue:r?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("}}"),r=(t,e)=>t&&t.length?t.flatMap(((t,i)=>{var l;return a(t)?t.includes("editableVariable")?(null===(l=null==e?void 0:e[i])||void 0===l?void 0:l.value)||t:n(t).map((t=>`{{${t}}}`))||[]:t})):[];const s=(t,e)=>{for(const i of t)for(const t in i.variables){const l=i.variables[t];if(l.actualValue===e||e.includes("editableVariable")&&l.actualValue.includes("custom.text"))return l}return null};return{processWebpushTemplate:function(s,u,d,p){var b,v,c,m,f,h,g,w;return t(this,void 0,void 0,(function*(){const t=Object.assign({},s);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:V,body:y,buttons:W,icon:k,image:L},webpushBroadcastConfig:j}=t;let x={title:r(null!==(b=null==j?void 0:j.title)&&void 0!==b?b:[]),body:r(null!==(v=null==j?void 0:j.body)&&void 0!==v?v:[],null==y?void 0:y.variables),buttonsW:null!==(c=null==j?void 0:j.buttons)&&void 0!==c?c:[]};if(!t.webpushBroadcastConfig){const e=null!==(m=null==y?void 0:y.text)&&void 0!==m?m:"string"==typeof y?y:"",l=W&&(null==W?void 0:W.length)?W.map((t=>(null==t?void 0:t.websiteLink)==i?null==t?void 0:t.redirectionLink:null==t?void 0:t.websiteLink)).filter((t=>void 0!==t)):[],o=n(e).map(((t,e)=>{var i,l;return t.includes("editableVariable")?(null===(l=null===(i=null==y?void 0:y.variables)||void 0===i?void 0:i[e])||void 0===l?void 0:l.value)||t:`{{${t}}}`}));x={title:n(V).map((t=>`{{${t}}}`)),body:o,buttonsW:[]};const a={title:null!==(f=x.title)&&void 0!==f?f:[],body:null!==(h=x.body)&&void 0!==h?h:[],buttons:l,icon:k?[k]:void 0,image:L?[L]:void 0,redirectionLink:(null==y?void 0:y.redirectionLink)?[null==y?void 0:y.redirectionLink]:[]};t.webpushBroadcastConfig=a}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:x.buttonsW&&x.buttonsW.length?a(x.buttonsW[n])?[""]:[x.buttonsW[n]]:t.redirectionLink?[t.redirectionLink]:void 0,buttonVariable:x.buttonsW&&x.buttonsW.length?a(x.buttonsW[n])?x.buttonsW[n]:l:t.websiteLink?t.websiteLink==i?l:t.websiteLink:l,index:n}))):[],N={title:o(u,x.title,V,p),body:o(u,x.body,(null==y?void 0:y.text)||"",p),buttons:C};return{templateVariableMapping:{title:(null===(g=null==d?void 0:d.title)||void 0===g?void 0:g.length)?d.title:N.title,body:(null===(w=null==d?void 0:d.body)||void 0===w?void 0:w.length)?d.body:N.body,buttons:N.buttons,icon:[],header:[]},webpushBroadcastConfig:t.webpushBroadcastConfig,template:t}}))},isValidUrl:t=>{try{return new URL(t),!0}catch(t){return!1}}}};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,Fragment as i}from"react/jsx-runtime";import{cloneDeep as a}from"lodash";import{useState as n,useEffect as o,useMemo as l,useRef as r}from"react";import{HEADER_TYPES as d}from"../../template-preview/models/TemplateMeta.js";import{useTemplateModalContext as s}from"../context/templateModalContext.js";import p from"../helpers/WebpushTemplateHelper.js";import{getAllDataFromWebpushTemplateComponent as m}from"../utils/getDataFromTemplateComponent.js";import u from"./EditMediaModal.js";import c from"./EditMediaV2.js";import{EditTemplateMediaContainer as h}from"./EditMediaV2.style.js";import{useEditWhatsappTemplateMedia as b}from"./useEditWhtasappTemplateMedia.js";import{Container as g}from"./VariableConnectorsPanel.js";import f from"./VariableConnectorWhatsApp.js";import M from"./VariableEditorHeader.js";import v from"./WhatsAppTemplateCardButtonV2.js";import{Input as C}from"../../input/Input.js";const T=T=>{let{template:E,onTemplateChange:V,whatsappSpecificPickerMeta:j,showVariableModal:x}=T;var L,y,I;const[w,O]=n(null),[k,R]=n(null),{variableList:B,disableEditVariable:A,originalVariableList:U,setOriginalVariableList:W}=s(),{processWebpushTemplate:F,isValidUrl:H}=p(),[D,G]=n(null),[P,S]=n(null),[N,$]=n(null);o((()=>{B&&F(E,B,U,A).then((e=>{let{templateVariableMapping:t,template:i,webpushBroadcastConfig:a}=e;O(t),null==W||W(t),null==V||V(Object.assign({},i)),R(a)}))}),[B,A]);const{descriptionComponents:K,bodyVariables:q,titleVariables:z}=l((()=>{if(w&&k){const e=m(k,w);return D||G(e.iconImage),P||S(e.bannerImage),N||$(e.redirectionLink),{descriptionComponents:e.descriptionComponents,bodyVariables:e.bodyVariables,titleVariables:e.titleVariables}}return{descriptionComponents:[],bodyVariables:[],titleVariables:[],iconImage:null,bannerImage:null}}),[w,k]),{uploadMediaLink:J,uploadMediaFiles:Q,validateMimeType:X}=j,Y=r(null),Z=b({uploadMediaLink:J,uploadMediaFiles:Q,updateTemplateImageUrl:e=>ee(e,"icon"),validateMimeType:X,mediaComponent:D,fileRef:Y}),_=b({uploadMediaLink:J,uploadMediaFiles:Q,updateTemplateImageUrl:e=>ee(e,"image"),validateMimeType:X,mediaComponent:P,fileRef:Y});function ee(e,t){const i=Object.assign({},E),n=a(i);"icon"===t?(n.webpushBroadcastConfig.icon=[e],G([e])):"image"===t&&(n.webpushBroadcastConfig.image=[e],S([e])),null==V||V(Object.assign({},n))}function te(e,t,i){var n;const o=Object.assign({},E),l=a(o),r="custom"===t&&"string"==typeof e,d=null===(n=null==l?void 0:l.webpushBroadcastConfig)||void 0===n?void 0:n.buttons;if(d&&d.length>0){d[i]=r?e:"string"!=typeof e?e.placeHolder:"";const t=Object.assign(Object.assign({},l.webpushBroadcastConfig),{buttons:d});l.webpushBroadcastConfig=t}null==V||V(l)}const ie=Z.openEditMedia?Z:_.openEditMedia?_:null;if(ie)return e(g,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460}},{children:e(u,{mediaComponentFormat:d.IMAGE,uploadMedia:ie.uploadMedia,variableListForImage:[],useEditWhatsappTemplateMediaResponse:ie,setOpenEditMedia:ie.setOpenEditMedia,openEditMedia:ie.openEditMedia,editIconRef:ie.editIconRef,fileRef:Y,skipAddVariable:!0})}));return t(g,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460,minWidth:"auto"}},{children:[D&&D.length?e(h,{children:e(c,{imageName:D,handleImageChange:Z.handleImageChange,mediaType:d.IMAGE,error:Z.error,isLoading:Z.loading,setOpenEditMedia:Z.setOpenEditMedia})}):null,P&&P.length?e(h,{children:e(c,{imageName:P,handleImageChange:_.handleImageChange,mediaType:d.IMAGE,error:_.error,isLoading:_.loading,setOpenEditMedia:_.setOpenEditMedia})}):null,(null==q?void 0:q.length)||(null==z?void 0:z.length)?e(M,{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==K?void 0:K.map(((t,i)=>e(f,{originalVariableList:w,type:t.type,descriptionComponent:t.component,showVariableModal:x},i))),N&&N.length?e("div",Object.assign({style:{padding:"16px 14px"}},{children:e(C,{labelText:"Redirection Link",id:"redirection-link",value:N[0].replace("https://",""),errorMessage:H(N[0])?"":"Please enter a valid URL",maxCharLimit:2e3,noKeyDownChange:!0,state:A?"disabled":"none",prefixText:"https://",placeholder:"Enter custom URL here",onChangeText:e=>{!function(e){var t;const i=`https://${e}`;$([i]);const n=a(E);(null===(t=n.webpushBroadcastConfig)||void 0===t?void 0:t.redirectionLink)&&(n.webpushBroadcastConfig.redirectionLink=[i]),null==V||V(Object.assign({},n))}(e)}})})):e(i,{}),(null===(y=null===(L=null==w?void 0:w.buttons)||void 0===L?void 0:L.filter((e=>"URL"===e.type)))||void 0===y?void 0:y.length)>0&&e(M,{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(v,{variableListIndex:i,CTAoptions:null==j?void 0:j.CTAoptions,button:t,currentVariableList:w,updateSelectedURLTemplateBtn:te},`${i}`)))]}))};export{T as default};
@@ -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
- var i;!function(i){i.TITLE="title",i.BODY="body",i.ICON="icon",i.IMAGE="image",i.BUTTONS="buttons",i.redirectionLink="redirectionLink"}(i||(i={}));export{i 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};