@capillarytech/creatives-library 7.16.8 → 7.16.9-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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.16.8",
4
+ "version": "7.16.9-alpha.1",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -12,6 +12,7 @@ import React from 'react';
12
12
  import { ConfigProvider } from 'antd';
13
13
  import enUS from 'antd/es/locale-provider/en_US';
14
14
  import zhCN from 'antd/es/locale-provider/zh_CN';
15
+ import jaJP from 'antd/es/locale-provider/ja_JP';
15
16
  import { connect } from 'react-redux';
16
17
  import { createStructuredSelector } from 'reselect';
17
18
  import { IntlProvider } from 'react-intl';
@@ -37,6 +38,7 @@ export class LanguageProvider extends React.PureComponent { // eslint-disable-li
37
38
  'zh-cn': 'zh',
38
39
  'zh': 'zh',
39
40
  'en-US': 'en-US',
41
+ 'ja-JP': 'ja-JP',
40
42
  };
41
43
  return map[locale];
42
44
  };
@@ -57,6 +59,7 @@ export class LanguageProvider extends React.PureComponent { // eslint-disable-li
57
59
  'zh-cn': zhCN,
58
60
  'en-US': enUS,
59
61
  'zh': zhCN,
62
+ 'ja-JP': jaJP,
60
63
  };
61
64
  const jLocale = localStorage.getItem('jlocale') || 'en';
62
65
  const file = mappedLocale[jLocale];
@@ -551,11 +551,11 @@ export const LineVideo = ({
551
551
  value={selectedAction}
552
552
  options={[
553
553
  {
554
- label: 'Hide',
554
+ label: <FormattedMessage {...messages.hide} />,
555
555
  value: HIDE_ACTION_BUTTON,
556
556
  },
557
557
  {
558
- label: 'Display',
558
+ label: <FormattedMessage {...messages.display} />,
559
559
  value: DISPLAY_ACTION_BUTTON,
560
560
  },
561
561
  ]}
@@ -139,4 +139,13 @@ export default defineMessages({
139
139
  id: `${scope}.inValidUrlErrorMessage`,
140
140
  defaultMessage: 'Action url is not valid',
141
141
  },
142
+ hide: {
143
+ id: `${scope}.hide`,
144
+ defaultMessage: 'Hide',
145
+ },
146
+ display: {
147
+ id: `${scope}.display`,
148
+ defaultMessage: 'Display',
149
+ },
150
+
142
151
  });
@@ -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,23 @@ 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
+
723
741
  temp.injectedEvents = {};
724
742
 
725
743
  forEach(col.supportedEvents, (event) => {
@@ -1035,7 +1053,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
1035
1053
  metaType: "text",
1036
1054
  datatype: "string",
1037
1055
  options: ["Deeplink", "External Link"],
1038
- inductiveText: ["A page within mobile app", "An external web page"],
1056
+ inductiveText: [<FormattedMessage {...messages.aPageWithMobileApp}/>, <FormattedMessage {...messages.anExternalWebPage}/>],
1039
1057
  value: "Deeplink",
1040
1058
  required: true,
1041
1059
  width: 18,
@@ -1110,7 +1128,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
1110
1128
  metaType: "text",
1111
1129
  datatype: "string",
1112
1130
  options: ["Deeplink", "External Link"],
1113
- inductiveText: ["A page within mobile app", "An external web page"],
1131
+ inductiveText: [<FormattedMessage {...messages.aPageWithMobileApp}/>, <FormattedMessage {...messages.anExternalWebPage}/>],
1114
1132
  value: "Deeplink",
1115
1133
  required: true,
1116
1134
  width: 18,
@@ -1216,7 +1234,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
1216
1234
  metaType: "text",
1217
1235
  datatype: "string",
1218
1236
  options: ["Deeplink", "External Link"],
1219
- inductiveText: ["A page within mobile app", "An external web page"],
1237
+ inductiveText: [<FormattedMessage {...messages.aPageWithMobileApp}/>, <FormattedMessage {...messages.anExternalWebPage}/>],
1220
1238
  value: "Deeplink",
1221
1239
  required: true,
1222
1240
  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.MobilePush.Create.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,23 @@ 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
+
1428
1446
  temp.injectedEvents = {};
1429
1447
  temp.className = temp.className ? temp.className : '';
1430
1448
 
@@ -286,4 +286,20 @@ 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
+ "This section is being revamped. Till then it will remain disabled.": {
302
+ id: 'creatives.containersV2.MobilePush.Edit.thisSectionDisabledHoverText',
303
+ defaultMessage: 'This section is being revamped. Till then it will remain disabled.',
304
+ },
289
305
  });
@@ -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,