@capillarytech/creatives-library 7.16.9 → 7.16.11

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 (31) hide show
  1. package/containers/Cap/tests/__snapshots__/index.test.js.snap +212 -2
  2. package/containers/MobilePush/Create/index.js +18 -0
  3. package/containers/MobilePush/Edit/index.js +18 -0
  4. package/package.json +1 -1
  5. package/translations/en.json +212 -2
  6. package/translations/ja-JP.json +212 -2
  7. package/translations/zh.json +212 -2
  8. package/v2Components/CapWhatsappCTA/index.js +1 -1
  9. package/v2Components/CapWhatsappCTA/messages.js +1 -5
  10. package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +212 -2
  11. package/v2Containers/LanguageProvider/index.js +3 -0
  12. package/v2Containers/LanguageProvider/tests/index.test.js +1 -0
  13. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +636 -6
  14. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +424 -4
  15. package/v2Containers/Line/Container/Video/index.js +2 -2
  16. package/v2Containers/Line/Container/Video/messages.js +9 -0
  17. package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +3604 -34
  18. package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +3816 -36
  19. package/v2Containers/MobilePush/Create/index.js +30 -3
  20. package/v2Containers/MobilePush/Create/messages.js +48 -0
  21. package/v2Containers/MobilePush/Edit/index.js +28 -1
  22. package/v2Containers/MobilePush/Edit/messages.js +48 -0
  23. package/v2Containers/MobilePush/commonMethods.js +2 -2
  24. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +9964 -94
  25. package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +848 -8
  26. package/v2Containers/SmsTrai/Edit/index.js +1 -1
  27. package/v2Containers/SmsTrai/Edit/messages.js +1 -1
  28. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +1696 -16
  29. package/v2Containers/Whatsapp/index.js +3 -3
  30. package/v2Containers/Whatsapp/messages.js +3 -3
  31. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +17345 -1221
@@ -703,6 +703,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
703
703
  };
704
704
 
