@capillarytech/creatives-library 7.17.81 → 7.17.82-alpha.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.
Files changed (38) hide show
  1. package/containers/Cap/sagas.js +7 -5
  2. package/containers/Cap/tests/saga.test.js +81 -1
  3. package/package.json +3 -2
  4. package/services/api.js +5 -0
  5. package/services/tests/api.test.js +9 -1
  6. package/v2Components/CapWhatsappQuickReply/index.js +243 -0
  7. package/v2Components/CapWhatsappQuickReply/index.scss +43 -0
  8. package/v2Components/CapWhatsappQuickReply/messages.js +24 -0
  9. package/v2Components/TemplatePreview/_templatePreview.scss +23 -0
  10. package/v2Components/TemplatePreview/index.js +51 -1
  11. package/v2Components/TemplatePreview/messages.js +4 -0
  12. package/v2Components/TemplatePreview/tests/__snapshots__/index.test.js.snap +0 -14
  13. package/v2Containers/CreativesContainer/index.js +22 -2
  14. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +2 -0
  15. package/v2Containers/Templates/index.js +5 -2
  16. package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +6 -0
  17. package/v2Containers/Whatsapp/actions.js +16 -0
  18. package/v2Containers/Whatsapp/constants.js +22 -0
  19. package/v2Containers/Whatsapp/index.js +699 -187
  20. package/v2Containers/Whatsapp/index.scss +55 -1
  21. package/v2Containers/Whatsapp/messages.js +37 -0
  22. package/v2Containers/Whatsapp/reducer.js +19 -0
  23. package/v2Containers/Whatsapp/sagas.js +40 -1
  24. package/v2Containers/Whatsapp/styles.scss +29 -0
  25. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +40962 -24255
  26. package/v2Containers/Whatsapp/tests/__snapshots__/utils.test.js.snap +12 -0
  27. package/v2Containers/Whatsapp/tests/actions.test.js +21 -0
  28. package/v2Containers/Whatsapp/tests/index.test.js +8 -0
  29. package/v2Containers/Whatsapp/tests/mockData.js +6 -0
  30. package/v2Containers/Whatsapp/tests/reducer.test.js +67 -0
  31. package/v2Containers/Whatsapp/tests/saga.test.js +90 -0
  32. package/v2Containers/Whatsapp/tests/utils.test.js +11 -0
  33. package/v2Containers/Whatsapp/utils.js +45 -3
  34. package/v2Containers/mockdata.js +105 -4
  35. package/v2Containers/InApp/constants.js +0 -0
  36. package/v2Containers/InApp/index.js +0 -499
  37. package/v2Containers/InApp/index.scss +0 -0
  38. package/v2Containers/InApp/messages.js +0 -0
@@ -72,6 +72,24 @@
72
72
  color: $FONT_COLOR_04;
73
73
  }
74
74
 
75
+ .whatsapp-footer-edit-container {
76
+ background-color: $CAP_G10;
77
+ margin: $CAP_SPACE_08 0;
78
+ padding: $CAP_SPACE_12;
79
+ .whatsapp-footer-edit-text {
80
+ overflow: hidden;
81
+ text-overflow: ellipsis;
82
+ color: $FONT_COLOR_04;
83
+ }
84
+ }
85
+
86
+ .whatsapp-create-mode-heading {
87
+ margin-top: $CAP_SPACE_16;
88
+ margin-bottom: $CAP_SPACE_06;
89
+ display: flex;
90
+ text-align: center;
91
+ }
92
+
75
93
  .whatsapp-edit-disabled {
76
94
  cursor: not-allowed;
77
95
  opacity: 0.5;
@@ -111,6 +129,7 @@
111
129
 
112
130
  .whatsapp-button-quick-reply {
113
131
  display: inline-grid;
132
+ margin-top: $CAP_SPACE_24;
114
133
  }
115
134
 
116
135
  .whatsapp-optional-label {
@@ -148,5 +167,40 @@
148
167
  left: 525px;
149
168
  color: $FONT_COLOR_05;
150
169
  }
151
- }
170
+ }
171
+
172
+ .whatsapp-optional-label1 {
173
+ margin-left: $CAP_SPACE_04;
174
+ color: $FONT_COLOR_03;
175
+ font-weight: normal;
176
+ font-size: $CAP_SPACE_12;
177
+ }
178
+
179
+ .whatsapp-create-template-header-input {
180
+ margin-bottom: $CAP_SPACE_20;
181
+ }
182
+
183
+ .whatsapp-template-header-preview {
184
+ color: $CAP_G01;
185
+ font-weight: $FONT_WEIGHT_MEDIUM;
186
+ font-size: $FONT_SIZE_VS;
187
+ margin-bottom: $CAP_SPACE_08;
188
+ }
189
+
190
+ .whatsapp-template-footer-preview {
191
+ color: $CAP_G04;
192
+ font-weight: $FONT_WEIGHT_REGULAR;
193
+ font-size: 0.571rem;
194
+ margin-top: $CAP_SPACE_08;
195
+ }
196
+
197
+ .whatsapp-text-field_spacing {
198
+ margin-left: $CAP_SPACE_04;
199
+ }
200
+
201
+ .whatsapp-render-url-preview-text {
202
+ color: $CAP_G01;
203
+ font-size: $FONT_SIZE_M;
204
+ font-weight: $FONT_WEIGHT_MEDIUM;
205
+ }
152
206
  }
