@bikdotai/bik-component-library 0.0.442-beta.2 → 0.0.442
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/assets/{bundle-0deb4a74.css → bundle-421aeced.css} +0 -2
- package/dist/cjs/assets/icons/PlusIcon.d.ts +1 -1
- package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditor.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.d.ts +4 -19
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/cjs/components/template-context-mapper/context/templateModalContext.d.ts +8 -44
- package/dist/cjs/components/template-context-mapper/context/templateModalContext.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/Body.js +9 -9
- package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.d.ts +2 -3
- package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/Footer.d.ts +1 -2
- package/dist/cjs/components/template-context-mapper/modalElements/Footer.js +4 -4
- package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.d.ts +1 -2
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.js +3 -12
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.d.ts +1 -0
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.d.ts +2 -2
- package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
- package/dist/cjs/components/template-preview/TemplatePreview.d.ts +2 -5
- package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.style.d.ts +1 -6
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.style.js +6 -13
- package/dist/cjs/components/template-preview/WhatsApp/ChatUiV2.js +5 -5
- package/dist/cjs/components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js +7 -5
- package/dist/cjs/components/template-preview/WhatsAppTemplatePreview.d.ts +0 -2
- package/dist/cjs/components/template-preview/WhatsAppTemplatePreview.js +1 -1
- package/dist/cjs/components/template-preview/helpers/TemplateCreatorHelper.js +1 -1
- package/dist/cjs/components/template-preview/models/WhatsAppTemplate.d.ts +1 -3
- package/dist/cjs/index.d.ts +0 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/assets/{bundle-0deb4a74.css → bundle-421aeced.css} +0 -2
- package/dist/esm/assets/icons/PlusIcon.d.ts +1 -1
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditor.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.d.ts +4 -19
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/esm/components/template-context-mapper/context/templateModalContext.d.ts +8 -44
- package/dist/esm/components/template-context-mapper/context/templateModalContext.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/Body.js +9 -9
- package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.d.ts +2 -3
- package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/Footer.d.ts +1 -2
- package/dist/esm/components/template-context-mapper/modalElements/Footer.js +4 -4
- package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.d.ts +1 -2
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.js +3 -12
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.d.ts +1 -0
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.d.ts +2 -2
- package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
- package/dist/esm/components/template-preview/TemplatePreview.d.ts +2 -5
- package/dist/esm/components/template-preview/TemplatePreview.js +1 -1
- package/dist/esm/components/template-preview/WhatsApp/ChatUI.style.d.ts +1 -6
- package/dist/esm/components/template-preview/WhatsApp/ChatUI.style.js +13 -20
- package/dist/esm/components/template-preview/WhatsApp/ChatUiV2.js +5 -5
- package/dist/esm/components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js +7 -5
- package/dist/esm/components/template-preview/WhatsAppTemplatePreview.d.ts +0 -2
- package/dist/esm/components/template-preview/WhatsAppTemplatePreview.js +1 -1
- package/dist/esm/components/template-preview/helpers/TemplateCreatorHelper.js +1 -1
- package/dist/esm/components/template-preview/models/WhatsAppTemplate.d.ts +1 -3
- package/dist/esm/index.d.ts +0 -1
- package/dist/esm/index.js +1 -1
- package/package.json +1 -2
- package/dist/cjs/assets/icons/qrb.svg.js +0 -1
- package/dist/cjs/components/carousel-preview/CarouselPreview.d.ts +0 -12
- package/dist/cjs/components/carousel-preview/CarouselPreview.js +0 -52
- package/dist/cjs/components/carousel-preview/CarouselPreviewCard.d.ts +0 -9
- package/dist/cjs/components/carousel-preview/CarouselPreviewCard.js +0 -1
- package/dist/cjs/components/carousel-preview/index.d.ts +0 -1
- package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.d.ts +0 -25
- package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +0 -47
- package/dist/cjs/components/template-preview/models/WhatsappCarouselTemplate.d.ts +0 -82
- package/dist/esm/assets/icons/qrb.svg.js +0 -1
- package/dist/esm/components/carousel-preview/CarouselPreview.d.ts +0 -12
- package/dist/esm/components/carousel-preview/CarouselPreview.js +0 -52
- package/dist/esm/components/carousel-preview/CarouselPreviewCard.d.ts +0 -9
- package/dist/esm/components/carousel-preview/CarouselPreviewCard.js +0 -1
- package/dist/esm/components/carousel-preview/index.d.ts +0 -1
- package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.d.ts +0 -25
- package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +0 -47
- package/dist/esm/components/template-preview/models/WhatsappCarouselTemplate.d.ts +0 -82
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { HEADER_TYPES, TEMPLATE_STATUS, WhatsAppTemplateVariables } from "..";
|
|
2
|
-
import { CHANNEL_TYPE } from "./Channels";
|
|
3
|
-
import { CUSTOM_VARIABLE } from './TemplateMeta';
|
|
4
|
-
export type WhatsAppCarouselTemplate = {
|
|
5
|
-
name: string;
|
|
6
|
-
label: string;
|
|
7
|
-
recommended?: boolean;
|
|
8
|
-
templateId?: string;
|
|
9
|
-
channel: CHANNEL_TYPE;
|
|
10
|
-
templateCategory: string;
|
|
11
|
-
type?: 'email' | 'whatsapp';
|
|
12
|
-
components: {
|
|
13
|
-
type: 'BODY' | 'CAROUSEL';
|
|
14
|
-
format?: HEADER_TYPES;
|
|
15
|
-
text?: string;
|
|
16
|
-
example?: {
|
|
17
|
-
header_handle?: Array<string>;
|
|
18
|
-
body_text?: Array<string[]>;
|
|
19
|
-
header_text?: Array<string>;
|
|
20
|
-
};
|
|
21
|
-
cards?: {
|
|
22
|
-
components: {
|
|
23
|
-
type: 'HEADER' | 'BODY' | 'BUTTONS' | 'FOOTER';
|
|
24
|
-
format?: HEADER_TYPES;
|
|
25
|
-
text?: string;
|
|
26
|
-
buttons?: {
|
|
27
|
-
type: 'QUICK_REPLY' | 'URL' | 'PHONE_NUMBER';
|
|
28
|
-
text?: string;
|
|
29
|
-
url?: string;
|
|
30
|
-
example?: string[];
|
|
31
|
-
linkMode?: 'custom' | 'home';
|
|
32
|
-
phone_number?: string;
|
|
33
|
-
flowName?: string;
|
|
34
|
-
flowId?: string;
|
|
35
|
-
}[];
|
|
36
|
-
example?: {
|
|
37
|
-
header_handle?: Array<string>;
|
|
38
|
-
body_text?: Array<string[]>;
|
|
39
|
-
header_text?: Array<string>;
|
|
40
|
-
};
|
|
41
|
-
}[];
|
|
42
|
-
}[];
|
|
43
|
-
}[];
|
|
44
|
-
mapping: {
|
|
45
|
-
header?: string[];
|
|
46
|
-
body?: string[];
|
|
47
|
-
buttons?: string[];
|
|
48
|
-
cards?: {
|
|
49
|
-
header?: string[];
|
|
50
|
-
body?: string[];
|
|
51
|
-
buttons?: string[];
|
|
52
|
-
}[];
|
|
53
|
-
};
|
|
54
|
-
templateComponentValues: {
|
|
55
|
-
components: {
|
|
56
|
-
header?: string[];
|
|
57
|
-
body?: string[];
|
|
58
|
-
buttons?: string[];
|
|
59
|
-
cards?: {
|
|
60
|
-
header?: string[];
|
|
61
|
-
body?: string[];
|
|
62
|
-
buttons?: string[];
|
|
63
|
-
}[];
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
htmlContentUrl?: string;
|
|
67
|
-
language: 'en_US';
|
|
68
|
-
status: TEMPLATE_STATUS;
|
|
69
|
-
category: string;
|
|
70
|
-
thumbnailImageUrl?: string;
|
|
71
|
-
FB_blob_key?: string;
|
|
72
|
-
reason?: string;
|
|
73
|
-
createdAt: number;
|
|
74
|
-
updatedAt: number;
|
|
75
|
-
isDraft?: boolean;
|
|
76
|
-
isProductCarouselType?: boolean;
|
|
77
|
-
isCarouselType?: boolean;
|
|
78
|
-
};
|
|
79
|
-
export interface WhatsAppCarouselTemplateVariables {
|
|
80
|
-
body: CUSTOM_VARIABLE[];
|
|
81
|
-
cards: WhatsAppTemplateVariables[];
|
|
82
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"react";var a;function t(){return t=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},t.apply(this,arguments)}var r=r=>e.createElement("svg",t({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 19 19"},r),a||(a=e.createElement("path",{fill:"#1877F2",fillRule:"evenodd",d:"M8.137 3.676a.75.75 0 0 0-.817.163l-5.25 5.25a.75.75 0 0 0 0 1.06l5.25 5.25a.75.75 0 0 0 1.28-.53v-2.307c3.146.15 5.305 1.274 6.89 3.493a.75.75 0 0 0 1.346-.583c-.393-1.963-1.186-3.97-2.609-5.597-1.321-1.51-3.157-2.656-5.627-3.14V4.37a.75.75 0 0 0-.463-.693ZM7.1 6.18v1.19c0 .372.275.689.644.742 2.452.35 4.163 1.39 5.354 2.751.528.603.96 1.277 1.31 1.994-1.754-1.239-3.917-1.813-6.558-1.813a.75.75 0 0 0-.75.75v1.264L3.661 9.62l3.44-3.44Z",clipRule:"evenodd"})));export{r as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import 'pure-react-carousel/dist/react-carousel.es.css';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { CHANNEL_TYPE } from "../template-preview/models/Channels";
|
|
4
|
-
import { EmailTemplateType } from "../template-preview/models/EmailTemplate";
|
|
5
|
-
import { SMSTemplateType } from "../template-preview/models/SmsTemplate";
|
|
6
|
-
import { WhatsAppCarouselTemplate } from "../template-preview/models/WhatsappCarouselTemplate";
|
|
7
|
-
import { WhatsAppTemplate } from "../template-preview/models/WhatsAppTemplate";
|
|
8
|
-
export declare const CarouselPreview: React.ForwardRefExoticComponent<{
|
|
9
|
-
channel: CHANNEL_TYPE;
|
|
10
|
-
template: WhatsAppTemplate | EmailTemplateType | SMSTemplateType | WhatsAppCarouselTemplate | null;
|
|
11
|
-
showSampleValues?: boolean | undefined;
|
|
12
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as o}from"react/jsx-runtime";import t from"../../assets/icons/chevronLeft.svg.js";import i from"../../assets/icons/chevronRight.svg.js";import{CarouselProvider as r,ButtonBack as n,Slider as a,Slide as l,ButtonNext as d}from"pure-react-carousel";import s from"react";import c from"styled-components";import p from"./CarouselPreviewCard.js";import{COLORS as h}from"../../constants/Theme.js";const m=c.div`
|
|
2
|
-
background-image: url('https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F341dba50-e84e-4457-b5b5-d9d8a0b95a73?alt=media&token=6fd32f23-8bb2-4980-bbee-bef39b38fd9f');
|
|
3
|
-
border-color: ${h.stroke.primary};
|
|
4
|
-
border-top-style: solid;
|
|
5
|
-
border-bottom-style: solid;
|
|
6
|
-
border-top-width: 1px;
|
|
7
|
-
border-bottom-width: 1px;
|
|
8
|
-
background-repeat: no-repeat;
|
|
9
|
-
background-position: center;
|
|
10
|
-
background-size: cover;
|
|
11
|
-
position: relative;
|
|
12
|
-
height: 500px;
|
|
13
|
-
overflow-y: auto;
|
|
14
|
-
`,b=c.div`
|
|
15
|
-
flex-direction: row;
|
|
16
|
-
display: flex;
|
|
17
|
-
align-items: center;
|
|
18
|
-
.left_button {
|
|
19
|
-
border-radius: 50%;
|
|
20
|
-
width: 24px;
|
|
21
|
-
height: 24px;
|
|
22
|
-
align-items: center;
|
|
23
|
-
justify-content: center;
|
|
24
|
-
display: flex;
|
|
25
|
-
position: absolute;
|
|
26
|
-
left: 0;
|
|
27
|
-
z-index: 10;
|
|
28
|
-
margin-left: 4px;
|
|
29
|
-
border: none;
|
|
30
|
-
background-color: white;
|
|
31
|
-
box-shadow: 0px 1.5px 6px 0px #0000001f;
|
|
32
|
-
}
|
|
33
|
-
.right_button {
|
|
34
|
-
border-radius: 50%;
|
|
35
|
-
width: 24px;
|
|
36
|
-
height: 24px;
|
|
37
|
-
align-items: center;
|
|
38
|
-
justify-content: center;
|
|
39
|
-
display: flex;
|
|
40
|
-
position: absolute;
|
|
41
|
-
right: 0;
|
|
42
|
-
z-index: 10;
|
|
43
|
-
margin-right: 4px;
|
|
44
|
-
border: none;
|
|
45
|
-
background-color: white;
|
|
46
|
-
box-shadow: 0px 1.5px 6px 0px #0000001f;
|
|
47
|
-
}
|
|
48
|
-
.slider {
|
|
49
|
-
width: 100%;
|
|
50
|
-
height: 480px;
|
|
51
|
-
}
|
|
52
|
-
`,u=s.forwardRef(((s,c)=>{let{channel:u,template:g,showSampleValues:x}=s;var f,v,w,y;const j=null===(f=null==g?void 0:g.components)||void 0===f?void 0:f[1].cards;return e(m,{children:[o(p,{channel:u,template:g,carouselCardIndex:-1}),!!(null==j?void 0:j.length)&&o(r,Object.assign({naturalSlideWidth:100,naturalSlideHeight:125,totalSlides:null!==(v=null==j?void 0:j.length)&&void 0!==v?v:1,orientation:"horizontal",visibleSlides:1.3,dragEnabled:!0,touchEnabled:!0},{children:e(b,{children:[o(n,Object.assign({className:"left_button"},{children:o(t,{height:10,width:10,color:h.content.primary})})),o(a,Object.assign({className:"slider"},{children:null===(y=null===(w=null==g?void 0:g.components)||void 0===w?void 0:w[1].cards)||void 0===y?void 0:y.map(((e,t)=>{var i,r;const n={components:e.components,mapping:null===(r=null===(i=null==g?void 0:g.mapping)||void 0===i?void 0:i.cards)||void 0===r?void 0:r[t]};return o(l,Object.assign({index:t},{children:o(p,{channel:u,template:n,carouselCardIndex:t},t)}),t)}))})),o(d,Object.assign({className:"right_button"},{children:o(i,{height:10,width:10,color:h.content.primary})}))]})}))]})}));export{u as CarouselPreview};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CHANNEL_TYPE } from "../template-preview/models/Channels";
|
|
3
|
-
declare const CarouselPreviewCard: React.ForwardRefExoticComponent<{
|
|
4
|
-
channel: CHANNEL_TYPE;
|
|
5
|
-
template: any;
|
|
6
|
-
showSampleValues?: boolean | undefined;
|
|
7
|
-
carouselCardIndex?: number | undefined;
|
|
8
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
-
export default CarouselPreviewCard;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import t from"react";import{TemplatePreview as a}from"../template-preview/TemplatePreview.js";import"../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import"../../constants/Theme.js";import"../curtain/CurtainHelper.js";import"../template-preview/models/TemplateMeta.js";import"../template-preview/models/WhatsAppTemplate.js";const p=t.forwardRef((t=>{let{channel:p,template:r,showSampleValues:s,carouselCardIndex:i}=t;return e("div",Object.assign({style:{width:350}},{children:e(a,{showSampleValues:s,template:r,channel:p,size:"small",hideHeader:!0,carouselCardIndex:i,isWhatsappCarousel:!0})}))}));export{p as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './CarouselPreview';
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { VariableListInterfaceV2 } from "../../add-variableV2";
|
|
2
|
-
import { WhatsAppPickerMeta } from "../../template-preview";
|
|
3
|
-
import { WhatsAppCarouselTemplate } from "../../template-preview/models/WhatsappCarouselTemplate";
|
|
4
|
-
export interface EditWhatsAppCarouselTemplateV2Props {
|
|
5
|
-
whatsappSpecificPickerMeta?: WhatsAppPickerMeta;
|
|
6
|
-
template: WhatsAppCarouselTemplate;
|
|
7
|
-
showVariableModal?: boolean;
|
|
8
|
-
variableList?: VariableListInterfaceV2[];
|
|
9
|
-
variableListForImage?: VariableListInterfaceV2[];
|
|
10
|
-
discountCode?: string;
|
|
11
|
-
setDiscountCode?: (code: string) => void;
|
|
12
|
-
}
|
|
13
|
-
export interface CarouselProduct {
|
|
14
|
-
name: string;
|
|
15
|
-
image: string;
|
|
16
|
-
quantity: number;
|
|
17
|
-
variantId: string;
|
|
18
|
-
productId: string;
|
|
19
|
-
displayOrder: number;
|
|
20
|
-
collectionId: string;
|
|
21
|
-
productName: string;
|
|
22
|
-
productImage: string;
|
|
23
|
-
}
|
|
24
|
-
declare const EditWhatsAppCarouselTemplateV2: ({ template, whatsappSpecificPickerMeta, showVariableModal, variableList, variableListForImage, discountCode, setDiscountCode, }: EditWhatsAppCarouselTemplateV2Props) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
export default EditWhatsAppCarouselTemplateV2;
|
package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import i from"../../../assets/icons/PlusIcon.js";import{cloneDeep as r}from"lodash";import{useState as s,useEffect as l}from"react";import n from"styled-components";import{AddVariableV2SideModal as a}from"../../add-variableV2/AddVariableV2SideModal.js";import"../../../_virtual/_tslib.js";import"../../add-variableV2/AddVariableV2.styled.js";import{Button as d}from"../../button/Button.js";import{IconButton as c}from"../../icon-button/IconButton.js";import"../../input/Input.js";import"../../tooltips/Tooltip.js";import{COLORS as p}from"../../../constants/Theme.js";import"../../modals/modal.styled.js";import"../../switch/Switch.js";import{TitleMedium as m,BodyCaption as u,TitleRegular as h}from"../../TypographyStyle.js";import{ProductPickerModal as f}from"../../product-picker-v2/modal.js";import{useTemplateModalContext as g}from"../context/templateModalContext.js";import y from"./EditWhatsAppTemplateV2.js";import"../../template-preview/TemplatePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import"../../curtain/CurtainHelper.js";import"../../template-preview/models/TemplateMeta.js";import{POD as b}from"../../template-preview/models/WhatsAppTemplate.js";import v from"../../../assets/icons/box.svg.js";import j from"../../../assets/icons/delete.svg.js";import x from"../../../assets/icons/edit.svg.js";const I=n=>{let{template:c,whatsappSpecificPickerMeta:h,showVariableModal:v,variableList:j,variableListForImage:x,discountCode:I,setDiscountCode:C}=n;var O,T;const{selectedCarouselIndex:k,setTemplate:P,pickerConf:A,isProductCarouselType:S,pod:V,cardCount:B,carouselProducts:L,setCarouselProducts:E,isError:M}=g(),[_,F]=s(-1==k?"First Message (Step 1/2)":"Carousel Cards (Step 2/2)"),[W,z]=s(!1),[D,q]=s(!1),[R,N]=s(!1);l((()=>{F(-1==k?"First Message (Step 1/2)":"Carousel Cards (Step 2/2)")}),[k]);return e("div",{children:[t(m,Object.assign({style:{marginLeft:10,marginBottom:10}},{children:_})),S&&(null!==(O=null==L?void 0:L.length)&&void 0!==O?O:0)>0&&null!=k&&k>=0&&e("div",Object.assign({style:{display:"flex",rowGap:16,marginBottom:16,flexDirection:"column"}},{children:[t(w,{editItem:()=>z(!W),cardBody:`${null==L?void 0:L.length} Products Selected`,deleteItem:()=>{null==E||E([])}}),t(d,{disabled:(null!==(T=null==L?void 0:L.length)&&void 0!==T?T:0)<=1,style:{alignSelf:"flex-end",background:p.surface.subdued},onClick:()=>{q(!0),z(!0)},buttonText:"Rearrange Products",buttonType:"tertiary"})]})),S&&0===(null==L?void 0:L.length)&&null!=k&&k>=0&&e("div",Object.assign({style:{marginTop:16,marginBottom:16,marginLeft:12,marginRight:12,flexDirection:"column",display:"flex",alignItems:"center"}},{children:[t(d,{matchParentWidth:!0,style:{flex:1,display:"flex",width:"100%",marginBottom:12,border:M?`2px dashed ${p.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s)",buttonType:M?"tertiaryGray":"dashBold",LeadingIcon:i,onClick:e=>{z(!0)}}),V===b.CHATBOT&&e(o,{children:[e("div",Object.assign({style:{display:"flex",flex:1,alignItems:"center",justifyContent:"space-between",flexDirection:"row",width:"100%"}},{children:[t("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginRight:8}}),t(u,Object.assign({style:{color:"#616161",overflow:"unset"}},{children:"OR"})),t("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginLeft:8}})]})),t(d,{matchParentWidth:!0,style:{flex:1,display:"flex",marginTop:12,width:"100%"},size:"medium",buttonText:"Add Product(s) Variable",buttonType:"dashBold",LeadingIcon:i,onClick:e=>{N(!0)}})]})]})),t(y,{whatsappSpecificPickerMeta:h,template:c,onTemplateChange:e=>{null==P||P(e)},showVariableModal:v,variableList:j,variableListForImage:x,discountCode:I,setDiscountCode:C}),W&&A&&t(f,{zIndex:200,rearrangeEnabled:D,limit:null!=B?B:1,storeId:A.storeId,selectedItems:(e=>{if(e.length>0){const t={};for(const o of e){const e=null==o?void 0:o.collectionId,i=o.productId,r=o.variantId;e in t||(t[e]={products:{},name:"",image:"",isSmartCollection:!1}),i in t[e].products||(t[e].products[i]={variants:{},name:(null==o?void 0:o.productName)||"",image:(null==o?void 0:o.productImage)||""}),t[e].products[i].variants[r]={name:(null==o?void 0:o.name)||"",price:"",image:(null==o?void 0:o.image)||"",quantity:o.quantity||0,displayOrder:o.displayOrder}}return t}return{}})(null!=L?L:[]),collectionFetcher:A.fetchCollections,productFetcher:A.fetchProducts,onAdd:(e,t)=>{q(!1);const o=[],i=[];delete e.isCustom;for(const t of Object.keys(e)){const r=e[t].products;if(void 0!==r&&Object.keys(r).length)for(const e of Object.keys(r)){const s=r[e].variants;if(void 0!==s&&Object.keys(s).length)for(const l of Object.keys(s)){const{name:n,image:a,quantity:d,displayOrder:c}=s[l],p={name:n,image:a,quantity:d,variantId:l,productId:e,displayOrder:c,collectionId:t,productName:r[e].name,productImage:r[e].image};i.push(p),o.push(a)}}}const s=i.sort(((e,t)=>e.displayOrder-t.displayOrder)),l=r(Object.assign({},c));o.forEach(((e,t)=>{e&&(l.components[1].cards[t].components[0].example.header_handle=[e])})),null==P||P(l),null==E||E(s),z(!1)},searchInCollectionFetcher:A.searchInCollection,searchFetcher:A.searchProducts,visible:W,onClose:()=>{z(!1)}}),R&&t(a,{zIndex:2e3,data:null!=j?j:[],showVariable:R,setShowVariable:N,placeholder:"Add a variable",customTrigger:e=>{}})]})},w=o=>{const{cardBody:i,deleteItem:r,editItem:s}=o;return e(C,Object.assign({width:"100%"},{children:[t("div",Object.assign({style:{width:36,height:36}},{children:t(v,{})})),t("div",Object.assign({className:"card-body"},{children:t(h,{children:i})})),e("div",Object.assign({style:{display:"flex",alignItems:"center"}},{children:[s&&t(c,{style:{display:"flex"},Icon:x,onClick:e=>{s(),e.stopPropagation()}}),t(c,{style:{display:"flex",color:"#919191"},Icon:j,onClick:e=>{r(),e.stopPropagation()}})]}))]}))},C=n.div`
|
|
2
|
-
width: ${e=>e.width};
|
|
3
|
-
padding: 12px;
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: row;
|
|
6
|
-
column-gap: 14px;
|
|
7
|
-
justify-content: center;
|
|
8
|
-
align-items: center;
|
|
9
|
-
background: #ffffff;
|
|
10
|
-
|
|
11
|
-
border: 1px solid #e0e0e0;
|
|
12
|
-
border-radius: 4px;
|
|
13
|
-
|
|
14
|
-
.card-body {
|
|
15
|
-
width: 256px;
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
justify-content: center;
|
|
19
|
-
|
|
20
|
-
&__dynamic {
|
|
21
|
-
font-family: 'Inter';
|
|
22
|
-
font-style: normal;
|
|
23
|
-
font-weight: 400;
|
|
24
|
-
font-size: 16px;
|
|
25
|
-
line-height: 24px;
|
|
26
|
-
color: #731dcf;
|
|
27
|
-
|
|
28
|
-
&__desc {
|
|
29
|
-
font-family: 'Inter';
|
|
30
|
-
font-style: normal;
|
|
31
|
-
font-weight: 400;
|
|
32
|
-
font-size: 12px;
|
|
33
|
-
line-height: 16px;
|
|
34
|
-
color: #616161;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
&__simple {
|
|
39
|
-
font-family: 'Inter';
|
|
40
|
-
font-style: normal;
|
|
41
|
-
font-weight: 400;
|
|
42
|
-
font-size: 16px;
|
|
43
|
-
line-height: 24px;
|
|
44
|
-
color: #000000;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
`;export{I as default};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { HEADER_TYPES, TEMPLATE_STATUS, WhatsAppTemplateVariables } from "..";
|
|
2
|
-
import { CHANNEL_TYPE } from "./Channels";
|
|
3
|
-
import { CUSTOM_VARIABLE } from './TemplateMeta';
|
|
4
|
-
export type WhatsAppCarouselTemplate = {
|
|
5
|
-
name: string;
|
|
6
|
-
label: string;
|
|
7
|
-
recommended?: boolean;
|
|
8
|
-
templateId?: string;
|
|
9
|
-
channel: CHANNEL_TYPE;
|
|
10
|
-
templateCategory: string;
|
|
11
|
-
type?: 'email' | 'whatsapp';
|
|
12
|
-
components: {
|
|
13
|
-
type: 'BODY' | 'CAROUSEL';
|
|
14
|
-
format?: HEADER_TYPES;
|
|
15
|
-
text?: string;
|
|
16
|
-
example?: {
|
|
17
|
-
header_handle?: Array<string>;
|
|
18
|
-
body_text?: Array<string[]>;
|
|
19
|
-
header_text?: Array<string>;
|
|
20
|
-
};
|
|
21
|
-
cards?: {
|
|
22
|
-
components: {
|
|
23
|
-
type: 'HEADER' | 'BODY' | 'BUTTONS' | 'FOOTER';
|
|
24
|
-
format?: HEADER_TYPES;
|
|
25
|
-
text?: string;
|
|
26
|
-
buttons?: {
|
|
27
|
-
type: 'QUICK_REPLY' | 'URL' | 'PHONE_NUMBER';
|
|
28
|
-
text?: string;
|
|
29
|
-
url?: string;
|
|
30
|
-
example?: string[];
|
|
31
|
-
linkMode?: 'custom' | 'home';
|
|
32
|
-
phone_number?: string;
|
|
33
|
-
flowName?: string;
|
|
34
|
-
flowId?: string;
|
|
35
|
-
}[];
|
|
36
|
-
example?: {
|
|
37
|
-
header_handle?: Array<string>;
|
|
38
|
-
body_text?: Array<string[]>;
|
|
39
|
-
header_text?: Array<string>;
|
|
40
|
-
};
|
|
41
|
-
}[];
|
|
42
|
-
}[];
|
|
43
|
-
}[];
|
|
44
|
-
mapping: {
|
|
45
|
-
header?: string[];
|
|
46
|
-
body?: string[];
|
|
47
|
-
buttons?: string[];
|
|
48
|
-
cards?: {
|
|
49
|
-
header?: string[];
|
|
50
|
-
body?: string[];
|
|
51
|
-
buttons?: string[];
|
|
52
|
-
}[];
|
|
53
|
-
};
|
|
54
|
-
templateComponentValues: {
|
|
55
|
-
components: {
|
|
56
|
-
header?: string[];
|
|
57
|
-
body?: string[];
|
|
58
|
-
buttons?: string[];
|
|
59
|
-
cards?: {
|
|
60
|
-
header?: string[];
|
|
61
|
-
body?: string[];
|
|
62
|
-
buttons?: string[];
|
|
63
|
-
}[];
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
htmlContentUrl?: string;
|
|
67
|
-
language: 'en_US';
|
|
68
|
-
status: TEMPLATE_STATUS;
|
|
69
|
-
category: string;
|
|
70
|
-
thumbnailImageUrl?: string;
|
|
71
|
-
FB_blob_key?: string;
|
|
72
|
-
reason?: string;
|
|
73
|
-
createdAt: number;
|
|
74
|
-
updatedAt: number;
|
|
75
|
-
isDraft?: boolean;
|
|
76
|
-
isProductCarouselType?: boolean;
|
|
77
|
-
isCarouselType?: boolean;
|
|
78
|
-
};
|
|
79
|
-
export interface WhatsAppCarouselTemplateVariables {
|
|
80
|
-
body: CUSTOM_VARIABLE[];
|
|
81
|
-
cards: WhatsAppTemplateVariables[];
|
|
82
|
-
}
|