@capillarytech/creatives-library 8.0.87-alpha.18 → 8.0.87-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/initialState.js +0 -1
  2. package/package.json +1 -1
  3. package/services/api.js +7 -6
  4. package/v2Components/CapWhatsappCTA/messages.js +4 -0
  5. package/v2Components/CapWhatsappCarouselButton/constant.js +51 -0
  6. package/v2Components/CapWhatsappCarouselButton/index.js +446 -0
  7. package/v2Components/CapWhatsappCarouselButton/index.scss +39 -0
  8. package/v2Components/FormBuilder/index.js +3 -7
  9. package/v2Components/TemplatePreview/_templatePreview.scss +9 -0
  10. package/v2Components/TemplatePreview/assets/images/empty_image_preview.svg +4 -0
  11. package/v2Components/TemplatePreview/assets/images/empty_video_preview.svg +4 -0
  12. package/v2Components/TemplatePreview/index.js +169 -104
  13. package/v2Containers/Cap/actions.js +0 -8
  14. package/v2Containers/Cap/constants.js +0 -4
  15. package/v2Containers/Cap/reducer.js +0 -6
  16. package/v2Containers/Cap/sagas.js +0 -23
  17. package/v2Containers/Cap/selectors.js +0 -6
  18. package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +0 -1
  19. package/v2Containers/CreativesContainer/SlideBoxContent.js +1 -11
  20. package/v2Containers/CreativesContainer/constants.js +0 -3
  21. package/v2Containers/CreativesContainer/index.js +88 -78
  22. package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +0 -25
  23. package/v2Containers/CreativesContainer/tests/index.test.js +0 -2
  24. package/v2Containers/Email/index.js +0 -1
  25. package/v2Containers/EmailWrapper/index.js +0 -2
  26. package/v2Containers/MobilePush/Create/index.js +0 -1
  27. package/v2Containers/MobilePush/Edit/index.js +0 -1
  28. package/v2Containers/MobilepushWrapper/index.js +1 -2
  29. package/v2Containers/Sms/Create/index.js +0 -1
  30. package/v2Containers/Sms/Edit/index.js +0 -1
  31. package/v2Containers/SmsWrapper/index.js +0 -2
  32. package/v2Containers/Templates/_templates.scss +35 -0
  33. package/v2Containers/Templates/index.js +64 -5
  34. package/v2Containers/TemplatesV2/index.js +0 -7
  35. package/v2Containers/Whatsapp/constants.js +83 -1
  36. package/v2Containers/Whatsapp/index.js +709 -182
  37. package/v2Containers/Whatsapp/index.scss +52 -1
  38. package/v2Containers/Whatsapp/messages.js +38 -2
  39. package/v2Containers/Whatsapp/utils.js +34 -0
  40. package/v2Containers/mockdata.js +0 -3
  41. package/utils/transformerUtils.js +0 -524
@@ -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 BUTTON_TEXT = 'buttonText'
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,
@@ -558,6 +611,35 @@ export const LANGUAGE_OPTIONS = [
558
611
  },
559
612
  ];
560
613
 
614
+ export const carouselMediaOptions = [
615
+ {
616
+ value: 'image',
617
+ label: <FormattedMessage {...messages.mediaImage} />,
618
+ },
619
+ {
620
+ value: 'video',
621
+ label: <FormattedMessage {...messages.mediaVideo} />,
622
+ },
623
+ ];
624
+
625
+ export const CAROUSEL_INITIAL_DATA = [{
626
+ mediaType: '',
627
+ bodyText: '',
628
+ bodyError: '',
629
+ addedVarCount: 0,
630
+ buttons: [
631
+ {
632
+ buttonType: PHONE_NUMBER,
633
+ text: '',
634
+ phone_number: '',
635
+ isSaved: false,
636
+ textError: '',
637
+ },
638
+ ],
639
+ }];
640
+
641
+ export const MAX_CAROUSEL_ALLOWED = 10;
642
+
561
643
  export const OTP_CONFIG_URI = "/org/setup/configurations/OTPConfigurations";
562
644
  export const AI_CONTENT_BOT_DISABLED = "AI_CONTENT_BOT_DISABLED";
563
645
  export const CORRECT_TEMPLATE_FORMAT_URL = "https://developers.facebook.com/docs/whatsapp/updates-to-pricing/new-template-guidelines";