@@ -184,6 +184,11 @@ export default defineMessages({
184
184
  defaultMessage:
185
185
  'Variable name should be numeric value from {one} to {nineteen}',
186
186
  },
187
+ headerUnknownVars: {
188
+ id: `${prefix}.headerUnknownVars`,
189
+ defaultMessage:
190
+ 'Variable name should be numeric value and its always {{1}}',
191
+ },
187
192
  removeMultinewlineChars: {
188
193
  id: `${prefix}.removeMultinewlineChars`,
189
194
  defaultMessage:
@@ -627,4 +632,36 @@ export default defineMessages({
627
632
  id: `${prefix}.zulu`,
628
633
  defaultMessage: 'Zulu',
629
634
  },
635
+ templateHeaderLabel: {
636
+ id: `${prefix}.templateHeaderLabel`,
637
+ defaultMessage: 'Header',
638
+ },
639
+ templateFooterLabel: {
640
+ id: `${prefix}.templateFooterLabel`,
641
+ defaultMessage: 'Footer',
642
+ },
643
+ templateHeaderTooltip: {
644
+ id: `${prefix}.templateHeaderTooltip`,
645
+ defaultMessage: 'Header can usually include information such as the business name or a brief identifier to let the recipient know the source of the message',
646
+ },
647
+ templateFooterTooltip: {
648
+ id: `${prefix}.templateFooterTooltip`,
649
+ defaultMessage: 'Footer is optional text-only component that appears immediately after the body component',
650
+ },
651
+ templateHeaderLengthError: {
652
+ id: `${prefix}.templateHeaderLengthError`,
653
+ defaultMessage: 'Template header length cannot exceed 60',
654
+ },
655
+ templateFooterLengthError: {
656
+ id: `${prefix}.templateHeaderLengthError`,
657
+ defaultMessage: 'Template footer length cannot exceed 60',
658
+ },
659
+ quickReplyButtons: {
660
+ id: `${prefix}.quickReplyButtons`,
661
+ defaultMessage: 'Quick reply buttons',
662
+ },
663
+ showUrlPreview: {
664
+ id: `${prefix}.showUrlPreview`,
665
+ defaultMessage: 'Show URL preview',
666
+ },
630
667
  });
@@ -12,11 +12,18 @@ import {
12
12
  UPLOAD_WHATSAPP_ASSET_SUCCESS,
13
13
  UPLOAD_WHATSAPP_ASSET_FAILURE,
14
14
  CLEAR_WHATSAPP_ASSET,
15
+ URL_META_TAGS_REQUEST,
16
+ URL_META_TAGS_SUCCESS,
17
+ URL_META_TAGS_FAILURE,
18
+ URL_META_TAGS_RESET,
15
19
  } from './constants';
16
20
 
17
21
  const initialState = fromJS({
18
22
  uploadedAssetData: {},
19
23
  createTemplateInProgress: false,
24
+ getMetaTagsRequest: false,
25
+ metaTagsDetails: {},
26
+ getMetaTagsError: '',
20
27
  });
21
28
 
22
29
  function whatsappReducer(state = initialState, action) {
@@ -51,6 +58,18 @@ function whatsappReducer(state = initialState, action) {
51
58
  .set('templateDetails', action.data);
52
59
  case GET_TEMPLATE_DETAILS_FAILURE:
53
60
  return state.set('getTemplateDetailsInProgress', false);
61
+ case URL_META_TAGS_REQUEST:
62
+ return state.set('getMetaTagsRequest', true)
63
+ .set('metaTagsDetails', {});
64
+ case URL_META_TAGS_SUCCESS:
65
+ return state.set('getMetaTagsRequest', false)
66
+ .set('metaTagsDetails', action?.data);
67
+ case URL_META_TAGS_FAILURE:
68
+ return state.set('getMetaTagsRequest', false)
69
+ .set('getMetaTagsError', action?.error)
70
+ .set('metaTagsDetails', {});
71
+ case URL_META_TAGS_RESET:
72
+ return state.set('metaTagsDetails', {});
54
73
  case RESET_EDIT_TEMPLATE:
55
74
  return state.set('templateDetails', {});
56
75
  case UPLOAD_WHATSAPP_ASSET_REQUEST:
@@ -12,6 +12,9 @@ import {
12
12
  UPLOAD_WHATSAPP_ASSET_REQUEST,
13
13
  UPLOAD_WHATSAPP_ASSET_SUCCESS,
14
14
  UPLOAD_WHATSAPP_ASSET_FAILURE,
15
+ URL_META_TAGS_REQUEST,
16
+ URL_META_TAGS_SUCCESS,
17
+ URL_META_TAGS_FAILURE,
15
18
  } from './constants';
16
19
 
17
20
  export function* uploadWhatsappAsset(params) {
@@ -90,11 +93,46 @@ export function* getTemplateDetails({ id }) {
90
93
  }
91
94
  }
92
95
 
96
+ //For getMetaTags
97
+ export function* getMetaTagsDetails({ previewUrl, callBack }) {
98
+ try {
99
+ const result = yield call(Api.getMetaTags, {
100
+ previewUrl,
101
+ });
102
+ if (result?.success) {
103
+ yield put({
104
+ type: URL_META_TAGS_SUCCESS,
105
+ data: result?.response,
106
+ });
107
+ } else {
108
+ if (callBack) {
109
+ callBack({errorMessage: result?.message});
110
+ }
111
+ yield put({
112
+ type: URL_META_TAGS_FAILURE,
113
+ error: result?.message,
114
+ });
115
+ }
116
+ } catch (error) {
117
+ if (callBack) {
118
+ callBack({errorMessage: error});
119
+ }
120
+ yield put({ type: URL_META_TAGS_FAILURE, error });
121
+ }
122
+ }
123
+
93
124
  function* watchGetTemplateDetails() {
94
- const watcher = yield takeLatest(
125
+ yield takeLatest(
95
126
  GET_TEMPLATE_DETAILS_REQUEST,
96
127
  getTemplateDetails,
97
128
  );
129
+ }
130
+
131
+ export function* watchGetMetaTagsDetails() {
132
+ const watcher = yield takeLatest(
133
+ URL_META_TAGS_REQUEST,
134
+ getMetaTagsDetails,
135
+ );
98
136
  yield take(LOCATION_CHANGE);
99
137
  yield cancel(watcher);
100
138
  }
@@ -103,4 +141,5 @@ export default [
103
141
  watchCreateTemplate,
104
142
  watchGetTemplateDetails,
105
143
  watchUploadWhatsappAsset,
144
+ watchGetMetaTagsDetails,
106
145
  ];
@@ -39,4 +39,33 @@
39
39
  }
40
40
  }
41
41
  }
42
+ }
43
+
44
+ .whatsapp-template-list-header-preview {
45
+ color: $CAP_G01;
46
+ font-weight: $FONT_WEIGHT_MEDIUM;
47
+ font-size: $FONT_SIZE_M;
48
+ margin-bottom: $CAP_SPACE_08;
49
+ }
50
+
51
+ .whatsapp-template-list-footer-preview {
52
+ color: $CAP_G04;
53
+ font-weight: $FONT_WEIGHT_REGULAR;
54
+ font-size: $FONT_SIZE_VS;
55
+ margin-top: $CAP_SPACE_08;
56
+ margin-bottom: $CAP_SPACE_08;
57
+ }
58
+
59
+ .whatsapp-list-quick-reply-preview {
60
+ margin: $CAP_SPACE_12 0;
61
+ display: flex;
62
+ justify-content: center;
63
+ font-size: $FONT_SIZE_M;
64
+ svg {
65
+ margin-right: $CAP_SPACE_04;
66
+ }
67
+ }
68
+
69
+ .whatsapp-list-view-divider {
70
+ margin: 0;
42
71
  }