705
705
  injectMultiColSection = (section) => {
706
+ const { formatMessage } = this.props.intl;
706
707
  forEach(section.inputFields, (inputField) => {
707
708
  forEach(inputField.cols, (col) => {
708
709
  const temp = col;
@@ -720,6 +721,32 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
720
721
  if (temp.id === "mobile-push-preview") {
721
722
  temp.content.appName = this.props.Templates.selectedWeChatAccount.name;
722
723
  }
724
+
725
+ if (messages?.[temp?.value]) {
726
+ temp.value = formatMessage(messages[temp.value]);
727
+ }
728
+ if (messages?.[temp?.label]) {
729
+ temp.label = formatMessage(messages[temp.label]);
730
+ }
731
+ if (messages?.[temp?.errorMessage]) {
732
+ temp.errorMessage = formatMessage(messages[temp.errorMessage]);
733
+ }
734
+ if (messages?.[temp?.placeholder]) {
735
+ temp.placeholder = formatMessage(messages[temp.placeholder]);
736
+ }
737
+ if (messages?.[temp?.hoverText]) {
738
+ temp.hoverText = formatMessage(messages[temp.hoverText]);
739
+ }
740
+ if (messages?.[temp?.previewProps?.label]) {
741
+ temp.previewProps.label = formatMessage(messages[temp.previewProps.label]);
742
+ }
743
+ if (messages?.[temp?.previewProps?.inductiveText]) {
744
+ temp.previewProps.inductiveText = formatMessage(messages[temp.previewProps.inductiveText]);
745
+ }
746
+ if (messages?.[temp?.previewProps?.errorMessage]) {
747
+ temp.previewProps.errorMessage = formatMessage(messages[temp.previewProps.errorMessage]);
748
+ }
749
+
723
750
  temp.injectedEvents = {};
724
751
 
725
752
  forEach(col.supportedEvents, (event) => {
@@ -1035,7 +1062,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
1035
1062
  metaType: "text",
1036
1063
  datatype: "string",
1037
1064
  options: ["Deeplink", "External Link"],
1038
- inductiveText: ["A page within mobile app", "An external web page"],
1065
+ inductiveText: [<FormattedMessage {...messages.aPageWithMobileApp}/>, <FormattedMessage {...messages.anExternalWebPage}/>],
1039
1066
  value: "Deeplink",
1040
1067
  required: true,
1041
1068
  width: 18,
@@ -1110,7 +1137,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
1110
1137
  metaType: "text",
1111
1138
  datatype: "string",
1112
1139
  options: ["Deeplink", "External Link"],
1113
- inductiveText: ["A page within mobile app", "An external web page"],
1140
+ inductiveText: [<FormattedMessage {...messages.aPageWithMobileApp}/>, <FormattedMessage {...messages.anExternalWebPage}/>],
1114
1141
  value: "Deeplink",
1115
1142
  required: true,
1116
1143
  width: 18,
@@ -1216,7 +1243,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
1216
1243
  metaType: "text",
1217
1244
  datatype: "string",
1218
1245
  options: ["Deeplink", "External Link"],
1219
- inductiveText: ["A page within mobile app", "An external web page"],
1246
+ inductiveText: [<FormattedMessage {...messages.aPageWithMobileApp}/>, <FormattedMessage {...messages.anExternalWebPage}/>],
1220
1247
  value: "Deeplink",
1221
1248
  required: true,
1222
1249
  width: 18,
@@ -294,4 +294,52 @@ export default defineMessages({
294
294
  id: 'creatives.containersV2.MobilePush.Create.change',
295
295
  defaultMessage: 'change',
296
296
  },
297
+ "Add labels": {
298
+ id: 'creatives.containersV2.addLabels',
299
+ defaultMessage: 'Add labels',
300
+ },
301
+ "Cover Image": {
302
+ id: `creatives.containersV2.MobilePush.Create.coverImage`,
303
+ defaultMessage: 'Cover image',
304
+ },
305
+ "Maximum file size acceptable is 5 MB": {
306
+ id: 'creatives.containersV2.MobilePush.Create.coverImageDescription',
307
+ defaultMessage: 'Maximum file size acceptable is 5 MB',
308
+ },
309
+ "Add action link to content": {
310
+ id: 'creatives.containersV2.MobilePush.Create.addActionLinkToContent',
311
+ defaultMessage: 'Add action link to content',
312
+ },
313
+ "Add a hyperlink of the page which customer will be directed to": {
314
+ id: 'creatives.containersV2.MobilePush.Create.addActionLinkToContentDescription',
315
+ defaultMessage: 'Add a hyperlink of the page which customer will be directed to',
316
+ },
317
+ "aPageWithMobileApp": {
318
+ id: 'creatives.containersV2.MobilePush.Create.aPageWithMobileApp',
319
+ defaultMessage: 'A page within mobile app',
320
+ },
321
+ "anExternalWebPage": {
322
+ id: 'creatives.containersV2.MobilePush.Create.anExternalWebPage',
323
+ defaultMessage: 'An external web page',
324
+ },
325
+ "Add primary button to notification": {
326
+ id: 'creatives.containersV2.MobilePush.Create.addPrimaryButtonToNotification',
327
+ defaultMessage: 'Add primary button to notification',
328
+ },
329
+ "Button label": {
330
+ id: 'creatives.containersV2.MobilePush.Create.buttonLabel',
331
+ defaultMessage: 'Button label',
332
+ },
333
+ "Add secondary button to notification": {
334
+ id: 'creatives.containersV2.MobilePush.Create.addSecondaryButtonToNotification',
335
+ defaultMessage: 'Add secondary button to notification',
336
+ },
337
+ "Add action buttons to notification": {
338
+ id: 'creatives.containersV2.MobilePush.Create.addActionButtonsToNotification',
339
+ defaultMessage: 'Add action buttons to notification',
340
+ },
341
+ "This section is being revamped. Till then it will remain disabled.": {
342
+ id: 'creatives.containersV2.MobilePush.Create.thisSectionDisabledHoverText',
343
+ defaultMessage: 'This section is being revamped. Till then it will remain disabled.',
344
+ },
297
345
  });
@@ -1023,7 +1023,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
1023
1023
  metaType: "text",
1024
1024
  datatype: "string",
1025
1025
  options: ["Deeplink", "External Link"],
1026
- inductiveText: ["A page within mobile app", "An external web page"],
1026
+ inductiveText: [<FormattedMessage {...messages.aPageWithMobileApp}/>, <FormattedMessage {...messages.anExternalWebPage}/>],
1027
1027
  value: "Deeplink",
1028
1028
  required: true,
1029
1029
  width: 18,
@@ -1417,6 +1417,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
1417
1417
  return sections;
1418
1418
  };
1419
1419
  injectMultiColSection = (section) => {
1420
+ const { formatMessage } = this.props.intl;
1420
1421
  _.forEach(section.inputFields, (inputField) => {
1421
1422
  _.forEach(inputField.cols, (col) => {
1422
1423
  const temp = col;
@@ -1425,6 +1426,32 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
1425
1426
  temp.value.sections = this.injectSections(temp.value.sections);
1426
1427
  return true;
1427
1428
  }
1429
+
1430
+ if (messages?.[temp?.value]) {
1431
+ temp.value = formatMessage(messages[temp.value]);
1432
+ }
1433
+ if (messages?.[temp?.label]) {
1434
+ temp.label = formatMessage(messages[temp.label]);
1435
+ }
1436
+ if (messages?.[temp?.errorMessage]) {
1437
+ temp.errorMessage = formatMessage(messages[temp.errorMessage]);
1438
+ }
1439
+ if (messages?.[temp?.placeholder]) {
1440
+ temp.placeholder = formatMessage(messages[temp.placeholder]);
1441
+ }
1442
+ if (messages?.[temp?.hoverText]) {
1443
+ temp.hoverText = formatMessage(messages[temp.hoverText]);
1444
+ }
1445
+ if (messages?.[temp?.previewProps?.label]) {
1446
+ temp.previewProps.label = formatMessage(messages[temp.previewProps.label]);
1447
+ }
1448
+ if (messages?.[temp?.previewProps?.inductiveText]) {
1449
+ temp.previewProps.inductiveText = formatMessage(messages[temp.previewProps.inductiveText]);
1450
+ }
1451
+ if (messages?.[temp?.previewProps?.errorMessage]) {
1452
+ temp.previewProps.errorMessage = formatMessage(messages[temp.previewProps.errorMessage]);
1453
+ }
1454
+
1428
1455
  temp.injectedEvents = {};
1429
1456
  temp.className = temp.className ? temp.className : '';
1430
1457
 
@@ -286,4 +286,52 @@ export default defineMessages({
286
286
  id: 'creatives.containersV2.MobilePush.Edit.change',
287
287
  defaultMessage: "change",
288
288
  },
289
+ "aPageWithMobileApp": {
290
+ id: 'creatives.containersV2.MobilePush.Edit.aPageWithMobileApp',
291
+ defaultMessage: 'A page within mobile app',
292
+ },
293
+ "anExternalWebPage": {
294
+ id: 'creatives.containersV2.MobilePush.Edit.anExternalWebPage',
295
+ defaultMessage: 'An external web page',
296
+ },
297
+ "Button label": {
298
+ id: 'creatives.containersV2.MobilePush.Edit.buttonLabel',
299
+ defaultMessage: 'Button label',
300
+ },
301
+ "Add labels": {
302
+ id: 'creatives.containersV2.addLabels',
303
+ defaultMessage: 'Add labels',
304
+ },
305
+ "Cover Image": {
306
+ id: `creatives.containersV2.MobilePush.Edit.coverImage`,
307
+ defaultMessage: 'Cover image',
308
+ },
309
+ "Maximum file size acceptable is 5 MB": {
310
+ id: 'creatives.containersV2.MobilePush.Edit.coverImageDescription',
311
+ defaultMessage: 'Maximum file size acceptable is 5 MB',
312
+ },
313
+ "Add action link to content": {
314
+ id: 'creatives.containersV2.MobilePush.Edit.addActionLinkToContent',
315
+ defaultMessage: 'Add action link to content',
316
+ },
317
+ "Add a hyperlink of the page which customer will be directed to": {
318
+ id: 'creatives.containersV2.MobilePush.Edit.addActionLinkToContentDescription',
319
+ defaultMessage: 'Add a hyperlink of the page which customer will be directed to',
320
+ },
321
+ "Add primary button to notification": {
322
+ id: 'creatives.containersV2.MobilePush.Edit.addPrimaryButtonToNotification',
323
+ defaultMessage: 'Add primary button to notification',
324
+ },
325
+ "Add secondary button to notification": {
326
+ id: 'creatives.containersV2.MobilePush.Edit.addSecondaryButtonToNotification',
327
+ defaultMessage: 'Add secondary button to notification',
328
+ },
329
+ "Add action buttons to notification": {
330
+ id: 'creatives.containersV2.MobilePush.Edit.addActionButtonsToNotification',
331
+ defaultMessage: 'Add action buttons to notification',
332
+ },
333
+ "This section is being revamped. Till then it will remain disabled.": {
334
+ id: 'creatives.containersV2.MobilePush.Edit.thisSectionDisabledHoverText',
335
+ defaultMessage: 'This section is being revamped. Till then it will remain disabled.',
336
+ },
289
337
  });
@@ -16,7 +16,7 @@ function getPrimaryCtaFields({inputFields, fieldIndex, deepLinkOptions, tab}) {
16
16
  metaType: "text",
17
17
  datatype: "string",
18
18
  options: ["Deeplink", "External Link"],
19
- inductiveText: ["A page within mobile app", "An external web page"],
19
+ inductiveText: [<FormattedMessage {...messages.aPageWithMobileApp}/>, <FormattedMessage {...messages.anExternalWebPage}/>],
20
20
  value: "Deeplink",
21
21
  required: true,
22
22
  width: 18,
@@ -105,7 +105,7 @@ function getSecondaryCtaFields({inputFields, fieldIndex, deepLinkOptions}) {
105
105
  metaType: "text",
106
106
  datatype: "string",
107
107
  options: ["Deeplink", "External Link"],
108
- inductiveText: ["A page within mobile app", "An external web page"],
108
+ inductiveText: [<FormattedMessage {...messages.aPageWithMobileApp}/>, <FormattedMessage {...messages.anExternalWebPage}/>],
109
109
  value: "Deeplink",
110
110
  required: true,
111
111
  width: 18,