@bikdotai/bik-component-library 0.0.388-beta.7 → 0.0.388-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/template-context-mapper/modalElements/BackTrackComponent.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/BackTrackComponent.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../checkBox/CheckBox.js"),s=require("../../TypographyStyle.js"),a=require("../../input/Input.js");exports.BackTrackComponent=i=>{const{backTrackMessage:n,setBackTrackMessage:c}=i,[l,o]=r.useState(!!n);return e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",marginLeft:10,marginTop:8}},{children:[e.jsx(t.CheckBox,{isChecked:l,onValueChange:()=>{l&&c&&c(""),o(!l)}}),e.jsx(s.TitleSmall,Object.assign({style:{marginLeft:8}},{children:"Prevent BackTracking"}))]})),l&&e.jsx("div",Object.assign({style:{margin:10}},{children:e.jsx(a.Input,{placeholder:"Enter your text here",labelText:"Message if user tries backtracking",onChangeText:e=>{c&&c(e)},height:"120px",value:n,noErrorHint:!0,validate:e=>[!0,""]})}))]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),o=require("../context/templateModalContext.js"),n=require("../utils/getDataFromTemplateComponent.js"),i=require("./BackTrackComponent.js"),a=require("./DiscountCodeComponent.js"),l=require("./EditMediaV2.style.js"),s=require("./EditWhatsAppTemplateMediaV2.js"),d=require("./VariableConnectorsPanel.js"),r=require("./VariableConnectorWhatsApp.js"),u=require("./VariableEditorHeader.js"),c=require("./WhatsAppTemplateCardButtonV2.js");exports.default=p=>{let{template:v,onTemplateChange:m,whatsappSpecificPickerMeta:b,showVariableModal:g,variableList:h,variableListForImage:f,discountCode:j,setDiscountCode:T}=p;var x,C,O,E,y,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),o=require("../context/templateModalContext.js"),n=require("../utils/getDataFromTemplateComponent.js"),i=require("./BackTrackComponent.js"),a=require("./DiscountCodeComponent.js"),l=require("./EditMediaV2.style.js"),s=require("./EditWhatsAppTemplateMediaV2.js"),d=require("./VariableConnectorsPanel.js"),r=require("./VariableConnectorWhatsApp.js"),u=require("./VariableEditorHeader.js"),c=require("./WhatsAppTemplateCardButtonV2.js");exports.default=p=>{let{template:v,onTemplateChange:m,whatsappSpecificPickerMeta:b,showVariableModal:g,variableList:h,variableListForImage:f,discountCode:j,setDiscountCode:T}=p;var x,C,O,E,k,y,B,V,w,L,q,I,M,A,R,U;const{originalVariableList:D,pod:H,extras:S}=o.useTemplateModalContext(),{descriptionComponents:P,urlBtns:N,qrbBtns:Q,imageComponent:_,bodyVariables:F,headerVariables:W}=n.getAllDataFromTemplateComponent(v),[K,Y]=t.useState(!1);function $(e,t){var o,n,i,a,l;const s=Object.assign({},v),d=null==s?void 0:s.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==d&&d>-1){const l=null===(o=null==s?void 0:s.components[d].buttons)||void 0===o?void 0:o.findIndex((e=>"URL"===e.type));if(void 0!==l&&l>-1){const o="custom"===t&&"string"==typeof e,r=[...null!==(a=null===(i=null===(n=s.components)||void 0===n?void 0:n[d])||void 0===i?void 0:i.buttons)&&void 0!==a?a:[]];r[l]=Object.assign(Object.assign({},r[l]),{url:"https://d.bik.ai/{{1}}",example:[o?e:"string"!=typeof e?e.defaultValue:""]});const u=Object.assign(Object.assign({},s.components[d]),{buttons:r}),c=Object.assign(Object.assign({},s.mapping),{buttons:o?["((customBtnPlaceholder))"]:"string"!=typeof e?[e.placeHolder]:void 0});s.mapping=c;const p=[...s.components];p[d]=u,s.components=p}}"string"!=typeof e&&Y("checkout.Url"===(null===(l=e.placeHolder)||void 0===l?void 0:l.slice(2,-2))),null==m||m(s)}function X(e,t,o){var n;const i=Object.assign({},v),a=null==i?void 0:i.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==a&&a>-1){const t=null===(n=null==i?void 0:i.components[a].buttons)||void 0===n?void 0:n.filter((e=>"QUICK_REPLY"===e.type));t&&(t[o]=Object.assign(Object.assign({},t[o]),{flowId:e.flowId,flowName:e.flowName}));const l=Object.assign(Object.assign({},i.components[a]),{buttons:t}),s=[...i.components];s[a]=l,i.components=s}null==m||m(i)}return t.useEffect((()=>{var e;const t=null===(e=v.mapping.buttons)||void 0===e?void 0:e[0];Y("checkout.Url"===(null==t?void 0:t.slice(2,-2)))}),[v]),e.jsxs(d.Container,Object.assign({style:{flexDirection:"column",maxHeight:460}},{children:[!!_&&e.jsx(l.EditTemplateMediaContainer,{children:e.jsx(s.default,{whatsappSpecificPickerMeta:b,mediaComponent:_,updateTemplateImageUrl:function(e,t){var o;let n=Object.assign({},v);const i=null===(o=null==n?void 0:n.components)||void 0===o?void 0:o.findIndex((e=>{if("HEADER"===e.type&&"NONE"!==e.format&&"TEXT"!==e.format)return!0}));if(void 0!==i&&i>-1&&(null==n?void 0:n.components[i])){const o=Object.assign(Object.assign({},n.components[i]),{format:t,example:{header_handle:[e]}}),a=[...n.components];a[i]=o,n=Object.assign(Object.assign({},n),{components:a})}n.mapping&&(n.mapping=Object.assign(Object.assign({},n.mapping),{header:void 0})),null==m||m(Object.assign({},n))},template:v,variableListForImage:f})}),(F.length>0||W.length>0)&&e.jsx(u.default,{containerStyle:{paddingTop:_?24: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==P?void 0:P.map(((t,o)=>e.jsx(r.default,{originalVariableList:D,type:t.type,descriptionComponent:t.component,variableMapping:"HEADER"===t.type?v.mapping.header:v.mapping.body,showVariableModal:g,variableList:h},o))),(null===(C=null===(x=N[0])||void 0===x?void 0:x.component)||void 0===C?void 0:C.buttons)&&(null===(k=null===(E=null===(O=N[0])||void 0===O?void 0:O.component)||void 0===E?void 0:E.buttons)||void 0===k?void 0:k.length)>0&&e.jsx(u.default,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(y=null==D?void 0:D.buttons)||void 0===y?void 0:y.map(((t,o)=>{if("URL"===t.type)return e.jsx(c.default,{CTAoptions:null==b?void 0:b.CTAoptions,button:t,originalVariableList:D,updateSelectedURLTemplateBtn:$},`${o}`)})),(null===(V=null===(B=Q[0])||void 0===B?void 0:B.component)||void 0===V?void 0:V.buttons)&&(null===(q=null===(L=null===(w=Q[0])||void 0===w?void 0:w.component)||void 0===L?void 0:L.buttons)||void 0===q?void 0:q.length)>0&&("CHATBOT"!==H?e.jsx(u.default,{headerText:"Edit buttons",subText:"Edit the chatflows triggered on clicking the buttons",toolTipInfo:"There is an option to trigger chatflows through the buttons which can keep the user engaged"}):e.jsx(i.BackTrackComponent,{backTrackMessage:null===(I=null==S?void 0:S.backTrackExtra)||void 0===I?void 0:I[0],setBackTrackMessage:null===(M=null==S?void 0:S.backTrackExtra)||void 0===M?void 0:M[1]})),null===(A=null==D?void 0:D.buttons)||void 0===A?void 0:A.map(((t,o)=>{if("QUICK_REPLY"===t.type)return e.jsx(c.default,{QRBoptions:null==b?void 0:b.QRBoptions,button:t,originalVariableList:D,updateSelectedQRBTemplateBtn:X},`${o}`)})),"CHATBOT"===H&&K&&e.jsx(a.DiscountCodeComponent,{discountCode:null===(R=null==S?void 0:S.discountCodeExtra)||void 0===R?void 0:R[0],setDiscountCode:null===(U=null==S?void 0:S.discountCodeExtra)||void 0===U?void 0:U[1],variableList:h})]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import{useState as i}from"react";import{CheckBox as a}from"../../checkBox/CheckBox.js";import{TitleSmall as n}from"../../TypographyStyle.js";import{Input as s}from"../../input/Input.js";const c=c=>{const{backTrackMessage:o,setBackTrackMessage:l}=c,[g,m]=i(!!o);return e(r,{children:[e("div",Object.assign({style:{display:"flex",flexDirection:"row",marginLeft:10,marginTop:8}},{children:[t(a,{isChecked:g,onValueChange:()=>{g&&l&&l(""),m(!g)}}),t(n,Object.assign({style:{marginLeft:8}},{children:"Prevent BackTracking"}))]})),g&&t("div",Object.assign({style:{margin:10}},{children:t(s,{placeholder:"Enter your text here",labelText:"Message if user tries backtracking",onChangeText:e=>{l&&l(e)},height:"120px",value:o,noErrorHint:!0,validate:e=>[!0,""]})}))]})};export{c as BackTrackComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useState as e}from"react";import{useTemplateModalContext as
|
|
1
|
+
import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useState as e,useEffect as n}from"react";import{useTemplateModalContext as i}from"../context/templateModalContext.js";import{getAllDataFromTemplateComponent as a}from"../utils/getDataFromTemplateComponent.js";import{BackTrackComponent as l}from"./BackTrackComponent.js";import{DiscountCodeComponent as s}from"./DiscountCodeComponent.js";import{EditTemplateMediaContainer as d}from"./EditMediaV2.style.js";import r from"./EditWhatsAppTemplateMediaV2.js";import{Container as p}from"./VariableConnectorsPanel.js";import c from"./VariableConnectorWhatsApp.js";import u from"./VariableEditorHeader.js";import m from"./WhatsAppTemplateCardButtonV2.js";const v=v=>{let{template:b,onTemplateChange:g,whatsappSpecificPickerMeta:h,showVariableModal:f,variableList:T,variableListForImage:j,discountCode:C,setDiscountCode:O}=v;var x,E,y,k,V,B,w,L,I,A,M,R,U,H,D,S;const{originalVariableList:N,pod:P,extras:Q}=i(),{descriptionComponents:F,urlBtns:W,qrbBtns:_,imageComponent:K,bodyVariables:Y,headerVariables:$}=a(b),[q,X]=e(!1);function z(t,o){var e,n,i,a,l;const s=Object.assign({},b),d=null==s?void 0:s.components.findIndex((t=>"BUTTONS"===t.type));if(void 0!==d&&d>-1){const l=null===(e=null==s?void 0:s.components[d].buttons)||void 0===e?void 0:e.findIndex((t=>"URL"===t.type));if(void 0!==l&&l>-1){const e="custom"===o&&"string"==typeof t,r=[...null!==(a=null===(i=null===(n=s.components)||void 0===n?void 0:n[d])||void 0===i?void 0:i.buttons)&&void 0!==a?a:[]];r[l]=Object.assign(Object.assign({},r[l]),{url:"https://d.bik.ai/{{1}}",example:[e?t:"string"!=typeof t?t.defaultValue:""]});const p=Object.assign(Object.assign({},s.components[d]),{buttons:r}),c=Object.assign(Object.assign({},s.mapping),{buttons:e?["((customBtnPlaceholder))"]:"string"!=typeof t?[t.placeHolder]:void 0});s.mapping=c;const u=[...s.components];u[d]=p,s.components=u}}"string"!=typeof t&&X("checkout.Url"===(null===(l=t.placeHolder)||void 0===l?void 0:l.slice(2,-2))),null==g||g(s)}function G(t,o,e){var n;const i=Object.assign({},b),a=null==i?void 0:i.components.findIndex((t=>"BUTTONS"===t.type));if(void 0!==a&&a>-1){const o=null===(n=null==i?void 0:i.components[a].buttons)||void 0===n?void 0:n.filter((t=>"QUICK_REPLY"===t.type));o&&(o[e]=Object.assign(Object.assign({},o[e]),{flowId:t.flowId,flowName:t.flowName}));const l=Object.assign(Object.assign({},i.components[a]),{buttons:o}),s=[...i.components];s[a]=l,i.components=s}null==g||g(i)}return n((()=>{var t;const o=null===(t=b.mapping.buttons)||void 0===t?void 0:t[0];X("checkout.Url"===(null==o?void 0:o.slice(2,-2)))}),[b]),t(p,Object.assign({style:{flexDirection:"column",maxHeight:460}},{children:[!!K&&o(d,{children:o(r,{whatsappSpecificPickerMeta:h,mediaComponent:K,updateTemplateImageUrl:function(t,o){var e;let n=Object.assign({},b);const i=null===(e=null==n?void 0:n.components)||void 0===e?void 0:e.findIndex((t=>{if("HEADER"===t.type&&"NONE"!==t.format&&"TEXT"!==t.format)return!0}));if(void 0!==i&&i>-1&&(null==n?void 0:n.components[i])){const e=Object.assign(Object.assign({},n.components[i]),{format:o,example:{header_handle:[t]}}),a=[...n.components];a[i]=e,n=Object.assign(Object.assign({},n),{components:a})}n.mapping&&(n.mapping=Object.assign(Object.assign({},n.mapping),{header:void 0})),null==g||g(Object.assign({},n))},template:b,variableListForImage:j})}),(Y.length>0||$.length>0)&&o(u,{containerStyle:{paddingTop:K?24: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==F?void 0:F.map(((t,e)=>o(c,{originalVariableList:N,type:t.type,descriptionComponent:t.component,variableMapping:"HEADER"===t.type?b.mapping.header:b.mapping.body,showVariableModal:f,variableList:T},e))),(null===(E=null===(x=W[0])||void 0===x?void 0:x.component)||void 0===E?void 0:E.buttons)&&(null===(V=null===(k=null===(y=W[0])||void 0===y?void 0:y.component)||void 0===k?void 0:k.buttons)||void 0===V?void 0:V.length)>0&&o(u,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(B=null==N?void 0:N.buttons)||void 0===B?void 0:B.map(((t,e)=>{if("URL"===t.type)return o(m,{CTAoptions:null==h?void 0:h.CTAoptions,button:t,originalVariableList:N,updateSelectedURLTemplateBtn:z},`${e}`)})),(null===(L=null===(w=_[0])||void 0===w?void 0:w.component)||void 0===L?void 0:L.buttons)&&(null===(M=null===(A=null===(I=_[0])||void 0===I?void 0:I.component)||void 0===A?void 0:A.buttons)||void 0===M?void 0:M.length)>0&&("CHATBOT"!==P?o(u,{headerText:"Edit buttons",subText:"Edit the chatflows triggered on clicking the buttons",toolTipInfo:"There is an option to trigger chatflows through the buttons which can keep the user engaged"}):o(l,{backTrackMessage:null===(R=null==Q?void 0:Q.backTrackExtra)||void 0===R?void 0:R[0],setBackTrackMessage:null===(U=null==Q?void 0:Q.backTrackExtra)||void 0===U?void 0:U[1]})),null===(H=null==N?void 0:N.buttons)||void 0===H?void 0:H.map(((t,e)=>{if("QUICK_REPLY"===t.type)return o(m,{QRBoptions:null==h?void 0:h.QRBoptions,button:t,originalVariableList:N,updateSelectedQRBTemplateBtn:G},`${e}`)})),"CHATBOT"===P&&q&&o(s,{discountCode:null===(D=null==Q?void 0:Q.discountCodeExtra)||void 0===D?void 0:D[0],setDiscountCode:null===(S=null==Q?void 0:Q.discountCodeExtra)||void 0===S?void 0:S[1],variableList:T})]}))};export{v as default};
|