@bikdotai/bik-component-library 0.0.566-beta.883 → 0.0.566-beta.picker.1
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/WhatsAppTextEditor/WhatsAppTextEditor.d.ts +2 -0
- package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditor.js +1 -1
- package/dist/cjs/components/avatar/Avatar.d.ts +0 -19
- package/dist/cjs/components/avatar/Avatar.js +1 -1
- package/dist/cjs/components/avatar/AvatarHelper.d.ts +1 -3
- package/dist/cjs/components/avatar/AvatarHelper.js +1 -1
- package/dist/cjs/components/input-with-vars/InputWithVariables.js +2 -2
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.d.ts +2 -0
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/cjs/components/template-context-mapper/context/templateModalContext.d.ts +3 -0
- package/dist/cjs/components/template-context-mapper/modalElements/Body.js +6 -6
- package/dist/cjs/components/variable-picker-v3/Content.js +1 -1
- package/dist/cjs/components/variable-picker-v3/DefaultVariableContent.d.ts +8 -0
- package/dist/cjs/components/variable-picker-v3/DefaultVariableContent.js +1 -0
- package/dist/cjs/components/variable-picker-v3/model.d.ts +4 -0
- package/dist/cjs/components/variable-picker-v3/styles.d.ts +3 -1
- package/dist/cjs/components/variable-picker-v3/styles.js +4 -4
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditor.d.ts +2 -0
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditor.js +1 -1
- package/dist/esm/components/avatar/Avatar.d.ts +0 -19
- package/dist/esm/components/avatar/Avatar.js +1 -1
- package/dist/esm/components/avatar/AvatarHelper.d.ts +1 -3
- package/dist/esm/components/avatar/AvatarHelper.js +1 -1
- package/dist/esm/components/input-with-vars/InputWithVariables.js +1 -1
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.d.ts +2 -0
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/esm/components/template-context-mapper/context/templateModalContext.d.ts +3 -0
- package/dist/esm/components/template-context-mapper/modalElements/Body.js +1 -1
- package/dist/esm/components/variable-picker-v3/Content.js +1 -1
- package/dist/esm/components/variable-picker-v3/DefaultVariableContent.d.ts +8 -0
- package/dist/esm/components/variable-picker-v3/DefaultVariableContent.js +1 -0
- package/dist/esm/components/variable-picker-v3/model.d.ts +4 -0
- package/dist/esm/components/variable-picker-v3/styles.d.ts +3 -1
- package/dist/esm/components/variable-picker-v3/styles.js +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/assets/icons/facebook_channel.svg.js +0 -1
- package/dist/cjs/assets/icons/gmail.svg.js +0 -1
- package/dist/esm/assets/icons/facebook_channel.svg.js +0 -1
- package/dist/esm/assets/icons/gmail.svg.js +0 -1
|
@@ -12,6 +12,7 @@ export type CustomEditorProps = React.TextareaHTMLAttributes<HTMLTextAreaElement
|
|
|
12
12
|
* Calls only for editor only error, not for errors coming from outside
|
|
13
13
|
*/
|
|
14
14
|
onError?: (err: string) => void;
|
|
15
|
+
onClickVariable?: (variable: string) => void;
|
|
15
16
|
};
|
|
16
17
|
export type CustomEditorRef = {
|
|
17
18
|
addTextOrWrap: (textToAdd: string) => {
|
|
@@ -37,4 +38,5 @@ export declare const WhatsAppTextEditor: React.ForwardRefExoticComponent<React.T
|
|
|
37
38
|
* Calls only for editor only error, not for errors coming from outside
|
|
38
39
|
*/
|
|
39
40
|
onError?: ((err: string) => void) | undefined;
|
|
41
|
+
onClickVariable?: ((variable: string) => void) | undefined;
|
|
40
42
|
} & React.RefAttributes<CustomEditorRef>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("../../assets/icons/info.svg.js"),r=require("../../helpers/BaseWhatsappContentLang.helper.js"),l=require("react"),o=require("../../constants/Theme.js"),i=require("../TypographyStyle.js"),u=require("./CustomEditor.styled.js"),s=require("./WhatsAppTextEditorHeader.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(l);const d="Character limit reached",v=new r.BaseWhatsappContentLangHelper,h={[s.EditorActionTypes.BOLD]:"*",[s.EditorActionTypes.ITALIC]:"_",[s.EditorActionTypes.STRIKETHROUGH]:"~"},p=a.default.forwardRef(((r,c)=>{var a,p,{onChange:f,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("../../assets/icons/info.svg.js"),r=require("../../helpers/BaseWhatsappContentLang.helper.js"),l=require("react"),o=require("../../constants/Theme.js"),i=require("../TypographyStyle.js"),u=require("./CustomEditor.styled.js"),s=require("./WhatsAppTextEditorHeader.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(l);const d="Character limit reached",v=new r.BaseWhatsappContentLangHelper,h={[s.EditorActionTypes.BOLD]:"*",[s.EditorActionTypes.ITALIC]:"_",[s.EditorActionTypes.STRIKETHROUGH]:"~"},p=a.default.forwardRef(((r,c)=>{var a,p,{onChange:f,onClickVariable:g,text:x,RightComponent:j,error:C,limit:m,onError:E,rows:T,actions:O}=r,y=e.__rest(r,["onChange","onClickVariable","text","RightComponent","error","limit","onError","rows","actions"]);const L=l.useRef(null);function S(e){const t=null==L?void 0:L.current;null!=t&&(t.selectionStart?(t.focus(),t.selectionEnd=e):t.focus())}function R(e){var t,n;let r=null!==(n=null===(t=L.current)||void 0===t?void 0:t.value)&&void 0!==n?n:"";if(L.current&&e){const t=L.current.selectionStart,n=L.current.selectionEnd,l=e;if(t===n)return b(l);{r=v.wrappWildcard(t,n,l,r);const e=v.getHTML(r);return L.current.value=r,{text:r,html:e}}}return{text:r,html:r}}function b(e){var t,n;let r=null!==(n=null===(t=L.current)||void 0===t?void 0:t.value)&&void 0!==n?n:"";if(L.current&&e){const t=L.current.selectionStart;if(t===L.current.selectionEnd)return H(e,t)}return{text:r,html:r}}function H(e,t){var n,r;let l=null!==(r=null===(n=L.current)||void 0===n?void 0:n.value)&&void 0!==r?r:"";l=l.slice(0,t)+e+l.slice(t);const o=v.getHTML(l);return L.current.value=l,{text:l,html:o}}return l.useImperativeHandle(c,(()=>({addTextOrWrap:R,addText:b,get(){var e,t;return null!==(t=null===(e=L.current)||void 0===e?void 0:e.value)&&void 0!==t?t:""},setCaretPosition:S}))),l.useEffect((()=>{if(null==L?void 0:L.current){L.current.value=x||"";const e=v.getHTML(x||"");null==f||f(x||"",e)}}),[x]),l.useEffect((()=>{var e,t;(null===(e=null==L?void 0:L.current)||void 0===e?void 0:e.value)&&m&&((null===(t=null==L?void 0:L.current)||void 0===t?void 0:t.value.length)>m?null==E||E(d):null==E||E(null!=C?C:""))}),[null===(a=null==L?void 0:L.current)||void 0===a?void 0:a.value.length]),t.jsxs(u.OuterContainer,{children:[t.jsxs(u.Container,Object.assign({isError:!!C},{children:[t.jsx(s.WhatsAppTextEditorHeader,{actions:O,ref:L,onActionSelect:function(e){if((null==h?void 0:h[e])&&L.current){const t=L.current.selectionStart;if(t===L.current.selectionEnd){H(null==h?void 0:h[e],t);const{text:n,html:r}=H(null==h?void 0:h[e],t);S(t+1),null==f||f(n,r)}else{const{text:t,html:n}=R(null==h?void 0:h[e]);null==f||f(t,n)}}},RightComponent:j,onEmojiClick:function(e){const{text:t,html:n}=b(e);null==f||f(t,n)}}),t.jsx(u.TextSpace,Object.assign({ref:L,onChange:function(e){const t=e.target.value,n=v.getHTML(t);null==f||f(t,n)}},y,{rows:T}))]})),C&&C!==d?t.jsxs("div",Object.assign({style:{display:"flex",gap:6,alignItems:"center"}},{children:[t.jsx(n.default,{width:16,height:16,color:o.COLORS.content.negative}),t.jsx(i.BodyCaption,Object.assign({color:o.COLORS.content.negative},{children:C}))]})):t.jsx(t.Fragment,{children:m&&(null==L?void 0:L.current)?t.jsxs(i.BodyCaption,Object.assign({style:{color:C===d||(null===(p=null==L?void 0:L.current)||void 0===p?void 0:p.value.length)>m?o.COLORS.content.negative:o.COLORS.content.secondary}},{children:[L.current.value.length,"/",m]})):t.jsx(t.Fragment,{})})]})}));p.displayName="WhatsAppTextEditor",exports.WhatsAppTextEditor=p;
|
|
@@ -3,7 +3,6 @@ import { AVATAR_BACKGROUND, AVATAR_TYPES, SIZE } from "./AvatarHelper";
|
|
|
3
3
|
export declare const AVATAR_SIZE_VS_ICON_SIZE_MAP: {
|
|
4
4
|
SMALL: number;
|
|
5
5
|
MEDIUM: number;
|
|
6
|
-
INBOX: number;
|
|
7
6
|
LARGE: number;
|
|
8
7
|
};
|
|
9
8
|
export declare const BACKGROUND_VS_TEXT_COLOR_MAP: {
|
|
@@ -22,23 +21,5 @@ export type AvatarProps = {
|
|
|
22
21
|
color: string;
|
|
23
22
|
}>;
|
|
24
23
|
useNameFallback?: boolean;
|
|
25
|
-
channelName?: MESSAGE_CHANNELS;
|
|
26
|
-
inboxSettings?: {
|
|
27
|
-
isSelected: boolean;
|
|
28
|
-
isComments: boolean;
|
|
29
|
-
};
|
|
30
24
|
};
|
|
31
|
-
export declare const enum MESSAGE_CHANNELS {
|
|
32
|
-
INSTAGRAM = "instagram",
|
|
33
|
-
MESSENGER = "messenger",
|
|
34
|
-
WHATSAPP = "whatsapp",
|
|
35
|
-
GMAIL = "gmail",
|
|
36
|
-
LIVECHAT = "livechat",
|
|
37
|
-
GOOGLE_BUSINESS_CHAT = "gbm",
|
|
38
|
-
SHOPIFY = "shopify",
|
|
39
|
-
FACEBOOK = "facebook",
|
|
40
|
-
EMAIL = "email",
|
|
41
|
-
SMTP = "smtp",
|
|
42
|
-
FACEBOOK_CATALOG = "facebook-catalog"
|
|
43
|
-
}
|
|
44
25
|
export declare const Avatar: React.FC<AvatarProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("./Avatar.styled.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("./Avatar.styled.js"),r=require("./AvatarHelper.js"),i=require("../TypographyStyle.js"),A=require("../../constants/Theme.js");const a={[r.SIZE.SMALL]:16,[r.SIZE.MEDIUM]:20,[r.SIZE.LARGE]:32},o={[r.AVATAR_BACKGROUND.LIGHT]:A.COLORS.content.secondary,[r.AVATAR_BACKGROUND.DARK]:A.COLORS.surface.standard};exports.AVATAR_SIZE_VS_ICON_SIZE_MAP=a,exports.Avatar=A=>{const[c,n]=s.useState(!1),l=()=>{const s=(A.name||"").split(".").join(" ").split(" ").map((e=>e.charAt(0).toUpperCase())).slice(0,2).join("");return A.size===r.SIZE.SMALL?e.jsx(i.BodyTiny,Object.assign({style:{color:o[A.background]}},{children:s})):A.size===r.SIZE.MEDIUM?e.jsx(i.TitleSmall,Object.assign({style:{color:o[A.background]}},{children:s})):A.size===r.SIZE.LARGE?e.jsx(i.TitleMedium,Object.assign({style:{color:o[A.background]}},{children:s})):void 0};return e.jsxs(t.AvatarStyle,Object.assign({type:A.type,size:A.size,background:A.background},{children:[A.type===r.AVATAR_TYPES.IMAGE&&(A.useNameFallback&&!c?e.jsx("img",{alt:"",width:r.AVATAR_SIZE_MAP[A.size],height:r.AVATAR_SIZE_MAP[A.size],style:{borderRadius:"50%",objectFit:"contain"},src:A.photoUrl,onError:()=>{n(!0)}}):A.useNameFallback&&c&&A.name?e.jsx("div",{children:l()}):e.jsx("img",{alt:"",width:r.AVATAR_SIZE_MAP[A.size],height:r.AVATAR_SIZE_MAP[A.size],style:{borderRadius:"50%",objectFit:"contain"},src:A.photoUrl})),A.type===r.AVATAR_TYPES.INITIALS&&e.jsx("div",{children:l()}),A.type===r.AVATAR_TYPES.ICON&&A.icon&&e.jsx(A.icon,{width:a[A.size],height:a[A.size],color:o[A.background]})]}))},exports.BACKGROUND_VS_TEXT_COLOR_MAP=o;
|
|
@@ -6,8 +6,7 @@ export declare enum AVATAR_TYPES {
|
|
|
6
6
|
export declare enum SIZE {
|
|
7
7
|
SMALL = "SMALL",
|
|
8
8
|
MEDIUM = "MEDIUM",
|
|
9
|
-
LARGE = "LARGE"
|
|
10
|
-
INBOX = "INBOX"
|
|
9
|
+
LARGE = "LARGE"
|
|
11
10
|
}
|
|
12
11
|
export declare enum AVATAR_BACKGROUND {
|
|
13
12
|
LIGHT = "LIGHT",
|
|
@@ -17,5 +16,4 @@ export declare const AVATAR_SIZE_MAP: {
|
|
|
17
16
|
SMALL: number;
|
|
18
17
|
MEDIUM: number;
|
|
19
18
|
LARGE: number;
|
|
20
|
-
INBOX: number;
|
|
21
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var A,I
|
|
1
|
+
"use strict";var A,e,I;Object.defineProperty(exports,"__esModule",{value:!0}),exports.AVATAR_TYPES=void 0,(A=exports.AVATAR_TYPES||(exports.AVATAR_TYPES={})).IMAGE="IMAGE",A.INITIALS="INITIALS",A.ICON="ICON",exports.SIZE=void 0,(e=exports.SIZE||(exports.SIZE={})).SMALL="SMALL",e.MEDIUM="MEDIUM",e.LARGE="LARGE",exports.AVATAR_BACKGROUND=void 0,(I=exports.AVATAR_BACKGROUND||(exports.AVATAR_BACKGROUND={})).LIGHT="LIGHT",I.DARK="DARK";const o={[exports.SIZE.SMALL]:24,[exports.SIZE.MEDIUM]:40,[exports.SIZE.LARGE]:64};exports.AVATAR_SIZE_MAP=o;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("../../assets/icons/PlusIcon.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("../../assets/icons/PlusIcon.js"),l=require("react"),r=require("styled-components"),t=require("uuid"),i=require("../../constants/Theme.js"),s=require("../add-variableV2/AddVariableBox.styled.js"),n=require("../floater/floater.js"),u=require("../input/Input.js"),c=require("../TypographyStyle.js"),o=require("../variable-picker-v3/VariablePicker.js"),d=require("../variable-picker-v3/model.js"),v=require("./customPortal.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const b=p(r).default.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
margin-bottom: 12px;
|
|
4
4
|
input {
|
|
5
5
|
color: ${e=>e.isVar?i.COLORS.stroke.brand:"black"};
|
|
6
6
|
}
|
|
7
|
-
`;exports.InputWithVariables=
|
|
7
|
+
`;exports.InputWithVariables=r=>{let{type:i,allowMix:p,onChange:h,prevVariable:x,variablesList:j,onBlur:g,onlyVariables:y,placeHolder:T,showAddButton:f=!0,showHelp:V,errorMessage:k,maxCharLimit:m,noMaxCharCheck:C,labelText:E,labelElement:O,isRequired:S=!1,hintText:q,onEnterPress:P,pickerType:w=d.PickerType.FLOATER,portalElement:R,showVarHeader:F,varHeaderText:A,onPickerToggle:D}=r;const M=l.useRef(),B=l.useRef(!0),I=l.useRef(null),[L,H]=l.useState(!1),[N]=l.useState(t.v4()),[$,z]=l.useState(),[_,K]=l.useState(x),[W,G]=l.useState(!1),[J,Q]=l.useState(!1),[U,X]=l.useState(0);return l.useEffect((()=>{if($&&$.actualValue)if(p){if(K((e=>{return{actualValue:(a=e.actualValue,l=$.actualValue,r=U,a.slice(0,r)+l+a.slice(r)),variableType:"string"};var a,l,r})),I.current){X(I.current.selectionStart);const e=U+$.actualValue.length+2;I.current.setSelectionRange(e,e),X(e)}}else K((e=>({actualValue:$.actualValue,variableType:$.variableType,needsFetching:$.needsFetching})))}),[$]),l.useEffect((()=>{B.current?B.current=!1:h(_)}),[_]),e.jsxs(e.Fragment,{children:[e.jsxs(b,Object.assign({isVar:/^{{.*}}$/.test(_.actualValue),onKeyDown:e=>{console.log("key",e.key),"Enter"===e.key&&(null==P||P(_.actualValue))}},{children:[e.jsx(u.Input,{isRequired:S,hintText:q,type:null!=i?i:"text",id:N,ref:I,skipFocus:!0,isActive:L,value:_.actualValue,validate:e=>[!0,""],errorMessage:k,noMaxCharCheck:C,maxCharLimit:m,labelText:E,labelElement:O,placeholder:T||"Add a value",onClick:e=>{I.current&&X(I.current.selectionStart)},onChangeText:(e,a)=>{if(I.current&&X(I.current.selectionStart),y){const e=(null==a?void 0:a.keyCode)||(null==a?void 0:a.charCode);8!==e&&46!==e||K({actualValue:"",variableType:"string"})}else K(p?{actualValue:e,variableType:"string"}:{actualValue:e.replace(/{{.*}}/,""),variableType:"string"})},onReferenceInit:()=>{},onFocus:e=>{H(!0),Q(!0)},onBlur:e=>{var a,l,r,t,i,s,n;console.log("ee",null===(a=e.relatedTarget)||void 0===a?void 0:a.id),null==g||g(e,_),"addVar"===(null===(l=e.relatedTarget)||void 0===l?void 0:l.id)||"variable-picker-v3"===(null===(r=e.relatedTarget)||void 0===r?void 0:r.id)||(null===(i=null===(t=e.relatedTarget)||void 0===t?void 0:t.className)||void 0===i?void 0:i.includes("accordion"))||"back-btn-v3"===(null===(s=e.relatedTarget)||void 0===s?void 0:s.id)?(I.current&&I.current.focus(),H(!0)):"search-bar-v3-picker"===(null===(n=e.relatedTarget)||void 0===n?void 0:n.id)?H(!0):(H(!1),G(!1),null==D||D(!1),Q(!1))}}),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between"}},{children:[_.actualValue&&V&&e.jsx("div",Object.assign({style:{marginTop:4}},{children:e.jsx(c.BodyCaption,{children:`This value is of type ${_.variableType}`})})),f&&J&&e.jsx("div",Object.assign({style:{marginTop:k||q?"-24px":"0px"}},{children:e.jsx(s.AddVariableStyled,Object.assign({ref:M,id:"addVar",onClick:()=>{G(!W),null==D||D(!W)}},{children:e.jsxs("div",Object.assign({className:"add"},{children:[e.jsx(a.default,{color:"white"}),e.jsx("div",Object.assign({className:"variable"},{children:"Add variable"}))]}))}))}))]}))]})),W&&e.jsx(e.Fragment,{children:w===d.PickerType.EMBEDDED?e.jsx(v.CustomPortal,Object.assign({zIndex:101,element:null!=R?R:document.body},{children:e.jsx(o.VariablePicker,{width:"344px",showHeader:F,headerText:A,onClose:()=>{G(!1),null==D||D(!1)},type:d.PickerType.EMBEDDED,data:j,onSelect:e=>{z(e),G(!1),null==D||D(!1)}})})):e.jsx("div",Object.assign({style:{zIndex:101,position:"relative"}},{children:e.jsx(n.Floater,Object.assign({refElement:M},{children:e.jsx("div",Object.assign({style:{height:500}},{children:e.jsx(o.VariablePicker,{onClose:()=>{G(!1),null==D||D(!1)},type:d.PickerType.FLOATER,data:j,onSelect:e=>{z(e),G(!1),null==D||D(!1)}})}))}))}))})]})};
|
|
@@ -7,6 +7,7 @@ import { EmailTemplateType } from '../template-preview/models/EmailTemplate';
|
|
|
7
7
|
import { SMSTemplateType } from '../template-preview/models/SmsTemplate';
|
|
8
8
|
import { CUSTOM_VARIABLE, GlobalPlaceholderType } from '../template-preview/models/TemplateMeta';
|
|
9
9
|
import { ExtrasWhatsapp, POD, WhatsAppPickerMeta, WhatsAppTemplate, WhatsAppTemplateVariables } from '../template-preview/models/WhatsAppTemplate';
|
|
10
|
+
import { VariableV3 } from '../variable-picker-v3/model';
|
|
10
11
|
export interface TemplateContextMapperProps {
|
|
11
12
|
selectedTemplate: WhatsAppTemplate | EmailTemplateType | SMSTemplateType | WhatsAppCarouselTemplate;
|
|
12
13
|
closeDialog?: () => void;
|
|
@@ -54,5 +55,6 @@ export interface TemplateContextMapperProps {
|
|
|
54
55
|
setFileName?: (name: string) => void;
|
|
55
56
|
hideDeviceContainerInPreview?: boolean;
|
|
56
57
|
maxCharLimit?: number;
|
|
58
|
+
onDefaultVariableSelect?: (variable: VariableV3) => void;
|
|
57
59
|
}
|
|
58
60
|
export declare const TemplateContextMapper: React.FC<TemplateContextMapperProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lodash"),l=require("react"),o=require("../../utils/StringUtils.js"),a=require("../../constants/Theme.js"),r=require("../modals/styledModal.js"),s=require("../template-preview/models/Channels.js"),i=require("../template-preview/models/WhatsAppTemplate.js"),n=require("./context/templateModalContext.js"),d=require("./modalElements/Footer.js"),u=require("./modalElements/TemplateSelectModalContent.js"),c=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=p=>{let{selectedTemplate:v,closeDialog:m,showVariableMapping:h,channel:C,htmlContent:S,templateVariables:b,onTemplateSelect:E,globalPlaceholders:x,showOnlyContent:P,whatsappSpecificPickerMeta:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lodash"),l=require("react"),o=require("../../utils/StringUtils.js"),a=require("../../constants/Theme.js"),r=require("../modals/styledModal.js"),s=require("../template-preview/models/Channels.js"),i=require("../template-preview/models/WhatsAppTemplate.js"),n=require("./context/templateModalContext.js"),d=require("./modalElements/Footer.js"),u=require("./modalElements/TemplateSelectModalContent.js"),c=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=p=>{let{selectedTemplate:v,closeDialog:m,showVariableMapping:h,channel:C,htmlContent:S,templateVariables:b,onTemplateSelect:E,globalPlaceholders:x,showOnlyContent:P,whatsappSpecificPickerMeta:f,zIndex:g,showVariableModal:T,variableList:L,discountCode:I,setDiscountCode:j,onBackPress:y,enabledCustomText:w,variableListForImage:M,showSampleValues:V,disableEditVariable:A,pod:D,extras:k,pickerConf:H,selectedCarouselProducts:N,disableEditExpiry:O,cardWidth:q,onDeleteSelectedProducts:B,fileName:F,setFileName:_,hideDeviceContainerInPreview:W,maxCharLimit:R,onDefaultVariableSelect:Y}=p;var z,$,U,G,J,K,Q,X;l.useEffect((()=>{se(S)}),[S]);const Z=C===s.CHANNEL_TYPE.WHATSAPP&&"CAROUSEL"===(null===($=null===(z=null==v?void 0:v.components)||void 0===z?void 0:z[1])||void 0===$?void 0:$.type),ee=null==v?void 0:v.isProductCarouselType,[te,le]=l.useState(C===s.CHANNEL_TYPE.EMAIL||Z?"desktop":"mobile"),[oe,ae]=l.useState(!1),[re,se]=l.useState(S),[ie,ne]=l.useState(!1),[de,ue]=l.useState([]),[ce,pe]=l.useState({}),[ve,me]=l.useState(v),[he,Ce]=l.useState([]),[Se,be]=l.useState(null),[Ee,xe]=l.useState(!1),[Pe,fe]=l.useState(null!=b?b:[]),[ge,Te]=l.useState(!1),[Le,Ie]=l.useState(Z?(null===(G=null===(U=null==ve?void 0:ve.mapping)||void 0===U?void 0:U.body)||void 0===G?void 0:G.length)?-1:0:-1),[je,ye]=l.useState([]),[we,Me]=l.useState(void 0),Ve=l.useRef(null),[Ae,De]=l.useState(!1),[ke,He]=l.useState(!1),[Ne,Oe]=l.useState(!1),[qe,Be]=l.useState({});l.useEffect((()=>{N?ye(N):ee&&ye([])}),[N]),l.useEffect((()=>{var e;if(!Ee&&ee&&(!N||0===ye.length)){const t=null===(e=null==ve?void 0:ve.components)||void 0===e?void 0:e[1].cards,l=[];null==t||t.forEach((e=>{var t;null===(t=null==e?void 0:e.components)||void 0===t||t.forEach((e=>{var t,o,a;"HEADER"===e.type&&l.push(null!==(a=null===(o=null===(t=e.example)||void 0===t?void 0:t.header_handle)||void 0===o?void 0:o[0])&&void 0!==a?a:"")}))})),Ce(l),xe(!0)}}),[Ee]);const Fe=l.useMemo((()=>c.convertPlaceholdersToBikDropdown(x)),[x]);return l.useEffect((()=>{Me(t.cloneDeep(L))}),[L]),e.jsx(n.TemplateModalContext.Provider,Object.assign({value:{hideFooterButton:Ne,setHideFooterButton:Oe,hideCrossButton:ke,setHideCrossButton:He,variableList:we,setVariableList:Me,variableCallback:Se,setVariableCallback:be,showVariablePicker:oe,setShowVariablePicker:ae,template:ve,setTemplate:me,device:te,setDevice:le,display_content:re,setDisplayContent:se,originalVariableList:Pe,setOriginalVariableList:fe,isError:ie,setIsError:ne,channel:C,globalNormalizedPlaceholders:Fe,templateSelectionTriggered:ge,setTemplateSelectionTriggered:Te,enabledCustomText:w,disableEditVariable:A,pod:D,extras:k,isWhatsappCarousel:Z,selectedCarouselIndex:Le,setSelectedCarouselIndex:Ie,isProductCarouselType:ee,templateErrorIndexes:ce,cardCount:Z?null===(K=null===(J=v.components)||void 0===J?void 0:J[1].cards)||void 0===K?void 0:K.length:void 0,errorIndexes:de,setErrorIndexes:ue,pickerConf:H,carouselProducts:je,setCarouselProducts:ye,disableEditExpiry:O,cardWidth:q,cardImages:he,onDeleteSelectedProducts:B,hideDeviceContainerInPreview:W,sliderRef:Ve,isCarouselHovered:Ae,setIsCarouselHovered:De,maxCharLimit:R,ctaOptionsErrors:qe,setCtaOptionsErrors:Be,onDefaultVariableSelect:Y}},{children:P?e.jsx(u.default,{variableListFromProps:L,channel:s.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(r.StyledModal,Object.assign({hideCrossButton:ke,zIndex:g,centralContainerStyles:{width:Z?900:C===s.CHANNEL_TYPE.EMAIL&&h?1e3:800},open:!0,onClose:()=>{null==m||m()},headingTitle:null==ve?void 0:ve.label,headingSubtitle:C===s.CHANNEL_TYPE.WHATSAPP?`${o.default.capitaliseFirstLetterOfString(null!==(Q=null==ve?void 0:ve.category)&&void 0!==Q?Q:"")} • ${null!==(X=null==ve?void 0:ve.templateCategory)&&void 0!==X?X:""}`:"",onBackPress:()=>{null==y||y()},modalHeaderStyles:{borderBottom:`1px solid ${a.COLORS.stroke.primary}`}},{children:[e.jsx(u.default,{variableListFromProps:L,showSampleValues:V,showVariableMapping:h,channel:C,whatsappSpecificPickerMeta:f,showVariableModal:T,discountCode:I,setDiscountCode:j,variableListForImage:M&&(null==M?void 0:M.length)>0?M:we,fileName:F,setFileName:e=>{null==_||_(e)}}),E?e.jsx(d.default,{isWhatsappCarousel:null!=Z&&Z,onSelect:function(){var e;if((null==je?void 0:je.length)<1&&ee)return void ne(!0);if(Object.keys(qe).length>0&&D!==i.POD.CHATBOT)return void ne(!0);const t=null==E?void 0:E(ve,Pe,null!=re?re:"",je);pe(null!==(e=null==t?void 0:t.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==t?void 0:t.errorIndexes)||(null==t?void 0:t.error)?((null==t?void 0:t.errorIndexes)&&ue(t.errorIndexes),(null==t?void 0:t.error)&&ne(!!(null==t?void 0:t.error))):Te(!0)}}):e.jsx(e.Fragment,{})]}))}))};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VariableV3 } from "../../../helpers";
|
|
1
2
|
import React, { LegacyRef } from 'react';
|
|
2
3
|
import Slider from 'react-slick';
|
|
3
4
|
import { VariableListInterfaceV2 } from "../../add-variableV2";
|
|
@@ -74,6 +75,7 @@ export declare const TemplateModalContext: React.Context<{
|
|
|
74
75
|
setCtaOptionsErrors?: React.Dispatch<React.SetStateAction<{
|
|
75
76
|
[key: string]: string;
|
|
76
77
|
}>> | undefined;
|
|
78
|
+
onDefaultVariableSelect?: ((variable: VariableV3) => void) | undefined;
|
|
77
79
|
}>;
|
|
78
80
|
export declare const useTemplateModalContext: () => {
|
|
79
81
|
hideFooterButton: boolean;
|
|
@@ -140,4 +142,5 @@ export declare const useTemplateModalContext: () => {
|
|
|
140
142
|
setCtaOptionsErrors?: React.Dispatch<React.SetStateAction<{
|
|
141
143
|
[key: string]: string;
|
|
142
144
|
}>> | undefined;
|
|
145
|
+
onDefaultVariableSelect?: ((variable: VariableV3) => void) | undefined;
|
|
143
146
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("../../curtain/CurtainHelper.js");var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("../../curtain/CurtainHelper.js");var a=require("../../variable-picker-v3/model.js"),t=require("lodash"),i=require("react"),l=require("styled-components"),o=require("../../carousel-preview/CarouselPreview.js"),r=require("./EditWhatsAppCarouselTemplateV2.js"),s=require("../../template-preview/models/Channels.js"),n=require("../../TypographyStyle.js"),d=require("../../variable-picker-v3/VariablePicker.js"),c=require("../../../constants/Theme.js"),p=require("../context/templateModalContext.js"),u=require("../utils/constants.js"),h=require("../utils/getVariableNameEmail.js"),m=require("../utils/highlightFor.js"),C=require("./DesktopPreview.js"),v=require("./EditWhatsAppTemplateV2.js"),w=require("./MobilePreview.js"),P=require("./VariableConnectorsPanel.js");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=b(l);const f=x.default.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
// height: 100%;
|
|
4
|
-
`,
|
|
4
|
+
`,g=x.default.div`
|
|
5
5
|
max-width: 450px;
|
|
6
6
|
max-width: ${e=>e.channel===s.CHANNEL_TYPE.EMAIL?"400px":"450px"};
|
|
7
7
|
|
|
8
8
|
height: ${e=>e.channel===s.CHANNEL_TYPE.WHATSAPP?"500px":"475px"};
|
|
9
9
|
overflow-y: auto;
|
|
10
10
|
padding-bottom: 24px;
|
|
11
|
-
border-left: ${
|
|
12
|
-
border-top: ${e=>e.isWhatsappCarousel?`${
|
|
11
|
+
border-left: ${c.COLORS.stroke.primary} 1px solid;
|
|
12
|
+
border-top: ${e=>e.isWhatsappCarousel?`${c.COLORS.stroke.primary} 1px solid`:void 0};
|
|
13
13
|
${e=>!e.showVariableMapping&&"width: 340px; height: 500px"};
|
|
14
|
-
`,
|
|
14
|
+
`,E=x.default.div`
|
|
15
15
|
padding: ${e=>e.isWhatsappCarousel?void 0:e.showOnlyContent?"16px 14px":"16px 32px"};
|
|
16
16
|
flex: 1;
|
|
17
17
|
height: ${e=>e.isWhatsappCarousel||e.hideDeviceContainerInPreview?"500px":"475px"};
|
|
@@ -19,4 +19,4 @@
|
|
|
19
19
|
background-image: ${e=>e.hideDeviceContainerInPreview&&e.channel===s.CHANNEL_TYPE.WHATSAPP?`url(${u.BACKGROUND_PREVIEW_IMAGE});`:"none"};
|
|
20
20
|
display: ${e=>e.hideDeviceContainerInPreview&&e.channel===s.CHANNEL_TYPE.WHATSAPP?"flex":"initial"};
|
|
21
21
|
align-items: flex-start;
|
|
22
|
-
`;exports.default=l=>{const{showVariableMapping:u,showOnlyContent:
|
|
22
|
+
`;exports.default=l=>{const{showVariableMapping:u,showOnlyContent:b,whatsappSpecificPickerMeta:x,showVariableModal:j,discountCode:A,setDiscountCode:y,variableListForImage:N,showSampleValues:S,variableListFromProps:T,fileName:L,setFileName:k}=l,V=i.useRef(),M=i.useRef(),{variableList:_,setVariableList:H,variableCallback:q,showVariablePicker:O,setShowVariablePicker:W,device:D,display_content:I,channel:F,template:Y,setTemplate:B,isWhatsappCarousel:$,isProductCarouselType:R,hideDeviceContainerInPreview:G,onDefaultVariableSelect:K}=p.useTemplateModalContext();const U=e=>{let a=0;for(;e;)a+=e.offsetTop,e=e.offsetParent;return a};return e.jsxs(f,{children:[e.jsx(E,Object.assign({showOnlyContent:b,showVariableMapping:u,isWhatsappCarousel:$,hideDeviceContainerInPreview:G,channel:F},{children:"mobile"===D?e.jsx(w.default,{ref:M,display_content:null!=I?I:"",channel:F,template:Y,showSampleValues:S}):F===s.CHANNEL_TYPE.WHATSAPP&&$?e.jsx(o.CarouselPreview,{ref:V,channel:F,template:Y,showSampleValues:S,isPreview:!1,showArrows:!0}):F!==s.CHANNEL_TYPE.MESSAGE?e.jsx(C.default,{ref:V,channel:F,display_content:null!=I?I:"",showSampleValues:S}):e.jsx(e.Fragment,{})})),(R||u)&&e.jsxs(g,Object.assign({channel:F,isWhatsappCarousel:$,showVariableMapping:!0},{children:[e.jsx("div",Object.assign({style:{height:"100%",width:"whatsapp"===F?428:400,display:O?"block":"none"}},{children:e.jsx(d.VariablePicker,{hideHeaderCross:!0,showHeader:!0,showBackButton:!0,onBackButtonClick:()=>{H(t.cloneDeep(T)),W(!1)},onSelect:e=>{q(e),H(t.cloneDeep(T)),W(!1)},type:a.PickerType.EMBEDDED,data:null!=_?_:[],onDefaultVariableSelect:K},Math.random())})),e.jsx("div",Object.assign({style:{padding:"16px 14px",width:"whatsapp"===F?428:400,display:O?"none":"block"}},{children:F!==s.CHANNEL_TYPE.WHATSAPP?e.jsx(P.default,{onFocus:F===s.CHANNEL_TYPE.EMAIL?function(e){var a,t,i;const l=null===document||void 0===document?void 0:document.getElementById("mobile"===D?"template_html_mobile":"template_html_desktop"),o=h.getVariableNameForEmailByIndex(e+1),r=F===s.CHANNEL_TYPE.EMAIL?null===(a=null==l?void 0:l.contentWindow)||void 0===a?void 0:a.document.getElementById(o):document.getElementById(o),n=U(r),d=null==r?void 0:r.offsetLeft;"desktop"===D?n&&V.current&&(null===(t=null==l?void 0:l.contentWindow)||void 0===t||t.scrollTo(null!=d?d:0,n),m.highlightFor(o,c.COLORS.background.warning.light,2,F,D)):n&&M.current&&(null===(i=null==l?void 0:l.contentWindow)||void 0===i||i.scrollTo(null!=d?d:0,n),m.highlightFor(o,c.COLORS.background.warning.light,2,F,D))}:void 0,showVariableModal:j,discountCode:A,setDiscountCode:y}):F===s.CHANNEL_TYPE.WHATSAPP&&$?e.jsx(r.default,{whatsappSpecificPickerMeta:x,template:Y,showVariableModal:j,variableListForImage:N,discountCode:A,setDiscountCode:y}):e.jsx(v.default,{whatsappSpecificPickerMeta:x,template:Y,onTemplateChange:e=>{null==B||B(e)},showVariableModal:j,variableListForImage:N,discountCode:A,setDiscountCode:y,fileName:L,setFileName:k})}))]})),[s.CHANNEL_TYPE.WHATSAPP,s.CHANNEL_TYPE.SMS].includes(F)&&!u&&!R&&e.jsx(g,{children:e.jsx(n.BodySecondary,Object.assign({color:c.COLORS.content.secondary,style:{fontStyle:"italic"}},{children:"Click on ‘Select template’ below to use it"}))})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_back.svg.js"),a=require("../../assets/icons/cross.svg.js"),i=require("../../assets/icons/plus.svg.js"),l=require("../../assets/icons/triangle_error.svg.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_back.svg.js"),a=require("../../assets/icons/cross.svg.js"),i=require("../../assets/icons/plus.svg.js"),l=require("../../assets/icons/triangle_error.svg.js"),r=require("react"),n=require("../../constants/Theme.js"),o=require("../accordion/Accordion.js"),c=require("../icon-button/IconButton.js"),d=require("../input/Input.js"),u=require("../list-item/ListItem.js"),h=require("../switch/Switch.js"),b=require("../tooltips/Tooltip.js"),j=require("../TypographyStyle.js"),p=require("./context.js"),g=require("./DefaultVariableContent.js"),x=require("./model.js"),y=require("./NoResult.js"),m=require("./recommendVaribles.js"),f=require("./searchVariables.js"),v=require("./styles.js"),O=require("./SubHeaderItems.js");const S=(e,t)=>{if(0===t.length)return e;const a=e.toLowerCase().indexOf(t.toLowerCase());if(-1===a)return e;const i=e.slice(0,a),l=e.slice(a,a+t.length),r=e.slice(a+t.length);return s.jsxs("span",{children:[i,s.jsx("b",Object.assign({style:{color:n.COLORS.content.primary}},{children:l})),r]})},C=/.*\..*/;exports.VariablePickerContent=V=>{const{data:w,onSelect:R,showHeader:k,showBackButton:q,hideHeaderCross:T,onBackButtonClick:B,isEvaluationList:I,autoOpenFirst:L,headerText:N,contentHeight:D,onDefaultVariableSelect:_}=V,[E,H]=r.useState(w),[P,$]=r.useState(""),[F,A]=r.useState([]),[M,W]=r.useState(""),[z,K]=r.useState(!1),[G,J]=r.useState([]),[Q,U]=r.useState(!1),[X,Y]=r.useState(),Z=Q&&V.type===x.PickerType.EMBEDDED&&!T;r.useEffect((()=>{ee(!0)}),[]),r.useEffect((()=>{F.length>0?J([F[F.length-1]]):J(w)}),[F]);const ee=s=>e.__awaiter(void 0,void 0,void 0,(function*(){if(K(s),s){const e=m.showOnlyRecommendedVariables(E,F);H(e)}else if(F.length>0){const e=M==F[F.length-1].displayName;if(P.length>0&&e){const e=f.searchVariables(P,G,F);H(e)}else H([F[F.length-1].variables])}else if(P.length>0){const e=f.searchVariables(P,G,F);H(e)}else H(w)})),se=()=>{if(D)return D;let e=131;return F.length>0&&(e+=32),(V.showHeader||V.showBackButton)&&(e+=40),`calc(100% - ${e}px)`},te=e=>{if(!V.disabled)if(I){const s=(e=>{if(e.actualValue.match(C)){const s=e.actualValue.replace("{{","").replace("}}","").split(".");let t=s[0];return s.forEach(((e,s)=>{if(0===s)return;const a=(e=>/\w+\[\d+\]/g.test(e))(e);if(a){const s=e.match(/(\w+)\[(\d+)\]/);if(s){const e=s[1],a=s[2];t+=`['${e}'][${a}]`}}else t+=`['${e}']`})),t}return e.actualValueEval?e.actualValueEval:e.actualValue})(e);R(Object.assign(Object.assign({},e),{actualValue:s}))}else{if(e.isDefaultValueSupported)return Y(e),void U(!0);R(e)}};return s.jsx(p.VariablePickerContext.Provider,Object.assign({value:{variables:E,searchText:P,subHeaderStack:F,showRecommended:z,setSubHeaderStack:A,setSearchText:$,setVariables:H,setShowRecommended:K}},{children:s.jsxs("div",Object.assign({tabIndex:-1,id:"variable-picker-v3",style:{backgroundColor:"white",borderRadius:4,height:"100%",outline:"none"},onClick:e=>e.stopPropagation()},{children:[(k||q||Q)&&s.jsxs(v.HeaderWrapper,Object.assign({openDefault:Q},{children:[s.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[(q||Q)&&s.jsx(c.IconButton,{Icon:()=>s.jsx(t.default,{width:16,height:16,style:{display:"flex",color:n.COLORS.content.primary}}),onClick:()=>{Q?Q&&U(!1):B&&B()}}),(k||Q)&&s.jsx(j.TitleRegular,{children:Q?"Set up":null!=N?N:"Select Variable"})]})),Z&&s.jsx(c.IconButton,{style:{color:"#212121"},Icon:a.default,onClick:()=>V.onClose&&V.onClose()})]})),Q&&X?s.jsx(g.DefaultVariableContent,{variable:X,onInsertVariable:e=>{R(e),null==_||_(e),console.log("insert",e)}}):s.jsxs(s.Fragment,{children:[s.jsx("div",Object.assign({style:{padding:"0 16px",paddingTop:12,backgroundColor:n.COLORS.surface.subdued,borderTopLeftRadius:4,borderTopRightRadius:4}},{children:s.jsx(d.Input,{id:"search-bar-v3-picker",onBlur:e=>{V.onSearchBlur&&V.onSearchBlur(e)},value:P,noKeyDownChange:!0,placeholder:"Search",onChangeText:e=>{e||W("");const s=f.searchVariables(e,G,F);if(z){const e=m.showOnlyRecommendedVariables(s,F);H(e)}else H(s);$(e);const t=F.length>0?F[F.length-1].displayName:"home";W(t)}})})),s.jsxs(v.RecommendWrapper,{children:[s.jsx(j.BodySecondary,Object.assign({style:{color:n.COLORS.content.secondary}},{children:"Only Recommended"})),s.jsx(h.Switch,{value:z,onValueChange:s=>e.__awaiter(void 0,void 0,void 0,(function*(){yield ee(s)}))})]}),F.length>0&&s.jsxs(v.BackHeader,{children:[s.jsx("div",Object.assign({style:{position:"absolute",left:16}},{children:s.jsx(c.IconButton,{id:"back-btn-v3",style:{display:"flex"},Icon:()=>s.jsx(t.default,{width:12,height:12,style:{color:n.COLORS.content.secondary}}),onClick:e=>{e.stopPropagation();let s=P;const t=[...F],a=t.pop();if(A(t),a.displayName===M&&($(""),s=""),s.length>0){const e=t.length>0?[t[t.length-1]]:w,a=f.searchVariables(s,e,t);if(z){const e=m.showOnlyRecommendedVariables(a,t);H(e)}else H(a)}else if(t.length>0)if(z){const e=m.showOnlyRecommendedVariables([t[t.length-1].variables],t);H(e)}else H([t[t.length-1].variables]);else if(z){const e=m.showOnlyRecommendedVariables(w,F);H(e)}else H(w)}})})),s.jsx(j.BodyCaption,Object.assign({style:{color:n.COLORS.content.secondary}},{children:F[F.length-1].displayName}))]}),s.jsx(s.Fragment,{children:E.length>0?s.jsx(v.Container,Object.assign({height:se()},{children:E.map(((e,t)=>{var a,r;return e.displayName&&void 0!==e.variables?s.jsx("div",Object.assign({style:{borderBottom:`1px solid ${n.COLORS.stroke.primary}`}},{children:s.jsx(o.BikAccordion,Object.assign({autoOpen:L&&0===t,headerPadding:"12px 16px",header:s.jsx(j.TitleSmall,Object.assign({style:{color:n.COLORS.content.secondary}},{children:S(e.displayName,P)}))},{children:s.jsx(O.default,{parentVariable:e,disabled:null!==(a=V.disabled)&&void 0!==a&&a,searchText:P,variable:e.variables,onSelect:e=>{if(e.isDefaultValueSupported)return Y(e),void U(!0);R(e)}})}))}),e.displayName+z):e.displayName?s.jsx(b.Tooltip,Object.assign({body:O.renderTooltipBody(e),placement:"bottom"},{children:s.jsx(u.ListItem,{variant:V.disabled?"readonly":(null==e?void 0:e.selected)?"selected":"default",version:"2.0",leadingIcon:(null==e?void 0:e.selected)||V.disabled?s.jsx(s.Fragment,{}):s.jsx(i.default,{width:14,height:14}),customListItemLabel:s.jsxs("div",Object.assign({style:{display:"flex",gap:4}},{children:[s.jsx(j.BodySecondary,Object.assign({style:{fontSize:"14px",color:n.COLORS.text.primary}},{children:S(e.displayName,P)})),!e.isAvailable&&s.jsx(b.Tooltip,Object.assign({body:"Not Recommended"},{children:s.jsx("div",Object.assign({style:{display:"flex",marginTop:2}},{children:s.jsx(l.default,{width:16,height:16,color:n.COLORS.content.secondary})}))}))]})),listItem:{label:e.displayName,value:e.displayName},subText:e.description||"",onClick:()=>te(e)},t)}),t):s.jsx(O.default,{disabled:null!==(r=V.disabled)&&void 0!==r&&r,searchText:P,variable:e,onSelect:e=>te(e)},t)}))})):s.jsx(y.default,{height:se(),searchText:P})})]})]}))}))},exports.highlightSearchText=S;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),a=require("../button/Button.js"),t=require("../checkBox/CheckBox.js"),s=require("../input/Input.js"),r=require("../TypographyStyle.js");exports.DefaultVariableContent=l=>{var n,d,o;const[u,c]=i.useState(l.variable.defaultValue||""),[p,x]=i.useState(""),[b,g]=i.useState(!!(null===(n=l.variable)||void 0===n?void 0:n.enableDefaultValueForGlobalUsage));return e.jsx(e.Fragment,{children:e.jsxs("div",Object.assign({style:{padding:"0 16px",paddingTop:12,borderTopLeftRadius:4,borderTopRightRadius:4}},{children:[e.jsx("div",Object.assign({style:{paddingBottom:16,borderBottom:"1px solid #E0E0E0"}},{children:e.jsx(r.TitleRegular,{children:null===(d=l.variable)||void 0===d?void 0:d.displayName})})),e.jsxs("div",Object.assign({style:{paddingTop:24}},{children:[e.jsx(s.Input,{onChangeText:e=>{x(""),c(e)},value:u,isRequired:!0,labelText:"Default Value",hintText:"Used if this field is missing for a customer",errorMessage:null!=p?p:"",maxCharLimit:25}),e.jsxs("div",Object.assign({style:{paddingTop:24,gap:8,alignItems:"flex-start"},className:"d-flex"},{children:[e.jsx(t.CheckBox,{isChecked:b,onValueChange:e=>g(e),size:"SMALL",skipHoverState:!0}),e.jsx(r.BodySecondary,Object.assign({style:{marginTop:-2}},{children:`Make this the default value for ‘${null===(o=l.variable)||void 0===o?void 0:o.displayName}’`}))]})),e.jsx("div",Object.assign({style:{padding:"24px 0px",display:"flex",flexDirection:"row",justifyContent:"flex-end"}},{children:e.jsx(a.Button,{buttonText:"Insert Variable",buttonType:"primary",onClick:()=>{if(!u)return void x("This field is required");const e=Object.assign(Object.assign({},l.variable),{defaultValue:u,enableDefaultValueForGlobalUsage:b});l.onInsertVariable(e)}})}))]}))]}))})};
|
|
@@ -17,6 +17,8 @@ export interface VariablePickerV3Props {
|
|
|
17
17
|
disabled?: boolean;
|
|
18
18
|
autoOpenFirst?: boolean;
|
|
19
19
|
headerText?: string;
|
|
20
|
+
contentHeight?: string;
|
|
21
|
+
onDefaultVariableSelect?: (variable: VariableV3) => void;
|
|
20
22
|
}
|
|
21
23
|
export interface VariableListInterfaceV3 {
|
|
22
24
|
isSubHeader?: boolean;
|
|
@@ -54,4 +56,6 @@ export interface VariableV3 {
|
|
|
54
56
|
[key: string]: VariableV3;
|
|
55
57
|
};
|
|
56
58
|
needsFetching?: boolean;
|
|
59
|
+
isDefaultValueSupported?: boolean;
|
|
60
|
+
enableDefaultValueForGlobalUsage?: boolean;
|
|
57
61
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const HeaderWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
1
|
+
export declare const HeaderWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
openDefault?: boolean | undefined;
|
|
3
|
+
}, never>;
|
|
2
4
|
export declare const RecommendWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
5
|
export declare const BackHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
6
|
export declare const Container: import("styled-components").StyledComponent<"div", any, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../constants/Theme.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(e);const i=o.default.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
padding: 12px 16px 0px 16px;
|
|
4
|
+
padding: ${e=>e.openDefault?"12px 16px":"12px 16px 0px 16px"};
|
|
5
5
|
background-color: ${t.COLORS.surface.subdued};
|
|
6
6
|
justify-content: space-between;
|
|
7
7
|
border-top-right-radius: 4px;
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
padding: 12px 16px;
|
|
14
14
|
background-color: ${t.COLORS.surface.subdued};
|
|
15
15
|
border-bottom: 1px solid ${t.COLORS.stroke.primary};
|
|
16
|
-
`,
|
|
16
|
+
`,p=o.default.div`
|
|
17
17
|
position: relative;
|
|
18
18
|
display: flex;
|
|
19
19
|
align-items: center;
|
|
20
20
|
justify-content: center;
|
|
21
21
|
height: 32px;
|
|
22
22
|
background-color: ${t.COLORS.background.base};
|
|
23
|
-
`,
|
|
23
|
+
`,d=o.default.div`
|
|
24
24
|
margin: 8px;
|
|
25
25
|
display: flex;
|
|
26
26
|
flex-direction: column;
|
|
@@ -39,4 +39,4 @@
|
|
|
39
39
|
&::-webkit-scrollbar-thumb:horizontal {
|
|
40
40
|
width: 8px;
|
|
41
41
|
}
|
|
42
|
-
`;exports.BackHeader=
|
|
42
|
+
`;exports.BackHeader=p,exports.Container=d,exports.HeaderWrapper=i,exports.RecommendWrapper=a;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./amplitude/index.js"),r=require("./components/template-preview/constants/regexPatterns.js"),t=require("./utils/StringUtils.js"),o=require("./constants/Theme.js"),n=require("./constants/zindex.js"),i=require("./components/checkBox/CheckBox.js"),a=require("./components/list-item/ListItem.js"),s=require("./components/pagination/Pagination.js"),p=require("./components/radioButton/RadioButton.js"),u=require("./components/toaster/Toaster.js"),c=require("./components/tooltips/Tooltip.js"),l=require("./components/spinner/Spinner.js"),d=require("./components/stepper/Stepper.js"),m=require("./components/tag/Tag.js"),x=require("./components/icon-button/IconButton.js"),T=require("./components/template-preview/TemplatePreview.js"),P=require("./components/template-preview/WhatsApp/WhatsAppLikePreview.js"),S=require("./components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),A=require("./components/template-preview/helpers/SmsTemplateHelper.js"),C=require("./components/template-preview/helpers/WhatsAppFormatToHTML.js"),y=require("./components/template-preview/helpers/VariableEditorHelper.js"),O=require("./components/template-preview/models/TemplateMeta.js"),b=require("./components/template-preview/models/WhatsAppTemplate.js"),j=require("./components/template-context-mapper/TemplateContextMapper.js"),E=require("./components/template-context-mapper/utils/getDataFromTemplateComponent.js"),R=require("./components/template-context-mapper/utils/validateIsUrl.js"),h=require("./components/fab-menu/FABMenu.js"),B=require("./components/floating-action-button/FloatingActionButton.js"),g=require("./components/floating-action-button/FloatingActionButton.styles.js"),_=require("./components/image-compress/ImageCompress.js"),I=require("./components/TypographyStyle.js"),q=require("./components/button/Button.js"),f=require("./components/progress-bar/ProgressBarComponent.js");require("react/jsx-runtime");var N=require("./components/progress-bar-v2/ProgressBarV2.js"),k=require("./components/QueryBuilder/QueryBuilder.js"),D=require("./components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),M=require("./components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js"),w=require("./components/QueryBuilder/redux/queryBuilder.reducer.js"),L=require("./components/QueryBuilder/redux/queryBuilderCache.reducer.js"),V=require("./components/QueryBuilder/types/QueryBuilderOperator.type.js"),G=require("./components/modals/styledModal.js"),v=require("./components/dropdown/DropdownPopover/index.js"),U=require("./components/dropdown/Dropdown.js"),H=require("./components/dropdown/ChipDropdown.js"),F=require("./components/dropdown/OpenedDropdown/components/OpennedDropdown.js"),W=require("./components/dropdown/MenuItem/MenuItem.js"),Y=require("./components/analytics-card/AnalyticsCard.js"),Q=require("./components/analytics-card/AnalyticsCard.styled.js"),K=require("./components/input/Input.js"),z=require("./components/analytics-chips-and-dropdowns/AnalyticsChip.js"),Z=require("./components/analytics-chips-and-dropdowns/AnalyticsDropdown.js"),X=require("./components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js"),J=require("./components/analytics-chips-and-dropdowns/AnalyticsMetric.js"),$=require("./components/analytics-chips-and-dropdowns/AnalyticsTrend.js"),ee=require("./components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js"),re=require("./components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js"),te=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js"),oe=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js"),ne=require("./components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js"),ie=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js"),ae=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js"),se=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.js"),pe=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js"),ue=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/FunnelVerticalBarGraph.js"),ce=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),le=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js"),de=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),me=require("./components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.js"),xe=require("./components/avatar/Avatar.js"),Te=require("./components/avatar/AvatarHelper.js"),Pe=require("./components/alerts/Alert.js"),Se=require("./components/alerts/AlertHelper.js"),Ae=require("./components/thumbnail/Thumbnail.js"),Ce=require("./components/curtain/Curtain.js"),ye=require("./components/datePicker/DatePicker.js"),Oe=require("./components/datePicker/DatePickerWrapper.js"),be=require("./components/switch/Switch.js"),je=require("./components/plans/SubscriptionPlan.js"),Ee=require("./components/plans/SubscriptionPlanSelector.js"),Re=require("./components/plans/NewSubscriptionPlan.js"),he=require("./components/plans/SubscriptionPlansCollected.js"),Be=require("./components/tabs/Tabs.js"),ge=require("./components/dynamic-tabs/DynamicTabs.js"),_e=require("./components/shimmer/ShimmerComponent/BikShimmer.js"),Ie=require("./components/TablePagination/TablePagination.js"),qe=require("./components/TablePagination/TablePaginationCard.js"),fe=require("./components/states-modal/StateModalComponent.js"),Ne=require("./components/states-modal/DeleteConfirmationModal.js"),ke=require("./components/states/StateComponent.js"),De=require("./components/states/ShopifyScopeWrapper.js"),Me=require("./components/WhatsAppTextEditor/WhatsAppTextEditor.js"),we=require("./components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),Le=require("./helpers/BaseWhatsappContentLang.helper.js"),Ve=require("./components/curtain/CurtainHelper.js"),Ge=require("./utils/resizeImage.js"),ve=require("./components/variable-picker-v3/model.js"),Ue=require("./components/card-selection-modal/CardSelectionModal.js"),He=require("./components/image-cropper/BikImageCropper.js"),Fe=require("./components/image-cropper/BikImagePipeline/BikImagePipeline.js"),We=require("./components/buttonGroup/ButtonGroup.js"),Ye=require("./components/accordion/Accordion.js"),Qe=require("./components/file-uploader/FileUploader.js"),Ke=require("./components/colourInput/ColourInput.js"),ze=require("./components/bik-layout/BikHeader.js"),Ze=require("./components/bik-layout/BikLayout.js"),Xe=require("./components/bik-layout/BikProfile.js"),Je=require("./components/bik-layout/SimpleSidebar.js"),$e=require("./components/bik-layout/BikSidebar.js"),er=require("./components/bik-layout/FeatureModal.js"),rr=require("./components/bik-layout/SidebarSkeleton.js"),tr=require("./components/bik-layout/ShowShopifyRestrictedModal.js"),or=require("./components/bik-layout/FeatureModalV2.js"),nr=require("./components/searchBar/searchBar.js"),ir=require("./components/custom-date-time/CustomDateTime.js"),ar=require("./components/product-picker/ProductPickerModal.js"),sr=require("./components/discount-modal/DiscountModal.js"),pr=require("./components/discount-modal/CouponExpiration/CouponExpiration.js"),ur=require("./components/discount-modal/type.js"),cr=require("./components/country-code-picker/CountryCodePicker.js"),lr=require("./components/country-code-picker/CountryCodePicker.modal.js"),dr=require("./components/shimmer-image/ShimmerImage.js"),mr=require("./components/product-picker-v2/modal.js"),xr=require("./components/carousel/carousel.js"),Tr=require("./components/carousel-secondary/CarouselSecondary.js"),Pr=require("./components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js"),Sr=require("./components/radioList/RadioList.js"),Ar=require("./components/checkList/CheckList.js"),Cr=require("./components/postPicker/postPicker.js"),yr=require("./components/dropdown-button/DropdownButton.js"),Or=require("./components/side-modal/SideModal.js"),br=require("./components/keywords-input/KeywordsInput.js"),jr=require("./components/add-variableV2/AddVariableV2SideModal.js"),Er=require("./components/add-variableV2/AddVariableV2.js"),Rr=require("./components/navigation-hyperlink/NavigationHyperlink.js"),hr=require("./components/SearchFilter/index.js"),Br=require("./components/input-with-vars/InputWithVariables.js"),gr=require("./components/dashboard-review-popup/DashboardReviewPopUp.js"),_r=require("./components/star-rating/StarRating.js"),Ir=require("./components/testimonial-card/TestimonialCard.js"),qr=require("./components/slider/slider.js"),fr=require("./components/resizeImage/index.js"),Nr=require("./utils/validator.js"),kr=require("./components/carousel-preview/CarouselPreview.js"),Dr=require("./components/floater/floater.js"),Mr=require("./components/card-selector/CardSelector.js"),wr=require("./components/card-selector/CardSelectorGroup.js"),Lr=require("./components/variable-picker-v3/VariablePicker.js"),Vr=require("./components/action-button/ActionButtons.js"),Gr=require("./components/ai-modals/ActivateBikAI.js"),vr=require("./components/ai-modals/AiSyncProgress.js"),Ur=require("./components/ai-modals/AiCreditsExhausted.js"),Hr=require("./components/ai-modals/AiCreditsLow.js"),Fr=require("./components/input-with-vars/customPortal.js");exports.AmplitudeEvent=e.AmplitudeEvent,exports.regexPatterns=r,exports.StringUtils=t.default,exports.BASE_COLORS=o.BASE_COLORS,exports.COLORS=o.COLORS,exports.DEFAULT_THEME=o.DEFAULT_THEME,exports.FONTS=o.FONTS,exports.ComponentZindex=n.ComponentZindex,exports.CheckBox=i.CheckBox,exports.ListItem=a.ListItem,exports.Pagination=s.Pagination,exports.RadioButton=p.RadioButton,exports.Toaster=u.Toaster,exports.Tooltip=c.Tooltip,exports.PureSpinner=l.PureSpinner,exports.Spinner=l.Spinner,exports.Stepper=d.Stepper,exports.Tag=m.Tag,exports.IconButton=x.IconButton,exports.TemplatePreview=T.TemplatePreview,exports.WhatsappLikePreview=P.WhatsappLikePreview,exports.WhatsappLikePreviewV2=S.WhatsappLikePreviewV2,exports.renderVariableUIForPreview=A.renderVariableUIForPreview,exports.WhatsAppFormatToHTML=C.WhatsAppFormatToHTML,exports.VariableEditorHelper=y.VariableEditorHelper,Object.defineProperty(exports,"ACTIONS_TYPES",{enumerable:!0,get:function(){return O.ACTIONS_TYPES}}),exports.CUSTOM_URL_NAME=O.CUSTOM_URL_NAME,Object.defineProperty(exports,"HEADER_TYPES",{enumerable:!0,get:function(){return O.HEADER_TYPES}}),Object.defineProperty(exports,"TEMPLATE_EDITOR",{enumerable:!0,get:function(){return O.TEMPLATE_EDITOR}}),Object.defineProperty(exports,"TEMPLATE_STATUS",{enumerable:!0,get:function(){return O.TEMPLATE_STATUS}}),Object.defineProperty(exports,"BUTTON_TYPE",{enumerable:!0,get:function(){return b.BUTTON_TYPE}}),Object.defineProperty(exports,"POD",{enumerable:!0,get:function(){return b.POD}}),exports.TemplateContextMapper=j.TemplateContextMapper,exports.getAllDataFromTemplateComponent=E.getAllDataFromTemplateComponent,exports.isVariable=R.isVariable,exports.validateIsUrl=R.validateIsUrl,exports.FABMenu=h.FABMenu,exports.FloatingActionButton=B.FloatingActionButton,Object.defineProperty(exports,"DROP_POSITION",{enumerable:!0,get:function(){return g.DROP_POSITION}}),exports.DropdownToggleContainer=g.DropdownToggleContainer,Object.defineProperty(exports,"FAB_POSITION",{enumerable:!0,get:function(){return g.FAB_POSITION}}),exports.FloatingActionButtonContainer=g.FloatingActionButtonContainer,exports.FloatingActionButtonOuterContainer=g.FloatingActionButtonOuterContainer,Object.defineProperty(exports,"MENU_ALIGNMENT",{enumerable:!0,get:function(){return g.MENU_ALIGNMENT}}),exports.StyledDropdown=g.StyledDropdown,exports.TooltipStyled=g.TooltipStyled,exports.ImageService=_.ImageService,exports.AiBodyCaption=I.AiBodyCaption,exports.AiBodyTiny=I.AiBodyTiny,exports.BodyCaption=I.BodyCaption,exports.BodyLarge=I.BodyLarge,exports.BodyPrimary=I.BodyPrimary,exports.BodyPrimaryLink=I.BodyPrimaryLink,exports.BodyRegular=I.BodyRegular,exports.BodySecondary=I.BodySecondary,exports.BodySecondaryLink=I.BodySecondaryLink,exports.BodySmall=I.BodySmall,exports.BodyTiny=I.BodyTiny,exports.ButtonLarge=I.ButtonLarge,exports.ButtonLargeAI=I.ButtonLargeAI,exports.ButtonRegular=I.ButtonRegular,exports.ButtonRegularAI=I.ButtonRegularAI,exports.Caption=I.Caption,exports.CaptionBold=I.CaptionBold,exports.Display=I.Display,exports.SmallRegular=I.SmallRegular,exports.SubHeading=I.SubHeading,exports.TextPlaceholder=I.TextPlaceholder,exports.Tiny=I.Tiny,exports.TitleFour=I.TitleFour,exports.TitleLarge=I.TitleLarge,exports.TitleMedium=I.TitleMedium,exports.TitleRegular=I.TitleRegular,exports.TitleSmall=I.TitleSmall,exports.TitleXlarge=I.TitleXlarge,exports.Button=q.Button,exports.ProgressBarComponent=f.ProgressBarComponent,exports.ProgressCompletedBar=f.ProgressCompletedBar,Object.defineProperty(exports,"ProgressBarType",{enumerable:!0,get:function(){return N.ProgressBarType}}),exports.ProgressBarV2=N.ProgressBarV2,Object.defineProperty(exports,"TextAlignment",{enumerable:!0,get:function(){return N.TextAlignment}}),exports.QueryBuilder=k.QueryBuilder,exports.BaseQueryBuilderNode=D.BaseQueryBuilderNode,exports.PropertyNode=M.PropertyNode,exports.PropertyNodeHeadless=M.PropertyNodeHeadless,exports.queryBuilderSlice=w.queryBuilderSlice,exports.queryBuilderCacheSlice=L.queryBuilderCacheSlice,Object.defineProperty(exports,"AD_STRING_OPERATORS",{enumerable:!0,get:function(){return V.AD_STRING_OPERATORS}}),Object.defineProperty(exports,"ANY_AD_OPERATORS",{enumerable:!0,get:function(){return V.ANY_AD_OPERATORS}}),Object.defineProperty(exports,"ANY_IG_OPERATORS",{enumerable:!0,get:function(){return V.ANY_IG_OPERATORS}}),Object.defineProperty(exports,"BOOLEAN_OPERATORS",{enumerable:!0,get:function(){return V.BOOLEAN_OPERATORS}}),Object.defineProperty(exports,"DATE_OPERATORS",{enumerable:!0,get:function(){return V.DATE_OPERATORS}}),Object.defineProperty(exports,"EVENT_VALUES",{enumerable:!0,get:function(){return V.EVENT_VALUES}}),Object.defineProperty(exports,"EXACTLY_OPERATORS",{enumerable:!0,get:function(){return V.EXACTLY_OPERATORS}}),Object.defineProperty(exports,"FREQUENCY_OPERATORS",{enumerable:!0,get:function(){return V.FREQUENCY_OPERATORS}}),Object.defineProperty(exports,"ICE_BREAKER_OPERATORS",{enumerable:!0,get:function(){return V.ICE_BREAKER_OPERATORS}}),Object.defineProperty(exports,"IG_STRING_OPERATORS",{enumerable:!0,get:function(){return V.IG_STRING_OPERATORS}}),Object.defineProperty(exports,"INTEGER_OPERATORS",{enumerable:!0,get:function(){return V.INTEGER_OPERATORS}}),Object.defineProperty(exports,"MAIL_SUBJECT_OPERATORS",{enumerable:!0,get:function(){return V.MAIL_SUBJECT_OPERATORS}}),Object.defineProperty(exports,"REACTION_OPERATORS",{enumerable:!0,get:function(){return V.REACTION_OPERATORS}}),Object.defineProperty(exports,"SPECIFIC_IG_OPERATORS",{enumerable:!0,get:function(){return V.SPECIFIC_IG_OPERATORS}}),Object.defineProperty(exports,"STRING_OPERATORS",{enumerable:!0,get:function(){return V.STRING_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS",{enumerable:!0,get:function(){return V.STRING_RESTRICTED_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_2",{enumerable:!0,get:function(){return V.STRING_RESTRICTED_OPERATORS_2}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_3",{enumerable:!0,get:function(){return V.STRING_RESTRICTED_OPERATORS_3}}),exports.StyledModal=G.StyledModal,exports.DropdownPopover=v.DropdownPopover,exports.Dropdown=U.Dropdown,exports.ChipDropdown=H.ChipDropdown,exports.OpenedDropdown=F.OpenedDropdown,exports.MenuItemDropdown=W.MenuItemDropdown,exports.AnalyticsCard=Y.AnalyticsCard,exports.AnalyticsContainer=Q.AnalyticsContainer,exports.CardDataContainer=Q.CardDataContainer,exports.Input=K.Input,exports.AnalyticsChip=z.AnalyticsChip,exports.AnalyticsDropdown=Z.AnalyticsDropdown,exports.EachItem=Z.EachItem,exports.formatDate=Z.formatDate,exports.AnalyticsMultiChip=X.AnalyticsMultiChip,exports.AnalyticsMetric=J.AnalyticsMetric,exports.AnalyticsTrend=$.AnalyticsTrend,exports.LineChart=ee.LineChart,exports.LinearChipGroupedChart=re.LinearChipGroupedChart,exports.Card=te.Card,exports.PieChartAnalytics=te.PieChartAnalytics,exports.PieChart=oe.PieChart,exports.HorizontalGraph=ne.HorizontalGraph,exports.StackedBarChart=ie.StackedBarChart,exports.StackedBarDistributionChart=ae.StackedBarDistributionChart,Object.defineProperty(exports,"GRAPH_ORIENTATION",{enumerable:!0,get:function(){return se.GRAPH_ORIENTATION}}),exports.VerticalGraph=pe.VerticalGraph,exports.FunnelVerticalBarGraph=ue.FunnelVerticalBarGraph,Object.defineProperty(exports,"HEAT",{enumerable:!0,get:function(){return ce.HEAT}}),exports.HEAT_COLORS=ce.HEAT_COLORS,Object.defineProperty(exports,"HEAT_GRADING_TYPE",{enumerable:!0,get:function(){return ce.HEAT_GRADING_TYPE}}),exports.HeatMap=ce.HeatMap,exports.HeatBoxStyled=le.HeatBoxStyled,exports.HeatMapVertical=le.HeatMapVertical,exports.VerticalBarAndLinearGraph=de.VerticalBarAndLinearGraph,exports.calculatePercentage=me.calculatePercentage,exports.roundNumber=me.roundNumber,exports.truncateValueTo10K=me.truncateValueTo10K,exports.truncateValueToK=me.truncateValueToK,exports.AVATAR_SIZE_VS_ICON_SIZE_MAP=xe.AVATAR_SIZE_VS_ICON_SIZE_MAP,exports.Avatar=xe.Avatar,exports.BACKGROUND_VS_TEXT_COLOR_MAP=xe.BACKGROUND_VS_TEXT_COLOR_MAP,Object.defineProperty(exports,"MESSAGE_CHANNELS",{enumerable:!0,get:function(){return xe.MESSAGE_CHANNELS}}),Object.defineProperty(exports,"AVATAR_BACKGROUND",{enumerable:!0,get:function(){return Te.AVATAR_BACKGROUND}}),exports.AVATAR_SIZE_MAP=Te.AVATAR_SIZE_MAP,Object.defineProperty(exports,"AVATAR_TYPES",{enumerable:!0,get:function(){return Te.AVATAR_TYPES}}),Object.defineProperty(exports,"SIZE",{enumerable:!0,get:function(){return Te.SIZE}}),exports.Alert=Pe.Alert,Object.defineProperty(exports,"ALERT_TYPES",{enumerable:!0,get:function(){return Se.ALERT_TYPES}}),exports.COLOR_CONFIG_MAP=Se.COLOR_CONFIG_MAP,Object.defineProperty(exports,"CONTENT_POSITION",{enumerable:!0,get:function(){return Se.CONTENT_POSITION}}),Object.defineProperty(exports,"RATIO",{enumerable:!0,get:function(){return Ae.RATIO}}),exports.Thumbnail=Ae.Thumbnail,exports.Curtain=Ce.Curtain,exports.DatePicker=ye.DatePicker,exports.DatePickerWrapper=Oe.DatePickerWrapper,exports.Loader=be.Loader,exports.Switch=be.Switch,exports.SwitchContainer=be.SwitchContainer,exports.Thumb=be.Thumb,exports.SubscriptionPlan=je.SubscriptionPlan,exports.BottomWrapper=Ee.BottomWrapper,exports.HeaderWrapper=Ee.HeaderWrapper,exports.SubscriptionPlanSelector=Ee.SubscriptionPlanSelector,exports.defaultTabs=Ee.defaultTabs,exports.NewSubscriptionPlan=Re.NewSubscriptionPlan,exports.SubscriptionPlansCollected=he.SubscriptionPlansCollected,exports.TabItemComponent=Be.TabItemComponent,exports.Tabs=Be.Tabs,exports.DynamicTabs=ge.DynamicTabs,exports.BikShimmer=_e.BikShimmer,exports.TablePagination=Ie.TablePagination,exports.TablePaginationCard=qe.TablePaginationCard,exports.TablePaginationCardStyled=qe.TablePaginationCardStyled,exports.StateModalComponent=fe.StateModalComponent,exports.DeleteConfirmationModal=Ne.DeleteConfirmationModal,Object.defineProperty(exports,"ButtonActions",{enumerable:!0,get:function(){return ke.ButtonActions}}),Object.defineProperty(exports,"ButtonTypes",{enumerable:!0,get:function(){return ke.ButtonTypes}}),exports.StateComponent=ke.StateComponent,Object.defineProperty(exports,"StateInterface",{enumerable:!0,get:function(){return ke.StateInterface}}),exports.ShopifyScopeWrapper=De.ShopifyScopeWrapper,exports.WhatsAppTextEditor=Me.WhatsAppTextEditor,exports.CustomRightBorder=we.CustomRightBorder,Object.defineProperty(exports,"EditorActionTypes",{enumerable:!0,get:function(){return we.EditorActionTypes}}),exports.WhatsAppTextEditorHeader=we.WhatsAppTextEditorHeader,exports.BaseWhatsappContentLangHelper=Le.BaseWhatsappContentLangHelper,exports.CURTAIN_COLOR_CONFIG_MAP=Ve.CURTAIN_COLOR_CONFIG_MAP,Object.defineProperty(exports,"CURTAIN_MODE",{enumerable:!0,get:function(){return Ve.CURTAIN_MODE}}),Object.defineProperty(exports,"CURTAIN_TYPES",{enumerable:!0,get:function(){return Ve.CURTAIN_TYPES}}),exports.resizeImage=Ge.resizeImage,Object.defineProperty(exports,"PickerType",{enumerable:!0,get:function(){return ve.PickerType}}),exports.CardSelectionModal=Ue.CardSelectionModal,exports.BikImageCropper=He.BikImageCropper,exports.BikImagePipeline=Fe.BikImagePipeline,exports.ButtonGroup=We.ButtonGroup,exports.BikAccordion=Ye.BikAccordion,exports.FileUploader=Qe.FileUploader,exports.ColourInput=Ke.ColourInput,exports.BikHeader=ze.BikHeader,exports.BikLayout=Ze.BikLayout,exports.BikProfile=Xe.BikProfile,exports.SimpleSidebar=Je.SimpleSidebar,exports.BikSidebar=$e.BikSidebar,exports.FeatureModal=er.FeatureModal,exports.SidebarSkeleton=rr.SidebarSkeleton,exports.ShowShopifyRestrictedModal=tr.ShowShopifyRestrictedModal,exports.FeatureModalV2=or.FeatureModalV2,exports.SearchBar=nr.SearchBar,exports.CustomDateTime=ir.CustomDateTime,exports.PricePleaseProductPicker=ar.PricePleaseProductPicker,exports.ProductPickerContent=ar.ProductPickerContent,exports.DiscountModal=sr.DiscountModal,Object.defineProperty(exports,"COUPON_EXPIRATION",{enumerable:!0,get:function(){return pr.COUPON_EXPIRATION}}),exports.CouponExpiration=pr.CouponExpiration,Object.defineProperty(exports,"DISCOUNT_TARGET_SELECTION",{enumerable:!0,get:function(){return ur.DISCOUNT_TARGET_SELECTION}}),Object.defineProperty(exports,"DISCOUNT_TARGET_TYPES",{enumerable:!0,get:function(){return ur.DISCOUNT_TARGET_TYPES}}),Object.defineProperty(exports,"DISCOUNT_TYPES",{enumerable:!0,get:function(){return ur.DISCOUNT_TYPES}}),Object.defineProperty(exports,"DISCOUNT_VALUE_TYPES",{enumerable:!0,get:function(){return ur.DISCOUNT_VALUE_TYPES}}),Object.defineProperty(exports,"MIN_PURCHASE_REQUIREMENT",{enumerable:!0,get:function(){return ur.MIN_PURCHASE_REQUIREMENT}}),exports.CountryCodePicker=cr.CountryCodePicker,exports.CountriesData=lr.CountriesData,exports.DEFAULT_IMAGE=dr.DEFAULT_IMAGE,exports.ShimmerImage=dr.ShimmerImage,exports.ProductPickerModal=mr.ProductPickerModal,Object.defineProperty(exports,"ScreenName",{enumerable:!0,get:function(){return mr.ScreenName}}),exports.Carousel=xr.Carousel,exports.CarouselSecondary=Tr.CarouselSecondary,exports.AccessTokenTroubleshootDialog=Pr.AccessTokenTroubleshootDialog,exports.RadioList=Sr.RadioList,exports.CheckList=Ar.CheckList,Object.defineProperty(exports,"DateKeys",{enumerable:!0,get:function(){return Cr.DateKeys}}),Object.defineProperty(exports,"MEDIA_TYPES",{enumerable:!0,get:function(){return Cr.MEDIA_TYPES}}),exports.PostPicker=Cr.PostPicker,exports.dateOptions=Cr.dateOptions,exports.DropdownButton=yr.DropdownButton,exports.SideModal=Or.SideModal,exports.KeywordsInput=br.KeywordsInput,exports.AddVariableV2SideModal=jr.AddVariableV2SideModal,exports.AddVariableV2=Er.AddVariableV2,exports.NaLinkWrapper=Rr.NaLinkWrapper,exports.NavigationHyperlink=Rr.NavigationHyperlink,exports.SearchFilter=hr.SearchFilter,exports.InputWithVariables=Br.InputWithVariables,exports.DashboardReviewPopUp=gr.DashboardReviewPopUp,exports.StarRating=_r.StarRating,exports.TestimonialCard=Ir.TestimonialCard,exports.BikSlider=qr.BikSlider,exports.ResizableImage=fr.ResizableImage,exports.validateURL=Nr.validateURL,exports.CarouselPreview=kr.CarouselPreview,exports.Floater=Dr.Floater,exports.CardSelector=Mr.CardSelector,exports.CardSelectorGroup=wr.CardSelectorGroup,exports.VariablePicker=Lr.VariablePicker,exports.ActionButtons=Vr.ActionButtons,exports.ActivateBikAi=Gr.ActivateBikAi,exports.AiSyncProgress=vr.AiSyncProgress,exports.AiCreditsExhausted=Ur.AiCreditsExhausted,exports.AiCreditsLow=Hr.AiCreditsLow,exports.CustomPortal=Fr.CustomPortal;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./amplitude/index.js"),r=require("./components/template-preview/constants/regexPatterns.js"),t=require("./utils/StringUtils.js"),o=require("./constants/Theme.js"),n=require("./constants/zindex.js"),i=require("./components/checkBox/CheckBox.js"),a=require("./components/list-item/ListItem.js"),s=require("./components/pagination/Pagination.js"),p=require("./components/radioButton/RadioButton.js"),u=require("./components/toaster/Toaster.js"),c=require("./components/tooltips/Tooltip.js"),l=require("./components/spinner/Spinner.js"),d=require("./components/stepper/Stepper.js"),m=require("./components/tag/Tag.js"),x=require("./components/icon-button/IconButton.js"),T=require("./components/template-preview/TemplatePreview.js"),P=require("./components/template-preview/WhatsApp/WhatsAppLikePreview.js"),S=require("./components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),A=require("./components/template-preview/helpers/SmsTemplateHelper.js"),C=require("./components/template-preview/helpers/WhatsAppFormatToHTML.js"),y=require("./components/template-preview/helpers/VariableEditorHelper.js"),O=require("./components/template-preview/models/TemplateMeta.js"),b=require("./components/template-preview/models/WhatsAppTemplate.js"),j=require("./components/template-context-mapper/TemplateContextMapper.js"),E=require("./components/template-context-mapper/utils/getDataFromTemplateComponent.js"),R=require("./components/template-context-mapper/utils/validateIsUrl.js"),h=require("./components/fab-menu/FABMenu.js"),B=require("./components/floating-action-button/FloatingActionButton.js"),g=require("./components/floating-action-button/FloatingActionButton.styles.js"),I=require("./components/image-compress/ImageCompress.js"),_=require("./components/TypographyStyle.js"),q=require("./components/button/Button.js"),f=require("./components/progress-bar/ProgressBarComponent.js");require("react/jsx-runtime");var k=require("./components/progress-bar-v2/ProgressBarV2.js"),N=require("./components/QueryBuilder/QueryBuilder.js"),D=require("./components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),w=require("./components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js"),M=require("./components/QueryBuilder/redux/queryBuilder.reducer.js"),L=require("./components/QueryBuilder/redux/queryBuilderCache.reducer.js"),V=require("./components/QueryBuilder/types/QueryBuilderOperator.type.js"),G=require("./components/modals/styledModal.js"),v=require("./components/dropdown/DropdownPopover/index.js"),U=require("./components/dropdown/Dropdown.js"),F=require("./components/dropdown/ChipDropdown.js"),H=require("./components/dropdown/OpenedDropdown/components/OpennedDropdown.js"),W=require("./components/dropdown/MenuItem/MenuItem.js"),Y=require("./components/analytics-card/AnalyticsCard.js"),Q=require("./components/analytics-card/AnalyticsCard.styled.js"),K=require("./components/input/Input.js"),z=require("./components/analytics-chips-and-dropdowns/AnalyticsChip.js"),Z=require("./components/analytics-chips-and-dropdowns/AnalyticsDropdown.js"),X=require("./components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js"),J=require("./components/analytics-chips-and-dropdowns/AnalyticsMetric.js"),$=require("./components/analytics-chips-and-dropdowns/AnalyticsTrend.js"),ee=require("./components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js"),re=require("./components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js"),te=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js"),oe=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js"),ne=require("./components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js"),ie=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js"),ae=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js"),se=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.js"),pe=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js"),ue=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/FunnelVerticalBarGraph.js"),ce=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),le=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js"),de=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),me=require("./components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.js"),xe=require("./components/avatar/Avatar.js"),Te=require("./components/avatar/AvatarHelper.js"),Pe=require("./components/alerts/Alert.js"),Se=require("./components/alerts/AlertHelper.js"),Ae=require("./components/thumbnail/Thumbnail.js"),Ce=require("./components/curtain/Curtain.js"),ye=require("./components/datePicker/DatePicker.js"),Oe=require("./components/datePicker/DatePickerWrapper.js"),be=require("./components/switch/Switch.js"),je=require("./components/plans/SubscriptionPlan.js"),Ee=require("./components/plans/SubscriptionPlanSelector.js"),Re=require("./components/plans/NewSubscriptionPlan.js"),he=require("./components/plans/SubscriptionPlansCollected.js"),Be=require("./components/tabs/Tabs.js"),ge=require("./components/dynamic-tabs/DynamicTabs.js"),Ie=require("./components/shimmer/ShimmerComponent/BikShimmer.js"),_e=require("./components/TablePagination/TablePagination.js"),qe=require("./components/TablePagination/TablePaginationCard.js"),fe=require("./components/states-modal/StateModalComponent.js"),ke=require("./components/states-modal/DeleteConfirmationModal.js"),Ne=require("./components/states/StateComponent.js"),De=require("./components/states/ShopifyScopeWrapper.js"),we=require("./components/WhatsAppTextEditor/WhatsAppTextEditor.js"),Me=require("./components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),Le=require("./helpers/BaseWhatsappContentLang.helper.js"),Ve=require("./components/curtain/CurtainHelper.js"),Ge=require("./utils/resizeImage.js"),ve=require("./components/variable-picker-v3/model.js"),Ue=require("./components/card-selection-modal/CardSelectionModal.js"),Fe=require("./components/image-cropper/BikImageCropper.js"),He=require("./components/image-cropper/BikImagePipeline/BikImagePipeline.js"),We=require("./components/buttonGroup/ButtonGroup.js"),Ye=require("./components/accordion/Accordion.js"),Qe=require("./components/file-uploader/FileUploader.js"),Ke=require("./components/colourInput/ColourInput.js"),ze=require("./components/bik-layout/BikHeader.js"),Ze=require("./components/bik-layout/BikLayout.js"),Xe=require("./components/bik-layout/BikProfile.js"),Je=require("./components/bik-layout/SimpleSidebar.js"),$e=require("./components/bik-layout/BikSidebar.js"),er=require("./components/bik-layout/FeatureModal.js"),rr=require("./components/bik-layout/SidebarSkeleton.js"),tr=require("./components/bik-layout/ShowShopifyRestrictedModal.js"),or=require("./components/bik-layout/FeatureModalV2.js"),nr=require("./components/searchBar/searchBar.js"),ir=require("./components/custom-date-time/CustomDateTime.js"),ar=require("./components/product-picker/ProductPickerModal.js"),sr=require("./components/discount-modal/DiscountModal.js"),pr=require("./components/discount-modal/CouponExpiration/CouponExpiration.js"),ur=require("./components/discount-modal/type.js"),cr=require("./components/country-code-picker/CountryCodePicker.js"),lr=require("./components/country-code-picker/CountryCodePicker.modal.js"),dr=require("./components/shimmer-image/ShimmerImage.js"),mr=require("./components/product-picker-v2/modal.js"),xr=require("./components/carousel/carousel.js"),Tr=require("./components/carousel-secondary/CarouselSecondary.js"),Pr=require("./components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js"),Sr=require("./components/radioList/RadioList.js"),Ar=require("./components/checkList/CheckList.js"),Cr=require("./components/postPicker/postPicker.js"),yr=require("./components/dropdown-button/DropdownButton.js"),Or=require("./components/side-modal/SideModal.js"),br=require("./components/keywords-input/KeywordsInput.js"),jr=require("./components/add-variableV2/AddVariableV2SideModal.js"),Er=require("./components/add-variableV2/AddVariableV2.js"),Rr=require("./components/navigation-hyperlink/NavigationHyperlink.js"),hr=require("./components/SearchFilter/index.js"),Br=require("./components/input-with-vars/InputWithVariables.js"),gr=require("./components/dashboard-review-popup/DashboardReviewPopUp.js"),Ir=require("./components/star-rating/StarRating.js"),_r=require("./components/testimonial-card/TestimonialCard.js"),qr=require("./components/slider/slider.js"),fr=require("./components/resizeImage/index.js"),kr=require("./utils/validator.js"),Nr=require("./components/carousel-preview/CarouselPreview.js"),Dr=require("./components/floater/floater.js"),wr=require("./components/card-selector/CardSelector.js"),Mr=require("./components/card-selector/CardSelectorGroup.js"),Lr=require("./components/variable-picker-v3/VariablePicker.js"),Vr=require("./components/action-button/ActionButtons.js"),Gr=require("./components/ai-modals/ActivateBikAI.js"),vr=require("./components/ai-modals/AiSyncProgress.js"),Ur=require("./components/ai-modals/AiCreditsExhausted.js"),Fr=require("./components/ai-modals/AiCreditsLow.js"),Hr=require("./components/input-with-vars/customPortal.js");exports.AmplitudeEvent=e.AmplitudeEvent,exports.regexPatterns=r,exports.StringUtils=t.default,exports.BASE_COLORS=o.BASE_COLORS,exports.COLORS=o.COLORS,exports.DEFAULT_THEME=o.DEFAULT_THEME,exports.FONTS=o.FONTS,exports.ComponentZindex=n.ComponentZindex,exports.CheckBox=i.CheckBox,exports.ListItem=a.ListItem,exports.Pagination=s.Pagination,exports.RadioButton=p.RadioButton,exports.Toaster=u.Toaster,exports.Tooltip=c.Tooltip,exports.PureSpinner=l.PureSpinner,exports.Spinner=l.Spinner,exports.Stepper=d.Stepper,exports.Tag=m.Tag,exports.IconButton=x.IconButton,exports.TemplatePreview=T.TemplatePreview,exports.WhatsappLikePreview=P.WhatsappLikePreview,exports.WhatsappLikePreviewV2=S.WhatsappLikePreviewV2,exports.renderVariableUIForPreview=A.renderVariableUIForPreview,exports.WhatsAppFormatToHTML=C.WhatsAppFormatToHTML,exports.VariableEditorHelper=y.VariableEditorHelper,Object.defineProperty(exports,"ACTIONS_TYPES",{enumerable:!0,get:function(){return O.ACTIONS_TYPES}}),exports.CUSTOM_URL_NAME=O.CUSTOM_URL_NAME,Object.defineProperty(exports,"HEADER_TYPES",{enumerable:!0,get:function(){return O.HEADER_TYPES}}),Object.defineProperty(exports,"TEMPLATE_EDITOR",{enumerable:!0,get:function(){return O.TEMPLATE_EDITOR}}),Object.defineProperty(exports,"TEMPLATE_STATUS",{enumerable:!0,get:function(){return O.TEMPLATE_STATUS}}),Object.defineProperty(exports,"BUTTON_TYPE",{enumerable:!0,get:function(){return b.BUTTON_TYPE}}),Object.defineProperty(exports,"POD",{enumerable:!0,get:function(){return b.POD}}),exports.TemplateContextMapper=j.TemplateContextMapper,exports.getAllDataFromTemplateComponent=E.getAllDataFromTemplateComponent,exports.isVariable=R.isVariable,exports.validateIsUrl=R.validateIsUrl,exports.FABMenu=h.FABMenu,exports.FloatingActionButton=B.FloatingActionButton,Object.defineProperty(exports,"DROP_POSITION",{enumerable:!0,get:function(){return g.DROP_POSITION}}),exports.DropdownToggleContainer=g.DropdownToggleContainer,Object.defineProperty(exports,"FAB_POSITION",{enumerable:!0,get:function(){return g.FAB_POSITION}}),exports.FloatingActionButtonContainer=g.FloatingActionButtonContainer,exports.FloatingActionButtonOuterContainer=g.FloatingActionButtonOuterContainer,Object.defineProperty(exports,"MENU_ALIGNMENT",{enumerable:!0,get:function(){return g.MENU_ALIGNMENT}}),exports.StyledDropdown=g.StyledDropdown,exports.TooltipStyled=g.TooltipStyled,exports.ImageService=I.ImageService,exports.AiBodyCaption=_.AiBodyCaption,exports.AiBodyTiny=_.AiBodyTiny,exports.BodyCaption=_.BodyCaption,exports.BodyLarge=_.BodyLarge,exports.BodyPrimary=_.BodyPrimary,exports.BodyPrimaryLink=_.BodyPrimaryLink,exports.BodyRegular=_.BodyRegular,exports.BodySecondary=_.BodySecondary,exports.BodySecondaryLink=_.BodySecondaryLink,exports.BodySmall=_.BodySmall,exports.BodyTiny=_.BodyTiny,exports.ButtonLarge=_.ButtonLarge,exports.ButtonLargeAI=_.ButtonLargeAI,exports.ButtonRegular=_.ButtonRegular,exports.ButtonRegularAI=_.ButtonRegularAI,exports.Caption=_.Caption,exports.CaptionBold=_.CaptionBold,exports.Display=_.Display,exports.SmallRegular=_.SmallRegular,exports.SubHeading=_.SubHeading,exports.TextPlaceholder=_.TextPlaceholder,exports.Tiny=_.Tiny,exports.TitleFour=_.TitleFour,exports.TitleLarge=_.TitleLarge,exports.TitleMedium=_.TitleMedium,exports.TitleRegular=_.TitleRegular,exports.TitleSmall=_.TitleSmall,exports.TitleXlarge=_.TitleXlarge,exports.Button=q.Button,exports.ProgressBarComponent=f.ProgressBarComponent,exports.ProgressCompletedBar=f.ProgressCompletedBar,Object.defineProperty(exports,"ProgressBarType",{enumerable:!0,get:function(){return k.ProgressBarType}}),exports.ProgressBarV2=k.ProgressBarV2,Object.defineProperty(exports,"TextAlignment",{enumerable:!0,get:function(){return k.TextAlignment}}),exports.QueryBuilder=N.QueryBuilder,exports.BaseQueryBuilderNode=D.BaseQueryBuilderNode,exports.PropertyNode=w.PropertyNode,exports.PropertyNodeHeadless=w.PropertyNodeHeadless,exports.queryBuilderSlice=M.queryBuilderSlice,exports.queryBuilderCacheSlice=L.queryBuilderCacheSlice,Object.defineProperty(exports,"AD_STRING_OPERATORS",{enumerable:!0,get:function(){return V.AD_STRING_OPERATORS}}),Object.defineProperty(exports,"ANY_AD_OPERATORS",{enumerable:!0,get:function(){return V.ANY_AD_OPERATORS}}),Object.defineProperty(exports,"ANY_IG_OPERATORS",{enumerable:!0,get:function(){return V.ANY_IG_OPERATORS}}),Object.defineProperty(exports,"BOOLEAN_OPERATORS",{enumerable:!0,get:function(){return V.BOOLEAN_OPERATORS}}),Object.defineProperty(exports,"DATE_OPERATORS",{enumerable:!0,get:function(){return V.DATE_OPERATORS}}),Object.defineProperty(exports,"EVENT_VALUES",{enumerable:!0,get:function(){return V.EVENT_VALUES}}),Object.defineProperty(exports,"EXACTLY_OPERATORS",{enumerable:!0,get:function(){return V.EXACTLY_OPERATORS}}),Object.defineProperty(exports,"FREQUENCY_OPERATORS",{enumerable:!0,get:function(){return V.FREQUENCY_OPERATORS}}),Object.defineProperty(exports,"ICE_BREAKER_OPERATORS",{enumerable:!0,get:function(){return V.ICE_BREAKER_OPERATORS}}),Object.defineProperty(exports,"IG_STRING_OPERATORS",{enumerable:!0,get:function(){return V.IG_STRING_OPERATORS}}),Object.defineProperty(exports,"INTEGER_OPERATORS",{enumerable:!0,get:function(){return V.INTEGER_OPERATORS}}),Object.defineProperty(exports,"MAIL_SUBJECT_OPERATORS",{enumerable:!0,get:function(){return V.MAIL_SUBJECT_OPERATORS}}),Object.defineProperty(exports,"REACTION_OPERATORS",{enumerable:!0,get:function(){return V.REACTION_OPERATORS}}),Object.defineProperty(exports,"SPECIFIC_IG_OPERATORS",{enumerable:!0,get:function(){return V.SPECIFIC_IG_OPERATORS}}),Object.defineProperty(exports,"STRING_OPERATORS",{enumerable:!0,get:function(){return V.STRING_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS",{enumerable:!0,get:function(){return V.STRING_RESTRICTED_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_2",{enumerable:!0,get:function(){return V.STRING_RESTRICTED_OPERATORS_2}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_3",{enumerable:!0,get:function(){return V.STRING_RESTRICTED_OPERATORS_3}}),exports.StyledModal=G.StyledModal,exports.DropdownPopover=v.DropdownPopover,exports.Dropdown=U.Dropdown,exports.ChipDropdown=F.ChipDropdown,exports.OpenedDropdown=H.OpenedDropdown,exports.MenuItemDropdown=W.MenuItemDropdown,exports.AnalyticsCard=Y.AnalyticsCard,exports.AnalyticsContainer=Q.AnalyticsContainer,exports.CardDataContainer=Q.CardDataContainer,exports.Input=K.Input,exports.AnalyticsChip=z.AnalyticsChip,exports.AnalyticsDropdown=Z.AnalyticsDropdown,exports.EachItem=Z.EachItem,exports.formatDate=Z.formatDate,exports.AnalyticsMultiChip=X.AnalyticsMultiChip,exports.AnalyticsMetric=J.AnalyticsMetric,exports.AnalyticsTrend=$.AnalyticsTrend,exports.LineChart=ee.LineChart,exports.LinearChipGroupedChart=re.LinearChipGroupedChart,exports.Card=te.Card,exports.PieChartAnalytics=te.PieChartAnalytics,exports.PieChart=oe.PieChart,exports.HorizontalGraph=ne.HorizontalGraph,exports.StackedBarChart=ie.StackedBarChart,exports.StackedBarDistributionChart=ae.StackedBarDistributionChart,Object.defineProperty(exports,"GRAPH_ORIENTATION",{enumerable:!0,get:function(){return se.GRAPH_ORIENTATION}}),exports.VerticalGraph=pe.VerticalGraph,exports.FunnelVerticalBarGraph=ue.FunnelVerticalBarGraph,Object.defineProperty(exports,"HEAT",{enumerable:!0,get:function(){return ce.HEAT}}),exports.HEAT_COLORS=ce.HEAT_COLORS,Object.defineProperty(exports,"HEAT_GRADING_TYPE",{enumerable:!0,get:function(){return ce.HEAT_GRADING_TYPE}}),exports.HeatMap=ce.HeatMap,exports.HeatBoxStyled=le.HeatBoxStyled,exports.HeatMapVertical=le.HeatMapVertical,exports.VerticalBarAndLinearGraph=de.VerticalBarAndLinearGraph,exports.calculatePercentage=me.calculatePercentage,exports.roundNumber=me.roundNumber,exports.truncateValueTo10K=me.truncateValueTo10K,exports.truncateValueToK=me.truncateValueToK,exports.AVATAR_SIZE_VS_ICON_SIZE_MAP=xe.AVATAR_SIZE_VS_ICON_SIZE_MAP,exports.Avatar=xe.Avatar,exports.BACKGROUND_VS_TEXT_COLOR_MAP=xe.BACKGROUND_VS_TEXT_COLOR_MAP,Object.defineProperty(exports,"AVATAR_BACKGROUND",{enumerable:!0,get:function(){return Te.AVATAR_BACKGROUND}}),exports.AVATAR_SIZE_MAP=Te.AVATAR_SIZE_MAP,Object.defineProperty(exports,"AVATAR_TYPES",{enumerable:!0,get:function(){return Te.AVATAR_TYPES}}),Object.defineProperty(exports,"SIZE",{enumerable:!0,get:function(){return Te.SIZE}}),exports.Alert=Pe.Alert,Object.defineProperty(exports,"ALERT_TYPES",{enumerable:!0,get:function(){return Se.ALERT_TYPES}}),exports.COLOR_CONFIG_MAP=Se.COLOR_CONFIG_MAP,Object.defineProperty(exports,"CONTENT_POSITION",{enumerable:!0,get:function(){return Se.CONTENT_POSITION}}),Object.defineProperty(exports,"RATIO",{enumerable:!0,get:function(){return Ae.RATIO}}),exports.Thumbnail=Ae.Thumbnail,exports.Curtain=Ce.Curtain,exports.DatePicker=ye.DatePicker,exports.DatePickerWrapper=Oe.DatePickerWrapper,exports.Loader=be.Loader,exports.Switch=be.Switch,exports.SwitchContainer=be.SwitchContainer,exports.Thumb=be.Thumb,exports.SubscriptionPlan=je.SubscriptionPlan,exports.BottomWrapper=Ee.BottomWrapper,exports.HeaderWrapper=Ee.HeaderWrapper,exports.SubscriptionPlanSelector=Ee.SubscriptionPlanSelector,exports.defaultTabs=Ee.defaultTabs,exports.NewSubscriptionPlan=Re.NewSubscriptionPlan,exports.SubscriptionPlansCollected=he.SubscriptionPlansCollected,exports.TabItemComponent=Be.TabItemComponent,exports.Tabs=Be.Tabs,exports.DynamicTabs=ge.DynamicTabs,exports.BikShimmer=Ie.BikShimmer,exports.TablePagination=_e.TablePagination,exports.TablePaginationCard=qe.TablePaginationCard,exports.TablePaginationCardStyled=qe.TablePaginationCardStyled,exports.StateModalComponent=fe.StateModalComponent,exports.DeleteConfirmationModal=ke.DeleteConfirmationModal,Object.defineProperty(exports,"ButtonActions",{enumerable:!0,get:function(){return Ne.ButtonActions}}),Object.defineProperty(exports,"ButtonTypes",{enumerable:!0,get:function(){return Ne.ButtonTypes}}),exports.StateComponent=Ne.StateComponent,Object.defineProperty(exports,"StateInterface",{enumerable:!0,get:function(){return Ne.StateInterface}}),exports.ShopifyScopeWrapper=De.ShopifyScopeWrapper,exports.WhatsAppTextEditor=we.WhatsAppTextEditor,exports.CustomRightBorder=Me.CustomRightBorder,Object.defineProperty(exports,"EditorActionTypes",{enumerable:!0,get:function(){return Me.EditorActionTypes}}),exports.WhatsAppTextEditorHeader=Me.WhatsAppTextEditorHeader,exports.BaseWhatsappContentLangHelper=Le.BaseWhatsappContentLangHelper,exports.CURTAIN_COLOR_CONFIG_MAP=Ve.CURTAIN_COLOR_CONFIG_MAP,Object.defineProperty(exports,"CURTAIN_MODE",{enumerable:!0,get:function(){return Ve.CURTAIN_MODE}}),Object.defineProperty(exports,"CURTAIN_TYPES",{enumerable:!0,get:function(){return Ve.CURTAIN_TYPES}}),exports.resizeImage=Ge.resizeImage,Object.defineProperty(exports,"PickerType",{enumerable:!0,get:function(){return ve.PickerType}}),exports.CardSelectionModal=Ue.CardSelectionModal,exports.BikImageCropper=Fe.BikImageCropper,exports.BikImagePipeline=He.BikImagePipeline,exports.ButtonGroup=We.ButtonGroup,exports.BikAccordion=Ye.BikAccordion,exports.FileUploader=Qe.FileUploader,exports.ColourInput=Ke.ColourInput,exports.BikHeader=ze.BikHeader,exports.BikLayout=Ze.BikLayout,exports.BikProfile=Xe.BikProfile,exports.SimpleSidebar=Je.SimpleSidebar,exports.BikSidebar=$e.BikSidebar,exports.FeatureModal=er.FeatureModal,exports.SidebarSkeleton=rr.SidebarSkeleton,exports.ShowShopifyRestrictedModal=tr.ShowShopifyRestrictedModal,exports.FeatureModalV2=or.FeatureModalV2,exports.SearchBar=nr.SearchBar,exports.CustomDateTime=ir.CustomDateTime,exports.PricePleaseProductPicker=ar.PricePleaseProductPicker,exports.ProductPickerContent=ar.ProductPickerContent,exports.DiscountModal=sr.DiscountModal,Object.defineProperty(exports,"COUPON_EXPIRATION",{enumerable:!0,get:function(){return pr.COUPON_EXPIRATION}}),exports.CouponExpiration=pr.CouponExpiration,Object.defineProperty(exports,"DISCOUNT_TARGET_SELECTION",{enumerable:!0,get:function(){return ur.DISCOUNT_TARGET_SELECTION}}),Object.defineProperty(exports,"DISCOUNT_TARGET_TYPES",{enumerable:!0,get:function(){return ur.DISCOUNT_TARGET_TYPES}}),Object.defineProperty(exports,"DISCOUNT_TYPES",{enumerable:!0,get:function(){return ur.DISCOUNT_TYPES}}),Object.defineProperty(exports,"DISCOUNT_VALUE_TYPES",{enumerable:!0,get:function(){return ur.DISCOUNT_VALUE_TYPES}}),Object.defineProperty(exports,"MIN_PURCHASE_REQUIREMENT",{enumerable:!0,get:function(){return ur.MIN_PURCHASE_REQUIREMENT}}),exports.CountryCodePicker=cr.CountryCodePicker,exports.CountriesData=lr.CountriesData,exports.DEFAULT_IMAGE=dr.DEFAULT_IMAGE,exports.ShimmerImage=dr.ShimmerImage,exports.ProductPickerModal=mr.ProductPickerModal,Object.defineProperty(exports,"ScreenName",{enumerable:!0,get:function(){return mr.ScreenName}}),exports.Carousel=xr.Carousel,exports.CarouselSecondary=Tr.CarouselSecondary,exports.AccessTokenTroubleshootDialog=Pr.AccessTokenTroubleshootDialog,exports.RadioList=Sr.RadioList,exports.CheckList=Ar.CheckList,Object.defineProperty(exports,"DateKeys",{enumerable:!0,get:function(){return Cr.DateKeys}}),Object.defineProperty(exports,"MEDIA_TYPES",{enumerable:!0,get:function(){return Cr.MEDIA_TYPES}}),exports.PostPicker=Cr.PostPicker,exports.dateOptions=Cr.dateOptions,exports.DropdownButton=yr.DropdownButton,exports.SideModal=Or.SideModal,exports.KeywordsInput=br.KeywordsInput,exports.AddVariableV2SideModal=jr.AddVariableV2SideModal,exports.AddVariableV2=Er.AddVariableV2,exports.NaLinkWrapper=Rr.NaLinkWrapper,exports.NavigationHyperlink=Rr.NavigationHyperlink,exports.SearchFilter=hr.SearchFilter,exports.InputWithVariables=Br.InputWithVariables,exports.DashboardReviewPopUp=gr.DashboardReviewPopUp,exports.StarRating=Ir.StarRating,exports.TestimonialCard=_r.TestimonialCard,exports.BikSlider=qr.BikSlider,exports.ResizableImage=fr.ResizableImage,exports.validateURL=kr.validateURL,exports.CarouselPreview=Nr.CarouselPreview,exports.Floater=Dr.Floater,exports.CardSelector=wr.CardSelector,exports.CardSelectorGroup=Mr.CardSelectorGroup,exports.VariablePicker=Lr.VariablePicker,exports.ActionButtons=Vr.ActionButtons,exports.ActivateBikAi=Gr.ActivateBikAi,exports.AiSyncProgress=vr.AiSyncProgress,exports.AiCreditsExhausted=Ur.AiCreditsExhausted,exports.AiCreditsLow=Fr.AiCreditsLow,exports.CustomPortal=Hr.CustomPortal;
|
|
@@ -12,6 +12,7 @@ export type CustomEditorProps = React.TextareaHTMLAttributes<HTMLTextAreaElement
|
|
|
12
12
|
* Calls only for editor only error, not for errors coming from outside
|
|
13
13
|
*/
|
|
14
14
|
onError?: (err: string) => void;
|
|
15
|
+
onClickVariable?: (variable: string) => void;
|
|
15
16
|
};
|
|
16
17
|
export type CustomEditorRef = {
|
|
17
18
|
addTextOrWrap: (textToAdd: string) => {
|
|
@@ -37,4 +38,5 @@ export declare const WhatsAppTextEditor: React.ForwardRefExoticComponent<React.T
|
|
|
37
38
|
* Calls only for editor only error, not for errors coming from outside
|
|
38
39
|
*/
|
|
39
40
|
onError?: ((err: string) => void) | undefined;
|
|
41
|
+
onClickVariable?: ((variable: string) => void) | undefined;
|
|
40
42
|
} & React.RefAttributes<CustomEditorRef>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as t}from"../../_virtual/_tslib.js";import{jsxs as n,jsx as e,Fragment as r}from"react/jsx-runtime";import l from"../../assets/icons/info.svg.js";import{BaseWhatsappContentLangHelper as o}from"../../helpers/BaseWhatsappContentLang.helper.js";import i,{useRef as
|
|
1
|
+
import{__rest as t}from"../../_virtual/_tslib.js";import{jsxs as n,jsx as e,Fragment as r}from"react/jsx-runtime";import l from"../../assets/icons/info.svg.js";import{BaseWhatsappContentLangHelper as o}from"../../helpers/BaseWhatsappContentLang.helper.js";import i,{useRef as c,useImperativeHandle as u,useEffect as s}from"react";import{COLORS as a}from"../../constants/Theme.js";import{BodyCaption as d}from"../TypographyStyle.js";import{OuterContainer as v,Container as m,TextSpace as h}from"./CustomEditor.styled.js";import{EditorActionTypes as f,WhatsAppTextEditorHeader as g}from"./WhatsAppTextEditorHeader.js";const p="Character limit reached",x=new o,j={[f.BOLD]:"*",[f.ITALIC]:"_",[f.STRIKETHROUGH]:"~"},C=i.forwardRef(((o,i)=>{var f,C,{onChange:T,onClickVariable:E,text:y,RightComponent:b,error:O,limit:w,onError:H,rows:L,actions:S}=o,R=t(o,["onChange","onClickVariable","text","RightComponent","error","limit","onError","rows","actions"]);const W=c(null);function A(t){const n=null==W?void 0:W.current;null!=n&&(n.selectionStart?(n.focus(),n.selectionEnd=t):n.focus())}function I(t){var n,e;let r=null!==(e=null===(n=W.current)||void 0===n?void 0:n.value)&&void 0!==e?e:"";if(W.current&&t){const n=W.current.selectionStart,e=W.current.selectionEnd,l=t;if(n===e)return M(l);{r=x.wrappWildcard(n,e,l,r);const t=x.getHTML(r);return W.current.value=r,{text:r,html:t}}}return{text:r,html:r}}function M(t){var n,e;let r=null!==(e=null===(n=W.current)||void 0===n?void 0:n.value)&&void 0!==e?e:"";if(W.current&&t){const n=W.current.selectionStart;if(n===W.current.selectionEnd)return k(t,n)}return{text:r,html:r}}function k(t,n){var e,r;let l=null!==(r=null===(e=W.current)||void 0===e?void 0:e.value)&&void 0!==r?r:"";l=l.slice(0,n)+t+l.slice(n);const o=x.getHTML(l);return W.current.value=l,{text:l,html:o}}return u(i,(()=>({addTextOrWrap:I,addText:M,get(){var t,n;return null!==(n=null===(t=W.current)||void 0===t?void 0:t.value)&&void 0!==n?n:""},setCaretPosition:A}))),s((()=>{if(null==W?void 0:W.current){W.current.value=y||"";const t=x.getHTML(y||"");null==T||T(y||"",t)}}),[y]),s((()=>{var t,n;(null===(t=null==W?void 0:W.current)||void 0===t?void 0:t.value)&&w&&((null===(n=null==W?void 0:W.current)||void 0===n?void 0:n.value.length)>w?null==H||H(p):null==H||H(null!=O?O:""))}),[null===(f=null==W?void 0:W.current)||void 0===f?void 0:f.value.length]),n(v,{children:[n(m,Object.assign({isError:!!O},{children:[e(g,{actions:S,ref:W,onActionSelect:function(t){if((null==j?void 0:j[t])&&W.current){const n=W.current.selectionStart;if(n===W.current.selectionEnd){k(null==j?void 0:j[t],n);const{text:e,html:r}=k(null==j?void 0:j[t],n);A(n+1),null==T||T(e,r)}else{const{text:n,html:e}=I(null==j?void 0:j[t]);null==T||T(n,e)}}},RightComponent:b,onEmojiClick:function(t){const{text:n,html:e}=M(t);null==T||T(n,e)}}),e(h,Object.assign({ref:W,onChange:function(t){const n=t.target.value,e=x.getHTML(n);null==T||T(n,e)}},R,{rows:L}))]})),O&&O!==p?n("div",Object.assign({style:{display:"flex",gap:6,alignItems:"center"}},{children:[e(l,{width:16,height:16,color:a.content.negative}),e(d,Object.assign({color:a.content.negative},{children:O}))]})):e(r,{children:w&&(null==W?void 0:W.current)?n(d,Object.assign({style:{color:O===p||(null===(C=null==W?void 0:W.current)||void 0===C?void 0:C.value.length)>w?a.content.negative:a.content.secondary}},{children:[W.current.value.length,"/",w]})):e(r,{})})]})}));C.displayName="WhatsAppTextEditor";export{C as WhatsAppTextEditor};
|
|
@@ -3,7 +3,6 @@ import { AVATAR_BACKGROUND, AVATAR_TYPES, SIZE } from "./AvatarHelper";
|
|
|
3
3
|
export declare const AVATAR_SIZE_VS_ICON_SIZE_MAP: {
|
|
4
4
|
SMALL: number;
|
|
5
5
|
MEDIUM: number;
|
|
6
|
-
INBOX: number;
|
|
7
6
|
LARGE: number;
|
|
8
7
|
};
|
|
9
8
|
export declare const BACKGROUND_VS_TEXT_COLOR_MAP: {
|
|
@@ -22,23 +21,5 @@ export type AvatarProps = {
|
|
|
22
21
|
color: string;
|
|
23
22
|
}>;
|
|
24
23
|
useNameFallback?: boolean;
|
|
25
|
-
channelName?: MESSAGE_CHANNELS;
|
|
26
|
-
inboxSettings?: {
|
|
27
|
-
isSelected: boolean;
|
|
28
|
-
isComments: boolean;
|
|
29
|
-
};
|
|
30
24
|
};
|
|
31
|
-
export declare const enum MESSAGE_CHANNELS {
|
|
32
|
-
INSTAGRAM = "instagram",
|
|
33
|
-
MESSENGER = "messenger",
|
|
34
|
-
WHATSAPP = "whatsapp",
|
|
35
|
-
GMAIL = "gmail",
|
|
36
|
-
LIVECHAT = "livechat",
|
|
37
|
-
GOOGLE_BUSINESS_CHAT = "gbm",
|
|
38
|
-
SHOPIFY = "shopify",
|
|
39
|
-
FACEBOOK = "facebook",
|
|
40
|
-
EMAIL = "email",
|
|
41
|
-
SMTP = "smtp",
|
|
42
|
-
FACEBOOK_CATALOG = "facebook-catalog"
|
|
43
|
-
}
|
|
44
25
|
export declare const Avatar: React.FC<AvatarProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as r}from"react";import{AvatarStyle as i}from"./Avatar.styled.js";import{SIZE as o,AVATAR_BACKGROUND as s,AVATAR_TYPES as c,AVATAR_SIZE_MAP as a}from"./AvatarHelper.js";import{BodyTiny as n,TitleSmall as l,TitleMedium as d}from"../TypographyStyle.js";import{COLORS as p}from"../../constants/Theme.js";const m={[o.SMALL]:16,[o.MEDIUM]:20,[o.LARGE]:32},h={[s.LIGHT]:p.content.secondary,[s.DARK]:p.surface.standard},b=s=>{const[p,b]=r(!1),g=()=>{const e=(s.name||"").split(".").join(" ").split(" ").map((e=>e.charAt(0).toUpperCase())).slice(0,2).join("");return s.size===o.SMALL?t(n,Object.assign({style:{color:h[s.background]}},{children:e})):s.size===o.MEDIUM?t(l,Object.assign({style:{color:h[s.background]}},{children:e})):s.size===o.LARGE?t(d,Object.assign({style:{color:h[s.background]}},{children:e})):void 0};return e(i,Object.assign({type:s.type,size:s.size,background:s.background},{children:[s.type===c.IMAGE&&(s.useNameFallback&&!p?t("img",{alt:"",width:a[s.size],height:a[s.size],style:{borderRadius:"50%",objectFit:"contain"},src:s.photoUrl,onError:()=>{b(!0)}}):s.useNameFallback&&p&&s.name?t("div",{children:g()}):t("img",{alt:"",width:a[s.size],height:a[s.size],style:{borderRadius:"50%",objectFit:"contain"},src:s.photoUrl})),s.type===c.INITIALS&&t("div",{children:g()}),s.type===c.ICON&&s.icon&&t(s.icon,{width:m[s.size],height:m[s.size],color:h[s.background]})]}))};export{m as AVATAR_SIZE_VS_ICON_SIZE_MAP,b as Avatar,h as BACKGROUND_VS_TEXT_COLOR_MAP};
|
|
@@ -6,8 +6,7 @@ export declare enum AVATAR_TYPES {
|
|
|
6
6
|
export declare enum SIZE {
|
|
7
7
|
SMALL = "SMALL",
|
|
8
8
|
MEDIUM = "MEDIUM",
|
|
9
|
-
LARGE = "LARGE"
|
|
10
|
-
INBOX = "INBOX"
|
|
9
|
+
LARGE = "LARGE"
|
|
11
10
|
}
|
|
12
11
|
export declare enum AVATAR_BACKGROUND {
|
|
13
12
|
LIGHT = "LIGHT",
|
|
@@ -17,5 +16,4 @@ export declare const AVATAR_SIZE_MAP: {
|
|
|
17
16
|
SMALL: number;
|
|
18
17
|
MEDIUM: number;
|
|
19
18
|
LARGE: number;
|
|
20
|
-
INBOX: number;
|
|
21
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var I,L,A;!function(I){I.IMAGE="IMAGE",I.INITIALS="INITIALS",I.ICON="ICON"}(I||(I={})),function(I){I.SMALL="SMALL",I.MEDIUM="MEDIUM",I.LARGE="LARGE"
|
|
1
|
+
var I,L,A;!function(I){I.IMAGE="IMAGE",I.INITIALS="INITIALS",I.ICON="ICON"}(I||(I={})),function(I){I.SMALL="SMALL",I.MEDIUM="MEDIUM",I.LARGE="LARGE"}(L||(L={})),function(I){I.LIGHT="LIGHT",I.DARK="DARK"}(A||(A={}));const M={[L.SMALL]:24,[L.MEDIUM]:40,[L.LARGE]:64};export{A as AVATAR_BACKGROUND,M as AVATAR_SIZE_MAP,I as AVATAR_TYPES,L as SIZE};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as
|
|
1
|
+
import{jsxs as e,Fragment as l,jsx as a}from"react/jsx-runtime";import r from"../../assets/icons/PlusIcon.js";import{useRef as t,useState as i,useEffect as n}from"react";import o from"styled-components";import{v4 as s}from"uuid";import{COLORS as c}from"../../constants/Theme.js";import{AddVariableStyled as d}from"../add-variableV2/AddVariableBox.styled.js";import{Floater as u}from"../floater/floater.js";import{Input as p}from"../input/Input.js";import{BodyCaption as v}from"../TypographyStyle.js";import{VariablePicker as m}from"../variable-picker-v3/VariablePicker.js";import{PickerType as h}from"../variable-picker-v3/model.js";import{CustomPortal as b}from"./customPortal.js";const g=o=>{let{type:c,allowMix:g,onChange:T,prevVariable:f,variablesList:x,onBlur:V,onlyVariables:j,placeHolder:k,showAddButton:C=!0,showHelp:E,errorMessage:O,maxCharLimit:w,noMaxCharCheck:D,labelText:A,labelElement:M,isRequired:S=!1,hintText:B,onEnterPress:F,pickerType:R=h.FLOATER,portalElement:H,showVarHeader:I,varHeaderText:L,onPickerToggle:P}=o;const N=t(),$=t(!0),q=t(null),[z,K]=i(!1),[G]=i(s()),[J,Q]=i(),[U,W]=i(f),[X,Y]=i(!1),[Z,_]=i(!1),[ee,le]=i(0);return n((()=>{if(J&&J.actualValue)if(g){if(W((e=>{return{actualValue:(l=e.actualValue,a=J.actualValue,r=ee,l.slice(0,r)+a+l.slice(r)),variableType:"string"};var l,a,r})),q.current){le(q.current.selectionStart);const e=ee+J.actualValue.length+2;q.current.setSelectionRange(e,e),le(e)}}else W((e=>({actualValue:J.actualValue,variableType:J.variableType,needsFetching:J.needsFetching})))}),[J]),n((()=>{$.current?$.current=!1:T(U)}),[U]),e(l,{children:[e(y,Object.assign({isVar:/^{{.*}}$/.test(U.actualValue),onKeyDown:e=>{console.log("key",e.key),"Enter"===e.key&&(null==F||F(U.actualValue))}},{children:[a(p,{isRequired:S,hintText:B,type:null!=c?c:"text",id:G,ref:q,skipFocus:!0,isActive:z,value:U.actualValue,validate:e=>[!0,""],errorMessage:O,noMaxCharCheck:D,maxCharLimit:w,labelText:A,labelElement:M,placeholder:k||"Add a value",onClick:e=>{q.current&&le(q.current.selectionStart)},onChangeText:(e,l)=>{if(q.current&&le(q.current.selectionStart),j){const e=(null==l?void 0:l.keyCode)||(null==l?void 0:l.charCode);8!==e&&46!==e||W({actualValue:"",variableType:"string"})}else W(g?{actualValue:e,variableType:"string"}:{actualValue:e.replace(/{{.*}}/,""),variableType:"string"})},onReferenceInit:()=>{},onFocus:e=>{K(!0),_(!0)},onBlur:e=>{var l,a,r,t,i,n,o;console.log("ee",null===(l=e.relatedTarget)||void 0===l?void 0:l.id),null==V||V(e,U),"addVar"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||"variable-picker-v3"===(null===(r=e.relatedTarget)||void 0===r?void 0:r.id)||(null===(i=null===(t=e.relatedTarget)||void 0===t?void 0:t.className)||void 0===i?void 0:i.includes("accordion"))||"back-btn-v3"===(null===(n=e.relatedTarget)||void 0===n?void 0:n.id)?(q.current&&q.current.focus(),K(!0)):"search-bar-v3-picker"===(null===(o=e.relatedTarget)||void 0===o?void 0:o.id)?K(!0):(K(!1),Y(!1),null==P||P(!1),_(!1))}}),e("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between"}},{children:[U.actualValue&&E&&a("div",Object.assign({style:{marginTop:4}},{children:a(v,{children:`This value is of type ${U.variableType}`})})),C&&Z&&a("div",Object.assign({style:{marginTop:O||B?"-24px":"0px"}},{children:a(d,Object.assign({ref:N,id:"addVar",onClick:()=>{Y(!X),null==P||P(!X)}},{children:e("div",Object.assign({className:"add"},{children:[a(r,{color:"white"}),a("div",Object.assign({className:"variable"},{children:"Add variable"}))]}))}))}))]}))]})),X&&a(l,{children:R===h.EMBEDDED?a(b,Object.assign({zIndex:101,element:null!=H?H:document.body},{children:a(m,{width:"344px",showHeader:I,headerText:L,onClose:()=>{Y(!1),null==P||P(!1)},type:h.EMBEDDED,data:x,onSelect:e=>{Q(e),Y(!1),null==P||P(!1)}})})):a("div",Object.assign({style:{zIndex:101,position:"relative"}},{children:a(u,Object.assign({refElement:N},{children:a("div",Object.assign({style:{height:500}},{children:a(m,{onClose:()=>{Y(!1),null==P||P(!1)},type:h.FLOATER,data:x,onSelect:e=>{Q(e),Y(!1),null==P||P(!1)}})}))}))}))})]})},y=o.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
margin-bottom: 12px;
|
|
4
4
|
input {
|
|
@@ -7,6 +7,7 @@ import { EmailTemplateType } from '../template-preview/models/EmailTemplate';
|
|
|
7
7
|
import { SMSTemplateType } from '../template-preview/models/SmsTemplate';
|
|
8
8
|
import { CUSTOM_VARIABLE, GlobalPlaceholderType } from '../template-preview/models/TemplateMeta';
|
|
9
9
|
import { ExtrasWhatsapp, POD, WhatsAppPickerMeta, WhatsAppTemplate, WhatsAppTemplateVariables } from '../template-preview/models/WhatsAppTemplate';
|
|
10
|
+
import { VariableV3 } from '../variable-picker-v3/model';
|
|
10
11
|
export interface TemplateContextMapperProps {
|
|
11
12
|
selectedTemplate: WhatsAppTemplate | EmailTemplateType | SMSTemplateType | WhatsAppCarouselTemplate;
|
|
12
13
|
closeDialog?: () => void;
|
|
@@ -54,5 +55,6 @@ export interface TemplateContextMapperProps {
|
|
|
54
55
|
setFileName?: (name: string) => void;
|
|
55
56
|
hideDeviceContainerInPreview?: boolean;
|
|
56
57
|
maxCharLimit?: number;
|
|
58
|
+
onDefaultVariableSelect?: (variable: VariableV3) => void;
|
|
57
59
|
}
|
|
58
60
|
export declare const TemplateContextMapper: React.FC<TemplateContextMapperProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as l,Fragment as o}from"react/jsx-runtime";import{cloneDeep as t}from"lodash";import{useEffect as r,useState as i,useRef as a,useMemo as s}from"react";import n from"../../utils/StringUtils.js";import{COLORS as d}from"../../constants/Theme.js";import{StyledModal as u}from"../modals/styledModal.js";import{CHANNEL_TYPE as c}from"../template-preview/models/Channels.js";import{POD as p}from"../template-preview/models/WhatsAppTemplate.js";import{TemplateModalContext as m}from"./context/templateModalContext.js";import v from"./modalElements/Footer.js";import h from"./modalElements/TemplateSelectModalContent.js";import{convertPlaceholdersToBikDropdown as b}from"./utils/convertPlaceholdersToBikDropdown.js";const C=C=>{let{selectedTemplate:g,closeDialog:f,showVariableMapping:x,channel:P,htmlContent:E,templateVariables:S,onTemplateSelect:I,globalPlaceholders:T,showOnlyContent:y,whatsappSpecificPickerMeta:w,zIndex:V,showVariableModal:L,variableList:k,discountCode:j,setDiscountCode:D,onBackPress:M,enabledCustomText:A,variableListForImage:B,showSampleValues:F,disableEditVariable:H,pod:O,extras:W,pickerConf:N,selectedCarouselProducts:z,disableEditExpiry:R,cardWidth:$,onDeleteSelectedProducts:U,fileName:_,setFileName:q,hideDeviceContainerInPreview:G,maxCharLimit:J,onDefaultVariableSelect:K}=C;var Q,X,Y,Z,ee,le,oe,te;r((()=>{ce(E)}),[E]);const re=P===c.WHATSAPP&&"CAROUSEL"===(null===(X=null===(Q=null==g?void 0:g.components)||void 0===Q?void 0:Q[1])||void 0===X?void 0:X.type),ie=null==g?void 0:g.isProductCarouselType,[ae,se]=i(P===c.EMAIL||re?"desktop":"mobile"),[ne,de]=i(!1),[ue,ce]=i(E),[pe,me]=i(!1),[ve,he]=i([]),[be,Ce]=i({}),[ge,fe]=i(g),[xe,Pe]=i([]),[Ee,Se]=i(null),[Ie,Te]=i(!1),[ye,we]=i(null!=S?S:[]),[Ve,Le]=i(!1),[ke,je]=i(re?(null===(Z=null===(Y=null==ge?void 0:ge.mapping)||void 0===Y?void 0:Y.body)||void 0===Z?void 0:Z.length)?-1:0:-1),[De,Me]=i([]),[Ae,Be]=i(void 0),Fe=a(null),[He,Oe]=i(!1),[We,Ne]=i(!1),[ze,Re]=i(!1),[$e,Ue]=i({});r((()=>{z?Me(z):ie&&Me([])}),[z]),r((()=>{var e;if(!Ie&&ie&&(!z||0===Me.length)){const l=null===(e=null==ge?void 0:ge.components)||void 0===e?void 0:e[1].cards,o=[];null==l||l.forEach((e=>{var l;null===(l=null==e?void 0:e.components)||void 0===l||l.forEach((e=>{var l,t,r;"HEADER"===e.type&&o.push(null!==(r=null===(t=null===(l=e.example)||void 0===l?void 0:l.header_handle)||void 0===t?void 0:t[0])&&void 0!==r?r:"")}))})),Pe(o),Te(!0)}}),[Ie]);const _e=s((()=>b(T)),[T]);return r((()=>{Be(t(k))}),[k]),e(m.Provider,Object.assign({value:{hideFooterButton:ze,setHideFooterButton:Re,hideCrossButton:We,setHideCrossButton:Ne,variableList:Ae,setVariableList:Be,variableCallback:Ee,setVariableCallback:Se,showVariablePicker:ne,setShowVariablePicker:de,template:ge,setTemplate:fe,device:ae,setDevice:se,display_content:ue,setDisplayContent:ce,originalVariableList:ye,setOriginalVariableList:we,isError:pe,setIsError:me,channel:P,globalNormalizedPlaceholders:_e,templateSelectionTriggered:Ve,setTemplateSelectionTriggered:Le,enabledCustomText:A,disableEditVariable:H,pod:O,extras:W,isWhatsappCarousel:re,selectedCarouselIndex:ke,setSelectedCarouselIndex:je,isProductCarouselType:ie,templateErrorIndexes:be,cardCount:re?null===(le=null===(ee=g.components)||void 0===ee?void 0:ee[1].cards)||void 0===le?void 0:le.length:void 0,errorIndexes:ve,setErrorIndexes:he,pickerConf:N,carouselProducts:De,setCarouselProducts:Me,disableEditExpiry:R,cardWidth:$,cardImages:xe,onDeleteSelectedProducts:U,hideDeviceContainerInPreview:G,sliderRef:Fe,isCarouselHovered:He,setIsCarouselHovered:Oe,maxCharLimit:J,ctaOptionsErrors:$e,setCtaOptionsErrors:Ue,onDefaultVariableSelect:K}},{children:y?e(h,{variableListFromProps:k,channel:c.EMAIL,hideHeader:!0}):l(u,Object.assign({hideCrossButton:We,zIndex:V,centralContainerStyles:{width:re?900:P===c.EMAIL&&x?1e3:800},open:!0,onClose:()=>{null==f||f()},headingTitle:null==ge?void 0:ge.label,headingSubtitle:P===c.WHATSAPP?`${n.capitaliseFirstLetterOfString(null!==(oe=null==ge?void 0:ge.category)&&void 0!==oe?oe:"")} • ${null!==(te=null==ge?void 0:ge.templateCategory)&&void 0!==te?te:""}`:"",onBackPress:()=>{null==M||M()},modalHeaderStyles:{borderBottom:`1px solid ${d.stroke.primary}`}},{children:[e(h,{variableListFromProps:k,showSampleValues:F,showVariableMapping:x,channel:P,whatsappSpecificPickerMeta:w,showVariableModal:L,discountCode:j,setDiscountCode:D,variableListForImage:B&&(null==B?void 0:B.length)>0?B:Ae,fileName:_,setFileName:e=>{null==q||q(e)}}),I?e(v,{isWhatsappCarousel:null!=re&&re,onSelect:function(){var e;if((null==De?void 0:De.length)<1&&ie)return void me(!0);if(Object.keys($e).length>0&&O!==p.CHATBOT)return void me(!0);const l=null==I?void 0:I(ge,ye,null!=ue?ue:"",De);Ce(null!==(e=null==l?void 0:l.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==l?void 0:l.errorIndexes)||(null==l?void 0:l.error)?((null==l?void 0:l.errorIndexes)&&he(l.errorIndexes),(null==l?void 0:l.error)&&me(!!(null==l?void 0:l.error))):Le(!0)}}):e(o,{})]}))}))};export{C as TemplateContextMapper};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VariableV3 } from "../../../helpers";
|
|
1
2
|
import React, { LegacyRef } from 'react';
|
|
2
3
|
import Slider from 'react-slick';
|
|
3
4
|
import { VariableListInterfaceV2 } from "../../add-variableV2";
|
|
@@ -74,6 +75,7 @@ export declare const TemplateModalContext: React.Context<{
|
|
|
74
75
|
setCtaOptionsErrors?: React.Dispatch<React.SetStateAction<{
|
|
75
76
|
[key: string]: string;
|
|
76
77
|
}>> | undefined;
|
|
78
|
+
onDefaultVariableSelect?: ((variable: VariableV3) => void) | undefined;
|
|
77
79
|
}>;
|
|
78
80
|
export declare const useTemplateModalContext: () => {
|
|
79
81
|
hideFooterButton: boolean;
|
|
@@ -140,4 +142,5 @@ export declare const useTemplateModalContext: () => {
|
|
|
140
142
|
setCtaOptionsErrors?: React.Dispatch<React.SetStateAction<{
|
|
141
143
|
[key: string]: string;
|
|
142
144
|
}>> | undefined;
|
|
145
|
+
onDefaultVariableSelect?: ((variable: VariableV3) => void) | undefined;
|
|
143
146
|
};
|
|
@@ -19,4 +19,4 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import"../../cur
|
|
|
19
19
|
background-image: ${e=>e.hideDeviceContainerInPreview&&e.channel===p.WHATSAPP?`url(${u});`:"none"};
|
|
20
20
|
display: ${e=>e.hideDeviceContainerInPreview&&e.channel===p.WHATSAPP?"flex":"initial"};
|
|
21
21
|
align-items: flex-start;
|
|
22
|
-
`,
|
|
22
|
+
`,S=n=>{const{showVariableMapping:u,showOnlyContent:S,whatsappSpecificPickerMeta:k,showVariableModal:j,discountCode:V,setDiscountCode:A,variableListForImage:M,showSampleValues:W,variableListFromProps:T,fileName:D,setFileName:E}=n,I=l(),$=l(),{variableList:H,setVariableList:L,variableCallback:B,showVariablePicker:F,setShowVariablePicker:O,device:_,display_content:N,channel:G,template:q,setTemplate:z,isWhatsappCarousel:J,isProductCarouselType:K,hideDeviceContainerInPreview:Q,onDefaultVariableSelect:R}=h();const U=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t};return e(P,{children:[t(y,Object.assign({showOnlyContent:S,showVariableMapping:u,isWhatsappCarousel:J,hideDeviceContainerInPreview:Q,channel:G},{children:"mobile"===_?t(g,{ref:$,display_content:null!=N?N:"",channel:G,template:q,showSampleValues:W}):G===p.WHATSAPP&&J?t(r,{ref:I,channel:G,template:q,showSampleValues:W,isPreview:!1,showArrows:!0}):G!==p.MESSAGE?t(f,{ref:I,channel:G,display_content:null!=N?N:"",showSampleValues:W}):t(o,{})})),(K||u)&&e(x,Object.assign({channel:G,isWhatsappCarousel:J,showVariableMapping:!0},{children:[t("div",Object.assign({style:{height:"100%",width:"whatsapp"===G?428:400,display:F?"block":"none"}},{children:t(c,{hideHeaderCross:!0,showHeader:!0,showBackButton:!0,onBackButtonClick:()=>{L(a(T)),O(!1)},onSelect:e=>{B(e),L(a(T)),O(!1)},type:i.EMBEDDED,data:null!=H?H:[],onDefaultVariableSelect:R},Math.random())})),t("div",Object.assign({style:{padding:"16px 14px",width:"whatsapp"===G?428:400,display:F?"none":"block"}},{children:G!==p.WHATSAPP?t(C,{onFocus:G===p.EMAIL?function(e){var t,o,i;const a=null===document||void 0===document?void 0:document.getElementById("mobile"===_?"template_html_mobile":"template_html_desktop"),l=w(e+1),n=G===p.EMAIL?null===(t=null==a?void 0:a.contentWindow)||void 0===t?void 0:t.document.getElementById(l):document.getElementById(l),r=U(n),s=null==n?void 0:n.offsetLeft;"desktop"===_?r&&I.current&&(null===(o=null==a?void 0:a.contentWindow)||void 0===o||o.scrollTo(null!=s?s:0,r),v(l,m.background.warning.light,2,G,_)):r&&$.current&&(null===(i=null==a?void 0:a.contentWindow)||void 0===i||i.scrollTo(null!=s?s:0,r),v(l,m.background.warning.light,2,G,_))}:void 0,showVariableModal:j,discountCode:V,setDiscountCode:A}):G===p.WHATSAPP&&J?t(s,{whatsappSpecificPickerMeta:k,template:q,showVariableModal:j,variableListForImage:M,discountCode:V,setDiscountCode:A}):t(b,{whatsappSpecificPickerMeta:k,template:q,onTemplateChange:e=>{null==z||z(e)},showVariableModal:j,variableListForImage:M,discountCode:V,setDiscountCode:A,fileName:D,setFileName:E})}))]})),[p.WHATSAPP,p.SMS].includes(G)&&!u&&!K&&t(x,{children:t(d,Object.assign({color:m.content.secondary,style:{fontStyle:"italic"}},{children:"Click on ‘Select template’ below to use it"}))})]})};export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as t,jsxs as s,Fragment as i}from"react/jsx-runtime";import o from"../../assets/icons/arrow_back.svg.js";import l from"../../assets/icons/cross.svg.js";import a from"../../assets/icons/plus.svg.js";import n from"../../assets/icons/triangle_error.svg.js";import{useState as r,useEffect as c}from"react";import{COLORS as d}from"../../constants/Theme.js";import{BikAccordion as h}from"../accordion/Accordion.js";import{IconButton as
|
|
1
|
+
import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as t,jsxs as s,Fragment as i}from"react/jsx-runtime";import o from"../../assets/icons/arrow_back.svg.js";import l from"../../assets/icons/cross.svg.js";import a from"../../assets/icons/plus.svg.js";import n from"../../assets/icons/triangle_error.svg.js";import{useState as r,useEffect as c}from"react";import{COLORS as d}from"../../constants/Theme.js";import{BikAccordion as h}from"../accordion/Accordion.js";import{IconButton as p}from"../icon-button/IconButton.js";import{Input as m}from"../input/Input.js";import{ListItem as u}from"../list-item/ListItem.js";import{Switch as g}from"../switch/Switch.js";import{Tooltip as b}from"../tooltips/Tooltip.js";import{TitleRegular as f,BodySecondary as y,BodyCaption as v,TitleSmall as j}from"../TypographyStyle.js";import{VariablePickerContext as x}from"./context.js";import{DefaultVariableContent as O}from"./DefaultVariableContent.js";import{PickerType as S}from"./model.js";import w from"./NoResult.js";import{showOnlyRecommendedVariables as k}from"./recommendVaribles.js";import{searchVariables as C}from"./searchVariables.js";import{HeaderWrapper as V,RecommendWrapper as T,BackHeader as I,Container as N}from"./styles.js";import B,{renderTooltipBody as D}from"./SubHeaderItems.js";const R=(e,i)=>{if(0===i.length)return e;const o=e.toLowerCase().indexOf(i.toLowerCase());if(-1===o)return e;const l=e.slice(0,o),a=e.slice(o,o+i.length),n=e.slice(o+i.length);return s("span",{children:[l,t("b",Object.assign({style:{color:d.content.primary}},{children:a})),n]})},E=/.*\..*/,H=H=>{const{data:L,onSelect:$,showHeader:P,showBackButton:_,hideHeaderCross:A,onBackButtonClick:z,isEvaluationList:F,autoOpenFirst:K,headerText:M,contentHeight:q,onDefaultVariableSelect:G}=H,[J,Q]=r(L),[U,W]=r(""),[X,Y]=r([]),[Z,ee]=r(""),[te,se]=r(!1),[ie,oe]=r([]),[le,ae]=r(!1),[ne,re]=r(),ce=le&&H.type===S.EMBEDDED&&!A;c((()=>{de(!0)}),[]),c((()=>{X.length>0?oe([X[X.length-1]]):oe(L)}),[X]);const de=t=>e(void 0,void 0,void 0,(function*(){if(se(t),t){const e=k(J,X);Q(e)}else if(X.length>0){const e=Z==X[X.length-1].displayName;if(U.length>0&&e){const e=C(U,ie,X);Q(e)}else Q([X[X.length-1].variables])}else if(U.length>0){const e=C(U,ie,X);Q(e)}else Q(L)})),he=()=>{if(q)return q;let e=131;return X.length>0&&(e+=32),(H.showHeader||H.showBackButton)&&(e+=40),`calc(100% - ${e}px)`},pe=e=>{if(!H.disabled)if(F){const t=(e=>{if(e.actualValue.match(E)){const t=e.actualValue.replace("{{","").replace("}}","").split(".");let s=t[0];return t.forEach(((e,t)=>{if(0===t)return;const i=(e=>/\w+\[\d+\]/g.test(e))(e);if(i){const t=e.match(/(\w+)\[(\d+)\]/);if(t){const e=t[1],i=t[2];s+=`['${e}'][${i}]`}}else s+=`['${e}']`})),s}return e.actualValueEval?e.actualValueEval:e.actualValue})(e);$(Object.assign(Object.assign({},e),{actualValue:t}))}else{if(e.isDefaultValueSupported)return re(e),void ae(!0);$(e)}};return t(x.Provider,Object.assign({value:{variables:J,searchText:U,subHeaderStack:X,showRecommended:te,setSubHeaderStack:Y,setSearchText:W,setVariables:Q,setShowRecommended:se}},{children:s("div",Object.assign({tabIndex:-1,id:"variable-picker-v3",style:{backgroundColor:"white",borderRadius:4,height:"100%",outline:"none"},onClick:e=>e.stopPropagation()},{children:[(P||_||le)&&s(V,Object.assign({openDefault:le},{children:[s("div",Object.assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[(_||le)&&t(p,{Icon:()=>t(o,{width:16,height:16,style:{display:"flex",color:d.content.primary}}),onClick:()=>{le?le&&ae(!1):z&&z()}}),(P||le)&&t(f,{children:le?"Set up":null!=M?M:"Select Variable"})]})),ce&&t(p,{style:{color:"#212121"},Icon:l,onClick:()=>H.onClose&&H.onClose()})]})),le&&ne?t(O,{variable:ne,onInsertVariable:e=>{$(e),null==G||G(e),console.log("insert",e)}}):s(i,{children:[t("div",Object.assign({style:{padding:"0 16px",paddingTop:12,backgroundColor:d.surface.subdued,borderTopLeftRadius:4,borderTopRightRadius:4}},{children:t(m,{id:"search-bar-v3-picker",onBlur:e=>{H.onSearchBlur&&H.onSearchBlur(e)},value:U,noKeyDownChange:!0,placeholder:"Search",onChangeText:e=>{e||ee("");const t=C(e,ie,X);if(te){const e=k(t,X);Q(e)}else Q(t);W(e);const s=X.length>0?X[X.length-1].displayName:"home";ee(s)}})})),s(T,{children:[t(y,Object.assign({style:{color:d.content.secondary}},{children:"Only Recommended"})),t(g,{value:te,onValueChange:t=>e(void 0,void 0,void 0,(function*(){yield de(t)}))})]}),X.length>0&&s(I,{children:[t("div",Object.assign({style:{position:"absolute",left:16}},{children:t(p,{id:"back-btn-v3",style:{display:"flex"},Icon:()=>t(o,{width:12,height:12,style:{color:d.content.secondary}}),onClick:e=>{e.stopPropagation();let t=U;const s=[...X],i=s.pop();if(Y(s),i.displayName===Z&&(W(""),t=""),t.length>0){const e=s.length>0?[s[s.length-1]]:L,i=C(t,e,s);if(te){const e=k(i,s);Q(e)}else Q(i)}else if(s.length>0)if(te){const e=k([s[s.length-1].variables],s);Q(e)}else Q([s[s.length-1].variables]);else if(te){const e=k(L,X);Q(e)}else Q(L)}})})),t(v,Object.assign({style:{color:d.content.secondary}},{children:X[X.length-1].displayName}))]}),t(i,{children:J.length>0?t(N,Object.assign({height:he()},{children:J.map(((e,o)=>{var l,r;return e.displayName&&void 0!==e.variables?t("div",Object.assign({style:{borderBottom:`1px solid ${d.stroke.primary}`}},{children:t(h,Object.assign({autoOpen:K&&0===o,headerPadding:"12px 16px",header:t(j,Object.assign({style:{color:d.content.secondary}},{children:R(e.displayName,U)}))},{children:t(B,{parentVariable:e,disabled:null!==(l=H.disabled)&&void 0!==l&&l,searchText:U,variable:e.variables,onSelect:e=>{if(e.isDefaultValueSupported)return re(e),void ae(!0);$(e)}})}))}),e.displayName+te):e.displayName?t(b,Object.assign({body:D(e),placement:"bottom"},{children:t(u,{variant:H.disabled?"readonly":(null==e?void 0:e.selected)?"selected":"default",version:"2.0",leadingIcon:(null==e?void 0:e.selected)||H.disabled?t(i,{}):t(a,{width:14,height:14}),customListItemLabel:s("div",Object.assign({style:{display:"flex",gap:4}},{children:[t(y,Object.assign({style:{fontSize:"14px",color:d.text.primary}},{children:R(e.displayName,U)})),!e.isAvailable&&t(b,Object.assign({body:"Not Recommended"},{children:t("div",Object.assign({style:{display:"flex",marginTop:2}},{children:t(n,{width:16,height:16,color:d.content.secondary})}))}))]})),listItem:{label:e.displayName,value:e.displayName},subText:e.description||"",onClick:()=>pe(e)},o)}),o):t(B,{disabled:null!==(r=H.disabled)&&void 0!==r&&r,searchText:U,variable:e,onSelect:e=>pe(e)},o)}))})):t(w,{height:he(),searchText:U})})]})]}))}))};export{H as VariablePickerContent,R as highlightSearchText};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,Fragment as i,jsxs as a}from"react/jsx-runtime";import{useState as t}from"react";import{Button as l}from"../button/Button.js";import{CheckBox as r}from"../checkBox/CheckBox.js";import{Input as o}from"../input/Input.js";import{TitleRegular as s,BodySecondary as n}from"../TypographyStyle.js";const d=d=>{var p,u,c;const[b,f]=t(d.variable.defaultValue||""),[g,m]=t(""),[h,v]=t(!!(null===(p=d.variable)||void 0===p?void 0:p.enableDefaultValueForGlobalUsage));return e(i,{children:a("div",Object.assign({style:{padding:"0 16px",paddingTop:12,borderTopLeftRadius:4,borderTopRightRadius:4}},{children:[e("div",Object.assign({style:{paddingBottom:16,borderBottom:"1px solid #E0E0E0"}},{children:e(s,{children:null===(u=d.variable)||void 0===u?void 0:u.displayName})})),a("div",Object.assign({style:{paddingTop:24}},{children:[e(o,{onChangeText:e=>{m(""),f(e)},value:b,isRequired:!0,labelText:"Default Value",hintText:"Used if this field is missing for a customer",errorMessage:null!=g?g:"",maxCharLimit:25}),a("div",Object.assign({style:{paddingTop:24,gap:8,alignItems:"flex-start"},className:"d-flex"},{children:[e(r,{isChecked:h,onValueChange:e=>v(e),size:"SMALL",skipHoverState:!0}),e(n,Object.assign({style:{marginTop:-2}},{children:`Make this the default value for ‘${null===(c=d.variable)||void 0===c?void 0:c.displayName}’`}))]})),e("div",Object.assign({style:{padding:"24px 0px",display:"flex",flexDirection:"row",justifyContent:"flex-end"}},{children:e(l,{buttonText:"Insert Variable",buttonType:"primary",onClick:()=>{if(!b)return void m("This field is required");const e=Object.assign(Object.assign({},d.variable),{defaultValue:b,enableDefaultValueForGlobalUsage:h});d.onInsertVariable(e)}})}))]}))]}))})};export{d as DefaultVariableContent};
|
|
@@ -17,6 +17,8 @@ export interface VariablePickerV3Props {
|
|
|
17
17
|
disabled?: boolean;
|
|
18
18
|
autoOpenFirst?: boolean;
|
|
19
19
|
headerText?: string;
|
|
20
|
+
contentHeight?: string;
|
|
21
|
+
onDefaultVariableSelect?: (variable: VariableV3) => void;
|
|
20
22
|
}
|
|
21
23
|
export interface VariableListInterfaceV3 {
|
|
22
24
|
isSubHeader?: boolean;
|
|
@@ -54,4 +56,6 @@ export interface VariableV3 {
|
|
|
54
56
|
[key: string]: VariableV3;
|
|
55
57
|
};
|
|
56
58
|
needsFetching?: boolean;
|
|
59
|
+
isDefaultValueSupported?: boolean;
|
|
60
|
+
enableDefaultValueForGlobalUsage?: boolean;
|
|
57
61
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const HeaderWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
1
|
+
export declare const HeaderWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
openDefault?: boolean | undefined;
|
|
3
|
+
}, never>;
|
|
2
4
|
export declare const RecommendWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
5
|
export declare const BackHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
6
|
export declare const Container: import("styled-components").StyledComponent<"div", any, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from"styled-components";import{COLORS as t}from"../../constants/Theme.js";const o=e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
padding: 12px 16px 0px 16px;
|
|
4
|
+
padding: ${e=>e.openDefault?"12px 16px":"12px 16px 0px 16px"};
|
|
5
5
|
background-color: ${t.surface.subdued};
|
|
6
6
|
justify-content: space-between;
|
|
7
7
|
border-top-right-radius: 4px;
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AmplitudeEvent}from"./amplitude/index.js";import*as o from"./components/template-preview/constants/regexPatterns.js";export{o as regexPatterns};export{default as StringUtils}from"./utils/StringUtils.js";export{BASE_COLORS,COLORS,DEFAULT_THEME,FONTS}from"./constants/Theme.js";export{ComponentZindex}from"./constants/zindex.js";export{CheckBox}from"./components/checkBox/CheckBox.js";export{ListItem}from"./components/list-item/ListItem.js";export{Pagination}from"./components/pagination/Pagination.js";export{RadioButton}from"./components/radioButton/RadioButton.js";export{Toaster}from"./components/toaster/Toaster.js";export{Tooltip}from"./components/tooltips/Tooltip.js";export{PureSpinner,Spinner}from"./components/spinner/Spinner.js";export{Stepper}from"./components/stepper/Stepper.js";export{Tag}from"./components/tag/Tag.js";export{IconButton}from"./components/icon-button/IconButton.js";export{TemplatePreview}from"./components/template-preview/TemplatePreview.js";export{WhatsappLikePreview}from"./components/template-preview/WhatsApp/WhatsAppLikePreview.js";export{WhatsappLikePreviewV2}from"./components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js";export{renderVariableUIForPreview}from"./components/template-preview/helpers/SmsTemplateHelper.js";export{WhatsAppFormatToHTML}from"./components/template-preview/helpers/WhatsAppFormatToHTML.js";export{VariableEditorHelper}from"./components/template-preview/helpers/VariableEditorHelper.js";export{ACTIONS_TYPES,CUSTOM_URL_NAME,HEADER_TYPES,TEMPLATE_EDITOR,TEMPLATE_STATUS}from"./components/template-preview/models/TemplateMeta.js";export{BUTTON_TYPE,POD}from"./components/template-preview/models/WhatsAppTemplate.js";export{TemplateContextMapper}from"./components/template-context-mapper/TemplateContextMapper.js";export{getAllDataFromTemplateComponent}from"./components/template-context-mapper/utils/getDataFromTemplateComponent.js";export{isVariable,validateIsUrl}from"./components/template-context-mapper/utils/validateIsUrl.js";export{FABMenu}from"./components/fab-menu/FABMenu.js";export{FloatingActionButton}from"./components/floating-action-button/FloatingActionButton.js";export{DROP_POSITION,DropdownToggleContainer,FAB_POSITION,FloatingActionButtonContainer,FloatingActionButtonOuterContainer,MENU_ALIGNMENT,StyledDropdown,TooltipStyled}from"./components/floating-action-button/FloatingActionButton.styles.js";export{ImageService}from"./components/image-compress/ImageCompress.js";export{AiBodyCaption,AiBodyTiny,BodyCaption,BodyLarge,BodyPrimary,BodyPrimaryLink,BodyRegular,BodySecondary,BodySecondaryLink,BodySmall,BodyTiny,ButtonLarge,ButtonLargeAI,ButtonRegular,ButtonRegularAI,Caption,CaptionBold,Display,SmallRegular,SubHeading,TextPlaceholder,Tiny,TitleFour,TitleLarge,TitleMedium,TitleRegular,TitleSmall,TitleXlarge}from"./components/TypographyStyle.js";export{Button}from"./components/button/Button.js";export{ProgressBarComponent,ProgressCompletedBar}from"./components/progress-bar/ProgressBarComponent.js";import"react/jsx-runtime";export{ProgressBarType,ProgressBarV2,TextAlignment}from"./components/progress-bar-v2/ProgressBarV2.js";export{QueryBuilder}from"./components/QueryBuilder/QueryBuilder.js";export{BaseQueryBuilderNode}from"./components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";export{PropertyNode,PropertyNodeHeadless}from"./components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js";export{queryBuilderSlice}from"./components/QueryBuilder/redux/queryBuilder.reducer.js";export{queryBuilderCacheSlice}from"./components/QueryBuilder/redux/queryBuilderCache.reducer.js";export{AD_STRING_OPERATORS,ANY_AD_OPERATORS,ANY_IG_OPERATORS,BOOLEAN_OPERATORS,DATE_OPERATORS,EVENT_VALUES,EXACTLY_OPERATORS,FREQUENCY_OPERATORS,ICE_BREAKER_OPERATORS,IG_STRING_OPERATORS,INTEGER_OPERATORS,MAIL_SUBJECT_OPERATORS,REACTION_OPERATORS,SPECIFIC_IG_OPERATORS,STRING_OPERATORS,STRING_RESTRICTED_OPERATORS,STRING_RESTRICTED_OPERATORS_2,STRING_RESTRICTED_OPERATORS_3}from"./components/QueryBuilder/types/QueryBuilderOperator.type.js";export{StyledModal}from"./components/modals/styledModal.js";export{DropdownPopover}from"./components/dropdown/DropdownPopover/index.js";export{Dropdown}from"./components/dropdown/Dropdown.js";export{ChipDropdown}from"./components/dropdown/ChipDropdown.js";export{OpenedDropdown}from"./components/dropdown/OpenedDropdown/components/OpennedDropdown.js";export{MenuItemDropdown}from"./components/dropdown/MenuItem/MenuItem.js";export{AnalyticsCard}from"./components/analytics-card/AnalyticsCard.js";export{AnalyticsContainer,CardDataContainer}from"./components/analytics-card/AnalyticsCard.styled.js";export{Input}from"./components/input/Input.js";export{AnalyticsChip}from"./components/analytics-chips-and-dropdowns/AnalyticsChip.js";export{AnalyticsDropdown,EachItem,formatDate}from"./components/analytics-chips-and-dropdowns/AnalyticsDropdown.js";export{AnalyticsMultiChip}from"./components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js";export{AnalyticsMetric}from"./components/analytics-chips-and-dropdowns/AnalyticsMetric.js";export{AnalyticsTrend}from"./components/analytics-chips-and-dropdowns/AnalyticsTrend.js";export{LineChart}from"./components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js";export{LinearChipGroupedChart}from"./components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js";export{Card,PieChartAnalytics}from"./components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js";export{PieChart}from"./components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js";export{HorizontalGraph}from"./components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js";export{StackedBarChart}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js";export{StackedBarDistributionChart}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js";export{GRAPH_ORIENTATION}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.js";export{VerticalGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js";export{FunnelVerticalBarGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/FunnelVerticalBarGraph.js";export{HEAT,HEAT_COLORS,HEAT_GRADING_TYPE,HeatMap}from"./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js";export{HeatBoxStyled,HeatMapVertical}from"./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js";export{VerticalBarAndLinearGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js";export{calculatePercentage,roundNumber,truncateValueTo10K,truncateValueToK}from"./components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.js";export{AVATAR_SIZE_VS_ICON_SIZE_MAP,Avatar,BACKGROUND_VS_TEXT_COLOR_MAP,MESSAGE_CHANNELS}from"./components/avatar/Avatar.js";export{AVATAR_BACKGROUND,AVATAR_SIZE_MAP,AVATAR_TYPES,SIZE}from"./components/avatar/AvatarHelper.js";export{Alert}from"./components/alerts/Alert.js";export{ALERT_TYPES,COLOR_CONFIG_MAP,CONTENT_POSITION}from"./components/alerts/AlertHelper.js";export{RATIO,Thumbnail}from"./components/thumbnail/Thumbnail.js";export{Curtain}from"./components/curtain/Curtain.js";export{DatePicker}from"./components/datePicker/DatePicker.js";export{DatePickerWrapper}from"./components/datePicker/DatePickerWrapper.js";export{Loader,Switch,SwitchContainer,Thumb}from"./components/switch/Switch.js";export{SubscriptionPlan}from"./components/plans/SubscriptionPlan.js";export{BottomWrapper,HeaderWrapper,SubscriptionPlanSelector,defaultTabs}from"./components/plans/SubscriptionPlanSelector.js";export{NewSubscriptionPlan}from"./components/plans/NewSubscriptionPlan.js";export{SubscriptionPlansCollected}from"./components/plans/SubscriptionPlansCollected.js";export{TabItemComponent,Tabs}from"./components/tabs/Tabs.js";export{DynamicTabs}from"./components/dynamic-tabs/DynamicTabs.js";export{BikShimmer}from"./components/shimmer/ShimmerComponent/BikShimmer.js";export{TablePagination}from"./components/TablePagination/TablePagination.js";export{TablePaginationCard,TablePaginationCardStyled}from"./components/TablePagination/TablePaginationCard.js";export{StateModalComponent}from"./components/states-modal/StateModalComponent.js";export{DeleteConfirmationModal}from"./components/states-modal/DeleteConfirmationModal.js";export{ButtonActions,ButtonTypes,StateComponent,StateInterface}from"./components/states/StateComponent.js";export{ShopifyScopeWrapper}from"./components/states/ShopifyScopeWrapper.js";export{WhatsAppTextEditor}from"./components/WhatsAppTextEditor/WhatsAppTextEditor.js";export{CustomRightBorder,EditorActionTypes,WhatsAppTextEditorHeader}from"./components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js";export{BaseWhatsappContentLangHelper}from"./helpers/BaseWhatsappContentLang.helper.js";export{CURTAIN_COLOR_CONFIG_MAP,CURTAIN_MODE,CURTAIN_TYPES}from"./components/curtain/CurtainHelper.js";export{resizeImage}from"./utils/resizeImage.js";export{PickerType}from"./components/variable-picker-v3/model.js";export{CardSelectionModal}from"./components/card-selection-modal/CardSelectionModal.js";export{BikImageCropper}from"./components/image-cropper/BikImageCropper.js";export{BikImagePipeline}from"./components/image-cropper/BikImagePipeline/BikImagePipeline.js";export{ButtonGroup}from"./components/buttonGroup/ButtonGroup.js";export{BikAccordion}from"./components/accordion/Accordion.js";export{FileUploader}from"./components/file-uploader/FileUploader.js";export{ColourInput}from"./components/colourInput/ColourInput.js";export{BikHeader}from"./components/bik-layout/BikHeader.js";export{BikLayout}from"./components/bik-layout/BikLayout.js";export{BikProfile}from"./components/bik-layout/BikProfile.js";export{SimpleSidebar}from"./components/bik-layout/SimpleSidebar.js";export{BikSidebar}from"./components/bik-layout/BikSidebar.js";export{FeatureModal}from"./components/bik-layout/FeatureModal.js";export{SidebarSkeleton}from"./components/bik-layout/SidebarSkeleton.js";export{ShowShopifyRestrictedModal}from"./components/bik-layout/ShowShopifyRestrictedModal.js";export{FeatureModalV2}from"./components/bik-layout/FeatureModalV2.js";export{SearchBar}from"./components/searchBar/searchBar.js";export{CustomDateTime}from"./components/custom-date-time/CustomDateTime.js";export{PricePleaseProductPicker,ProductPickerContent}from"./components/product-picker/ProductPickerModal.js";export{DiscountModal}from"./components/discount-modal/DiscountModal.js";export{COUPON_EXPIRATION,CouponExpiration}from"./components/discount-modal/CouponExpiration/CouponExpiration.js";export{DISCOUNT_TARGET_SELECTION,DISCOUNT_TARGET_TYPES,DISCOUNT_TYPES,DISCOUNT_VALUE_TYPES,MIN_PURCHASE_REQUIREMENT}from"./components/discount-modal/type.js";export{CountryCodePicker}from"./components/country-code-picker/CountryCodePicker.js";export{CountriesData}from"./components/country-code-picker/CountryCodePicker.modal.js";export{DEFAULT_IMAGE,ShimmerImage}from"./components/shimmer-image/ShimmerImage.js";export{ProductPickerModal,ScreenName}from"./components/product-picker-v2/modal.js";export{Carousel}from"./components/carousel/carousel.js";export{CarouselSecondary}from"./components/carousel-secondary/CarouselSecondary.js";export{AccessTokenTroubleshootDialog}from"./components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js";export{RadioList}from"./components/radioList/RadioList.js";export{CheckList}from"./components/checkList/CheckList.js";export{DateKeys,MEDIA_TYPES,PostPicker,dateOptions}from"./components/postPicker/postPicker.js";export{DropdownButton}from"./components/dropdown-button/DropdownButton.js";export{SideModal}from"./components/side-modal/SideModal.js";export{KeywordsInput}from"./components/keywords-input/KeywordsInput.js";export{AddVariableV2SideModal}from"./components/add-variableV2/AddVariableV2SideModal.js";export{AddVariableV2}from"./components/add-variableV2/AddVariableV2.js";export{NaLinkWrapper,NavigationHyperlink}from"./components/navigation-hyperlink/NavigationHyperlink.js";export{SearchFilter}from"./components/SearchFilter/index.js";export{InputWithVariables}from"./components/input-with-vars/InputWithVariables.js";export{DashboardReviewPopUp}from"./components/dashboard-review-popup/DashboardReviewPopUp.js";export{StarRating}from"./components/star-rating/StarRating.js";export{TestimonialCard}from"./components/testimonial-card/TestimonialCard.js";export{BikSlider}from"./components/slider/slider.js";export{ResizableImage}from"./components/resizeImage/index.js";export{validateURL}from"./utils/validator.js";export{CarouselPreview}from"./components/carousel-preview/CarouselPreview.js";export{Floater}from"./components/floater/floater.js";export{CardSelector}from"./components/card-selector/CardSelector.js";export{CardSelectorGroup}from"./components/card-selector/CardSelectorGroup.js";export{VariablePicker}from"./components/variable-picker-v3/VariablePicker.js";export{ActionButtons}from"./components/action-button/ActionButtons.js";export{ActivateBikAi}from"./components/ai-modals/ActivateBikAI.js";export{AiSyncProgress}from"./components/ai-modals/AiSyncProgress.js";export{AiCreditsExhausted}from"./components/ai-modals/AiCreditsExhausted.js";export{AiCreditsLow}from"./components/ai-modals/AiCreditsLow.js";export{CustomPortal}from"./components/input-with-vars/customPortal.js";
|
|
1
|
+
export{AmplitudeEvent}from"./amplitude/index.js";import*as o from"./components/template-preview/constants/regexPatterns.js";export{o as regexPatterns};export{default as StringUtils}from"./utils/StringUtils.js";export{BASE_COLORS,COLORS,DEFAULT_THEME,FONTS}from"./constants/Theme.js";export{ComponentZindex}from"./constants/zindex.js";export{CheckBox}from"./components/checkBox/CheckBox.js";export{ListItem}from"./components/list-item/ListItem.js";export{Pagination}from"./components/pagination/Pagination.js";export{RadioButton}from"./components/radioButton/RadioButton.js";export{Toaster}from"./components/toaster/Toaster.js";export{Tooltip}from"./components/tooltips/Tooltip.js";export{PureSpinner,Spinner}from"./components/spinner/Spinner.js";export{Stepper}from"./components/stepper/Stepper.js";export{Tag}from"./components/tag/Tag.js";export{IconButton}from"./components/icon-button/IconButton.js";export{TemplatePreview}from"./components/template-preview/TemplatePreview.js";export{WhatsappLikePreview}from"./components/template-preview/WhatsApp/WhatsAppLikePreview.js";export{WhatsappLikePreviewV2}from"./components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js";export{renderVariableUIForPreview}from"./components/template-preview/helpers/SmsTemplateHelper.js";export{WhatsAppFormatToHTML}from"./components/template-preview/helpers/WhatsAppFormatToHTML.js";export{VariableEditorHelper}from"./components/template-preview/helpers/VariableEditorHelper.js";export{ACTIONS_TYPES,CUSTOM_URL_NAME,HEADER_TYPES,TEMPLATE_EDITOR,TEMPLATE_STATUS}from"./components/template-preview/models/TemplateMeta.js";export{BUTTON_TYPE,POD}from"./components/template-preview/models/WhatsAppTemplate.js";export{TemplateContextMapper}from"./components/template-context-mapper/TemplateContextMapper.js";export{getAllDataFromTemplateComponent}from"./components/template-context-mapper/utils/getDataFromTemplateComponent.js";export{isVariable,validateIsUrl}from"./components/template-context-mapper/utils/validateIsUrl.js";export{FABMenu}from"./components/fab-menu/FABMenu.js";export{FloatingActionButton}from"./components/floating-action-button/FloatingActionButton.js";export{DROP_POSITION,DropdownToggleContainer,FAB_POSITION,FloatingActionButtonContainer,FloatingActionButtonOuterContainer,MENU_ALIGNMENT,StyledDropdown,TooltipStyled}from"./components/floating-action-button/FloatingActionButton.styles.js";export{ImageService}from"./components/image-compress/ImageCompress.js";export{AiBodyCaption,AiBodyTiny,BodyCaption,BodyLarge,BodyPrimary,BodyPrimaryLink,BodyRegular,BodySecondary,BodySecondaryLink,BodySmall,BodyTiny,ButtonLarge,ButtonLargeAI,ButtonRegular,ButtonRegularAI,Caption,CaptionBold,Display,SmallRegular,SubHeading,TextPlaceholder,Tiny,TitleFour,TitleLarge,TitleMedium,TitleRegular,TitleSmall,TitleXlarge}from"./components/TypographyStyle.js";export{Button}from"./components/button/Button.js";export{ProgressBarComponent,ProgressCompletedBar}from"./components/progress-bar/ProgressBarComponent.js";import"react/jsx-runtime";export{ProgressBarType,ProgressBarV2,TextAlignment}from"./components/progress-bar-v2/ProgressBarV2.js";export{QueryBuilder}from"./components/QueryBuilder/QueryBuilder.js";export{BaseQueryBuilderNode}from"./components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";export{PropertyNode,PropertyNodeHeadless}from"./components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js";export{queryBuilderSlice}from"./components/QueryBuilder/redux/queryBuilder.reducer.js";export{queryBuilderCacheSlice}from"./components/QueryBuilder/redux/queryBuilderCache.reducer.js";export{AD_STRING_OPERATORS,ANY_AD_OPERATORS,ANY_IG_OPERATORS,BOOLEAN_OPERATORS,DATE_OPERATORS,EVENT_VALUES,EXACTLY_OPERATORS,FREQUENCY_OPERATORS,ICE_BREAKER_OPERATORS,IG_STRING_OPERATORS,INTEGER_OPERATORS,MAIL_SUBJECT_OPERATORS,REACTION_OPERATORS,SPECIFIC_IG_OPERATORS,STRING_OPERATORS,STRING_RESTRICTED_OPERATORS,STRING_RESTRICTED_OPERATORS_2,STRING_RESTRICTED_OPERATORS_3}from"./components/QueryBuilder/types/QueryBuilderOperator.type.js";export{StyledModal}from"./components/modals/styledModal.js";export{DropdownPopover}from"./components/dropdown/DropdownPopover/index.js";export{Dropdown}from"./components/dropdown/Dropdown.js";export{ChipDropdown}from"./components/dropdown/ChipDropdown.js";export{OpenedDropdown}from"./components/dropdown/OpenedDropdown/components/OpennedDropdown.js";export{MenuItemDropdown}from"./components/dropdown/MenuItem/MenuItem.js";export{AnalyticsCard}from"./components/analytics-card/AnalyticsCard.js";export{AnalyticsContainer,CardDataContainer}from"./components/analytics-card/AnalyticsCard.styled.js";export{Input}from"./components/input/Input.js";export{AnalyticsChip}from"./components/analytics-chips-and-dropdowns/AnalyticsChip.js";export{AnalyticsDropdown,EachItem,formatDate}from"./components/analytics-chips-and-dropdowns/AnalyticsDropdown.js";export{AnalyticsMultiChip}from"./components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js";export{AnalyticsMetric}from"./components/analytics-chips-and-dropdowns/AnalyticsMetric.js";export{AnalyticsTrend}from"./components/analytics-chips-and-dropdowns/AnalyticsTrend.js";export{LineChart}from"./components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js";export{LinearChipGroupedChart}from"./components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js";export{Card,PieChartAnalytics}from"./components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js";export{PieChart}from"./components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js";export{HorizontalGraph}from"./components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js";export{StackedBarChart}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js";export{StackedBarDistributionChart}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js";export{GRAPH_ORIENTATION}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.js";export{VerticalGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js";export{FunnelVerticalBarGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/FunnelVerticalBarGraph.js";export{HEAT,HEAT_COLORS,HEAT_GRADING_TYPE,HeatMap}from"./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js";export{HeatBoxStyled,HeatMapVertical}from"./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js";export{VerticalBarAndLinearGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js";export{calculatePercentage,roundNumber,truncateValueTo10K,truncateValueToK}from"./components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.js";export{AVATAR_SIZE_VS_ICON_SIZE_MAP,Avatar,BACKGROUND_VS_TEXT_COLOR_MAP}from"./components/avatar/Avatar.js";export{AVATAR_BACKGROUND,AVATAR_SIZE_MAP,AVATAR_TYPES,SIZE}from"./components/avatar/AvatarHelper.js";export{Alert}from"./components/alerts/Alert.js";export{ALERT_TYPES,COLOR_CONFIG_MAP,CONTENT_POSITION}from"./components/alerts/AlertHelper.js";export{RATIO,Thumbnail}from"./components/thumbnail/Thumbnail.js";export{Curtain}from"./components/curtain/Curtain.js";export{DatePicker}from"./components/datePicker/DatePicker.js";export{DatePickerWrapper}from"./components/datePicker/DatePickerWrapper.js";export{Loader,Switch,SwitchContainer,Thumb}from"./components/switch/Switch.js";export{SubscriptionPlan}from"./components/plans/SubscriptionPlan.js";export{BottomWrapper,HeaderWrapper,SubscriptionPlanSelector,defaultTabs}from"./components/plans/SubscriptionPlanSelector.js";export{NewSubscriptionPlan}from"./components/plans/NewSubscriptionPlan.js";export{SubscriptionPlansCollected}from"./components/plans/SubscriptionPlansCollected.js";export{TabItemComponent,Tabs}from"./components/tabs/Tabs.js";export{DynamicTabs}from"./components/dynamic-tabs/DynamicTabs.js";export{BikShimmer}from"./components/shimmer/ShimmerComponent/BikShimmer.js";export{TablePagination}from"./components/TablePagination/TablePagination.js";export{TablePaginationCard,TablePaginationCardStyled}from"./components/TablePagination/TablePaginationCard.js";export{StateModalComponent}from"./components/states-modal/StateModalComponent.js";export{DeleteConfirmationModal}from"./components/states-modal/DeleteConfirmationModal.js";export{ButtonActions,ButtonTypes,StateComponent,StateInterface}from"./components/states/StateComponent.js";export{ShopifyScopeWrapper}from"./components/states/ShopifyScopeWrapper.js";export{WhatsAppTextEditor}from"./components/WhatsAppTextEditor/WhatsAppTextEditor.js";export{CustomRightBorder,EditorActionTypes,WhatsAppTextEditorHeader}from"./components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js";export{BaseWhatsappContentLangHelper}from"./helpers/BaseWhatsappContentLang.helper.js";export{CURTAIN_COLOR_CONFIG_MAP,CURTAIN_MODE,CURTAIN_TYPES}from"./components/curtain/CurtainHelper.js";export{resizeImage}from"./utils/resizeImage.js";export{PickerType}from"./components/variable-picker-v3/model.js";export{CardSelectionModal}from"./components/card-selection-modal/CardSelectionModal.js";export{BikImageCropper}from"./components/image-cropper/BikImageCropper.js";export{BikImagePipeline}from"./components/image-cropper/BikImagePipeline/BikImagePipeline.js";export{ButtonGroup}from"./components/buttonGroup/ButtonGroup.js";export{BikAccordion}from"./components/accordion/Accordion.js";export{FileUploader}from"./components/file-uploader/FileUploader.js";export{ColourInput}from"./components/colourInput/ColourInput.js";export{BikHeader}from"./components/bik-layout/BikHeader.js";export{BikLayout}from"./components/bik-layout/BikLayout.js";export{BikProfile}from"./components/bik-layout/BikProfile.js";export{SimpleSidebar}from"./components/bik-layout/SimpleSidebar.js";export{BikSidebar}from"./components/bik-layout/BikSidebar.js";export{FeatureModal}from"./components/bik-layout/FeatureModal.js";export{SidebarSkeleton}from"./components/bik-layout/SidebarSkeleton.js";export{ShowShopifyRestrictedModal}from"./components/bik-layout/ShowShopifyRestrictedModal.js";export{FeatureModalV2}from"./components/bik-layout/FeatureModalV2.js";export{SearchBar}from"./components/searchBar/searchBar.js";export{CustomDateTime}from"./components/custom-date-time/CustomDateTime.js";export{PricePleaseProductPicker,ProductPickerContent}from"./components/product-picker/ProductPickerModal.js";export{DiscountModal}from"./components/discount-modal/DiscountModal.js";export{COUPON_EXPIRATION,CouponExpiration}from"./components/discount-modal/CouponExpiration/CouponExpiration.js";export{DISCOUNT_TARGET_SELECTION,DISCOUNT_TARGET_TYPES,DISCOUNT_TYPES,DISCOUNT_VALUE_TYPES,MIN_PURCHASE_REQUIREMENT}from"./components/discount-modal/type.js";export{CountryCodePicker}from"./components/country-code-picker/CountryCodePicker.js";export{CountriesData}from"./components/country-code-picker/CountryCodePicker.modal.js";export{DEFAULT_IMAGE,ShimmerImage}from"./components/shimmer-image/ShimmerImage.js";export{ProductPickerModal,ScreenName}from"./components/product-picker-v2/modal.js";export{Carousel}from"./components/carousel/carousel.js";export{CarouselSecondary}from"./components/carousel-secondary/CarouselSecondary.js";export{AccessTokenTroubleshootDialog}from"./components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js";export{RadioList}from"./components/radioList/RadioList.js";export{CheckList}from"./components/checkList/CheckList.js";export{DateKeys,MEDIA_TYPES,PostPicker,dateOptions}from"./components/postPicker/postPicker.js";export{DropdownButton}from"./components/dropdown-button/DropdownButton.js";export{SideModal}from"./components/side-modal/SideModal.js";export{KeywordsInput}from"./components/keywords-input/KeywordsInput.js";export{AddVariableV2SideModal}from"./components/add-variableV2/AddVariableV2SideModal.js";export{AddVariableV2}from"./components/add-variableV2/AddVariableV2.js";export{NaLinkWrapper,NavigationHyperlink}from"./components/navigation-hyperlink/NavigationHyperlink.js";export{SearchFilter}from"./components/SearchFilter/index.js";export{InputWithVariables}from"./components/input-with-vars/InputWithVariables.js";export{DashboardReviewPopUp}from"./components/dashboard-review-popup/DashboardReviewPopUp.js";export{StarRating}from"./components/star-rating/StarRating.js";export{TestimonialCard}from"./components/testimonial-card/TestimonialCard.js";export{BikSlider}from"./components/slider/slider.js";export{ResizableImage}from"./components/resizeImage/index.js";export{validateURL}from"./utils/validator.js";export{CarouselPreview}from"./components/carousel-preview/CarouselPreview.js";export{Floater}from"./components/floater/floater.js";export{CardSelector}from"./components/card-selector/CardSelector.js";export{CardSelectorGroup}from"./components/card-selector/CardSelectorGroup.js";export{VariablePicker}from"./components/variable-picker-v3/VariablePicker.js";export{ActionButtons}from"./components/action-button/ActionButtons.js";export{ActivateBikAi}from"./components/ai-modals/ActivateBikAI.js";export{AiSyncProgress}from"./components/ai-modals/AiSyncProgress.js";export{AiCreditsExhausted}from"./components/ai-modals/AiCreditsExhausted.js";export{AiCreditsLow}from"./components/ai-modals/AiCreditsLow.js";export{CustomPortal}from"./components/input-with-vars/customPortal.js";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t,r=e(require("react"));function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n.apply(this,arguments)}var a=e=>r.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 12 12"},e),t||(t=r.createElement("path",{fill:"#0866FF",d:"M11.5 6a5.5 5.5 0 1 0-6.829 5.338V7.681H3.537V6h1.134v-.724c0-1.872.848-2.74 2.686-2.74.348 0 .95.069 1.195.137v1.523a7.07 7.07 0 0 0-.635-.02c-.902 0-1.25.341-1.25 1.23V6h1.796l-.309 1.68H6.667v3.78A5.5 5.5 0 0 0 11.5 6Z"})));exports.default=a;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t,r,a,l,n,c=e(require("react"));function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},f.apply(this,arguments)}var i=e=>c.createElement("svg",f({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},e),t||(t=c.createElement("path",{fill:"#4caf50",d:"m45 16.2-5 2.75-5 4.75V40h7a3 3 0 0 0 3-3V16.2z"})),r||(r=c.createElement("path",{fill:"#1e88e5",d:"m3 16.2 3.614 1.71L13 23.7V40H6a3 3 0 0 1-3-3V16.2z"})),a||(a=c.createElement("path",{fill:"#e53935",d:"m35 11.2-11 8.25-11-8.25-1 5.8 1 6.7 11 8.25 11-8.25 1-6.7z"})),l||(l=c.createElement("path",{fill:"#c62828",d:"M3 12.298V16.2l10 7.5V11.2L9.876 8.859A4.298 4.298 0 0 0 3 12.298z"})),n||(n=c.createElement("path",{fill:"#fbc02d",d:"M45 12.298V16.2l-10 7.5V11.2l3.124-2.341A4.298 4.298 0 0 1 45 12.298z"})));exports.default=i;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as t from"react";var e;function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},r.apply(this,arguments)}var a=a=>t.createElement("svg",r({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 12 12"},a),e||(e=t.createElement("path",{fill:"#0866FF",d:"M11.5 6a5.5 5.5 0 1 0-6.829 5.338V7.681H3.537V6h1.134v-.724c0-1.872.848-2.74 2.686-2.74.348 0 .95.069 1.195.137v1.523a7.07 7.07 0 0 0-.635-.02c-.902 0-1.25.341-1.25 1.23V6h1.796l-.309 1.68H6.667v3.78A5.5 5.5 0 0 0 11.5 6Z"})));export{a as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"react";var t,a,l,r,n;function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},c.apply(this,arguments)}var i=i=>e.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},i),t||(t=e.createElement("path",{fill:"#4caf50",d:"m45 16.2-5 2.75-5 4.75V40h7a3 3 0 0 0 3-3V16.2z"})),a||(a=e.createElement("path",{fill:"#1e88e5",d:"m3 16.2 3.614 1.71L13 23.7V40H6a3 3 0 0 1-3-3V16.2z"})),l||(l=e.createElement("path",{fill:"#e53935",d:"m35 11.2-11 8.25-11-8.25-1 5.8 1 6.7 11 8.25 11-8.25 1-6.7z"})),r||(r=e.createElement("path",{fill:"#c62828",d:"M3 12.298V16.2l10 7.5V11.2L9.876 8.859A4.298 4.298 0 0 0 3 12.298z"})),n||(n=e.createElement("path",{fill:"#fbc02d",d:"M45 12.298V16.2l-10 7.5V11.2l3.124-2.341A4.298 4.298 0 0 1 45 12.298z"})));export{i as default};
|