@capillarytech/creatives-library 8.0.87-alpha.21 → 8.0.87-alpha.23
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/containers/Templates/constants.js +6 -0
- package/containers/Templates/index.js +44 -24
- package/package.json +1 -1
- package/services/api.js +22 -12
- package/services/tests/api.test.js +5 -1
- package/utils/commonUtils.js +64 -10
- package/utils/tests/commonUtil.test.js +108 -3
- package/utils/tests/transformerUtils.test.js +2127 -0
- package/utils/transformerUtils.js +42 -96
- package/v2Components/CapImageUpload/index.js +13 -10
- package/v2Components/CapVideoUpload/index.js +12 -9
- package/v2Components/CapWhatsappCTA/messages.js +4 -0
- package/v2Components/CapWhatsappCarouselButton/constant.js +56 -0
- package/v2Components/CapWhatsappCarouselButton/index.js +446 -0
- package/v2Components/CapWhatsappCarouselButton/index.scss +39 -0
- package/v2Components/CapWhatsappCarouselButton/tests/index.test.js +237 -0
- package/v2Components/FormBuilder/constants.js +8 -0
- package/v2Components/FormBuilder/index.js +2 -2
- package/v2Components/TemplatePreview/_templatePreview.scss +20 -0
- package/v2Components/TemplatePreview/assets/images/empty_image_preview.svg +4 -0
- package/v2Components/TemplatePreview/assets/images/empty_video_preview.svg +4 -0
- package/v2Components/TemplatePreview/index.js +160 -105
- package/v2Components/TemplatePreview/tests/__snapshots__/index.test.js.snap +6 -6
- package/v2Containers/Cap/tests/saga.test.js +90 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +0 -6
- package/v2Containers/CreativesContainer/constants.js +8 -1
- package/v2Containers/CreativesContainer/index.js +102 -9
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +3 -0
- package/v2Containers/Email/index.js +0 -1
- package/v2Containers/EmailWrapper/components/EmailWrapperView.js +192 -0
- package/v2Containers/EmailWrapper/constants.js +11 -1
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +343 -0
- package/v2Containers/EmailWrapper/index.js +116 -300
- package/v2Containers/EmailWrapper/mockdata/mockdata.js +119 -0
- package/v2Containers/EmailWrapper/tests/EmailWrapperView.test.js +214 -0
- package/v2Containers/EmailWrapper/tests/index.test.js +101 -0
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +601 -0
- package/v2Containers/MobilePush/Edit/index.js +0 -1
- package/v2Containers/MobilepushWrapper/index.js +1 -2
- package/v2Containers/Sms/Create/index.js +0 -1
- package/v2Containers/SmsWrapper/index.js +0 -2
- package/v2Containers/Templates/_templates.scss +47 -0
- package/v2Containers/Templates/index.js +55 -5
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +177 -156
- package/v2Containers/TemplatesV2/index.js +2 -2
- package/v2Containers/Whatsapp/constants.js +87 -1
- package/v2Containers/Whatsapp/index.js +715 -190
- package/v2Containers/Whatsapp/index.scss +52 -1
- package/v2Containers/Whatsapp/messages.js +38 -2
- package/v2Containers/Whatsapp/styles.scss +5 -0
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +27722 -90751
- package/v2Containers/Whatsapp/tests/__snapshots__/utils.test.js.snap +6 -0
- package/v2Containers/Whatsapp/tests/mockData.js +3 -7
- package/v2Containers/Whatsapp/tests/utils.test.js +178 -1
- package/v2Containers/Whatsapp/utils.js +52 -0
- package/v2Containers/Zalo/index.js +47 -15
- package/v2Containers/Zalo/index.scss +8 -0
- package/v2Containers/Zalo/messages.js +4 -0
- package/v2Containers/mockdata.js +2 -0
|
@@ -54,6 +54,56 @@ export const WHATSAPP_CATEGORIES = {
|
|
|
54
54
|
transactional: 'TRANSACTIONAL',
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
+
export const mediaTypeOptions = ({host, templateCategory}) => {
|
|
58
|
+
return [
|
|
59
|
+
{
|
|
60
|
+
key: 'TEXT',
|
|
61
|
+
value: WHATSAPP_MEDIA_TYPES.TEXT,
|
|
62
|
+
label: <FormattedMessage {...messages.none} />,
|
|
63
|
+
tagColor: CAP_PURPLE03,
|
|
64
|
+
tagTextColor: CAP_PURPLE02,
|
|
65
|
+
},
|
|
66
|
+
...(host === HOST_TWILIO
|
|
67
|
+
? []
|
|
68
|
+
: [
|
|
69
|
+
{
|
|
70
|
+
key: 'IMAGE',
|
|
71
|
+
value: WHATSAPP_MEDIA_TYPES.IMAGE,
|
|
72
|
+
label: <FormattedMessage {...messages.mediaImage} />,
|
|
73
|
+
tagColor: CAP_ORANGE01,
|
|
74
|
+
tagTextColor: CAP_ORANGE,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
key: 'VIDEO',
|
|
78
|
+
value: WHATSAPP_MEDIA_TYPES.VIDEO,
|
|
79
|
+
label: <FormattedMessage {...messages.mediaVideo} />,
|
|
80
|
+
tagColor: CAP_GREEN02,
|
|
81
|
+
tagTextColor: CAP_GREEN01,
|
|
82
|
+
},
|
|
83
|
+
...(templateCategory === WHATSAPP_CATEGORIES.marketing
|
|
84
|
+
? [
|
|
85
|
+
{
|
|
86
|
+
key: 'CAROUSEL',
|
|
87
|
+
value: WHATSAPP_MEDIA_TYPES.CAROUSEL,
|
|
88
|
+
label: <FormattedMessage {...messages.mediaCarousel} />,
|
|
89
|
+
tagColor: CAP_PURPLE03,
|
|
90
|
+
tagTextColor: CAP_PURPLE02,
|
|
91
|
+
},
|
|
92
|
+
]
|
|
93
|
+
: []
|
|
94
|
+
),
|
|
95
|
+
{
|
|
96
|
+
key: 'DOCUMENT',
|
|
97
|
+
value: WHATSAPP_MEDIA_TYPES.DOCUMENT,
|
|
98
|
+
label: <FormattedMessage {...messages.mediaDocument} />,
|
|
99
|
+
tagColor: CAP_ORANGE01,
|
|
100
|
+
tagTextColor: CAP_ORANGE,
|
|
101
|
+
},
|
|
102
|
+
]
|
|
103
|
+
),
|
|
104
|
+
];
|
|
105
|
+
};
|
|
106
|
+
|
|
57
107
|
export const KARIX_GUPSHUP_CATEGORY_OPTIONS = [
|
|
58
108
|
{
|
|
59
109
|
key: 'utility',
|
|
@@ -212,14 +262,17 @@ export const WHATSAPP_MEDIA_TYPES = {
|
|
|
212
262
|
IMAGE: 'IMAGE',
|
|
213
263
|
VIDEO: 'VIDEO',
|
|
214
264
|
DOCUMENT: 'DOCUMENT',
|
|
265
|
+
CAROUSEL: 'CAROUSEL',
|
|
215
266
|
};
|
|
216
267
|
export const NONE = 'NONE';
|
|
217
268
|
export const CTA = 'CTA';
|
|
218
269
|
export const QUICK_REPLY = 'QUICK_REPLY';
|
|
219
270
|
export const HEADER_TEXT = 'header';
|
|
220
271
|
export const FOOTER_TEXT = 'footer';
|
|
272
|
+
export const CAROUSEL_TEXT = 'carouselText';
|
|
221
273
|
export const MESSAGE_TEXT = 'message';
|
|
222
|
-
export const
|
|
274
|
+
export const BODY_TEXT = 'body';
|
|
275
|
+
export const BUTTON_TEXT = 'buttonText';
|
|
223
276
|
export const WHATSAPP_BUTTON_TYPES = {
|
|
224
277
|
NONE,
|
|
225
278
|
CTA,
|
|
@@ -227,6 +280,9 @@ export const WHATSAPP_BUTTON_TYPES = {
|
|
|
227
280
|
};
|
|
228
281
|
export const PHONE_NUMBER = 'PHONE_NUMBER';
|
|
229
282
|
export const STATIC_URL = 'STATIC_URL';
|
|
283
|
+
export const URL = 'URL';
|
|
284
|
+
export const IMAGE = 'IMAGE';
|
|
285
|
+
export const VIDEO = 'VIDEO';
|
|
230
286
|
export const INITIAL_CTA_DATA = [
|
|
231
287
|
{
|
|
232
288
|
index: 0,
|
|
@@ -558,6 +614,36 @@ export const LANGUAGE_OPTIONS = [
|
|
|
558
614
|
},
|
|
559
615
|
];
|
|
560
616
|
|
|
617
|
+
export const carouselMediaOptions = [
|
|
618
|
+
{
|
|
619
|
+
value: 'image',
|
|
620
|
+
label: <FormattedMessage {...messages.mediaImage} />,
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
value: 'video',
|
|
624
|
+
label: <FormattedMessage {...messages.mediaVideo} />,
|
|
625
|
+
},
|
|
626
|
+
];
|
|
627
|
+
|
|
628
|
+
export const CAROUSEL_INITIAL_DATA = [{
|
|
629
|
+
mediaType: '',
|
|
630
|
+
bodyText: '',
|
|
631
|
+
bodyError: '',
|
|
632
|
+
addedVarCount: 0,
|
|
633
|
+
buttons: [
|
|
634
|
+
{
|
|
635
|
+
buttonType: PHONE_NUMBER,
|
|
636
|
+
text: '',
|
|
637
|
+
phone_number: '',
|
|
638
|
+
isSaved: false,
|
|
639
|
+
textError: '',
|
|
640
|
+
},
|
|
641
|
+
],
|
|
642
|
+
}];
|
|
643
|
+
|
|
644
|
+
// WhatsApp supports a maximum of 10 items in a carousel
|
|
645
|
+
export const MAX_CAROUSEL_ALLOWED = 10;
|
|
646
|
+
|
|
561
647
|
export const OTP_CONFIG_URI = "/org/setup/configurations/OTPConfigurations";
|
|
562
648
|
export const AI_CONTENT_BOT_DISABLED = "AI_CONTENT_BOT_DISABLED";
|
|
563
649
|
export const CORRECT_TEMPLATE_FORMAT_URL = "https://developers.facebook.com/docs/whatsapp/updates-to-pricing/new-template-guidelines";
|