@capillarytech/creatives-library 3.1.17 → 3.1.20

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.
@@ -0,0 +1,63 @@
1
+ import { defineMessages } from 'react-intl';
2
+ export default defineMessages({
3
+ "sms": {
4
+ id: 'reon.components.Cap.sms',
5
+ defaultMessage: 'SMS',
6
+ },
7
+ "wechat": {
8
+ id: 'reon.components.Cap.wechat',
9
+ defaultMessage: 'WeChat',
10
+ },
11
+ "gallery": {
12
+ id: 'reon.components.Cap.gallery',
13
+ defaultMessage: 'Gallery',
14
+ },
15
+ "creativesDashboard": {
16
+ id: 'reon.components.Cap.creativesDashboard',
17
+ defaultMessage: 'Creatives',
18
+ },
19
+ "creatives": {
20
+ id: 'reon.components.Cap.creatives',
21
+ defaultMessage: 'Creatives',
22
+ },
23
+ "campaigns": {
24
+ id: 'reon.components.Cap.campaigns',
25
+ defaultMessage: 'Campaigns',
26
+ },
27
+ "loyalty": {
28
+ id: 'reon.components.Cap.loyalty',
29
+ defaultMessage: 'Loyalty',
30
+ },
31
+ "member care": {
32
+ id: 'reon.components.Cap.memberCare',
33
+ defaultMessage: 'Member Care',
34
+ },
35
+ "workbench": {
36
+ id: 'reon.components.Cap.Workbench',
37
+ defaultMessage: 'WorkBench',
38
+ },
39
+ "store care": {
40
+ id: 'reon.components.Cap.storeCare',
41
+ defaultMessage: 'Store Care',
42
+ },
43
+ "store performance": {
44
+ id: 'reon.components.Cap.storePerformance',
45
+ defaultMessage: 'Store Performance',
46
+ },
47
+ "email": {
48
+ id: 'reon.components.Cap.email',
49
+ defaultMessage: 'Email',
50
+ },
51
+ "ebill": {
52
+ id: 'reon.components.Cap.ebill',
53
+ defaultMessage: 'Ebill',
54
+ },
55
+ "campaignsDashboard": {
56
+ id: 'reon.components.campaignsDashboard',
57
+ defaultMessage: 'Campaigns',
58
+ },
59
+ "campaignsHome": {
60
+ id: 'reon.components.campaignsHome',
61
+ defaultMessage: "Campaigns Home",
62
+ },
63
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "3.1.17",
4
+ "version": "3.1.20",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -67,13 +67,60 @@ const CKEditorConfig = {
67
67
  ],
68
68
  };
69
69
 
70
+ const weChatCKEditorConfig = {
71
+ skin: 'moono-lisa',
72
+ toolbar: [
73
+ { name: 'clipboard', items: ['Undo', 'Redo', 'Font', 'FontSize', 'Format'] },
74
+ { name: 'colors', items: ['TextColor', 'BGColor'] },
75
+ { name: 'tools', items: ['Maximize', 'ShowBlocks'] },
76
+ { name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'CopyFormatting', 'RemoveFormat'] },
77
+ { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl', 'Language'] },
78
+ { name: 'insert', items: ['Table', 'HorizontalRule', 'Smiley'] },
79
+ { name: 'editing', items: ['Find', 'Replace', '-', 'SelectAll', '-'] },
80
+ { name: 'links', items: ['Link', 'Unlink', 'Anchor'] },
81
+ { name: 'pasting', items: ['Paste', 'PasteText', 'PasteFromWord'] },
82
+ { name: 'document', items: ['Source'] },
83
+ ],
84
+ format_tags: 'p;h1;h2;h3;pre',
85
+ toolbarCanCollapse: false,
86
+ toolbarStartupExpanded: true,
87
+ // uiColor: '#e3e3e3',
88
+ width: 'calc(100% - 2px)',
89
+ height: 'calc(100vh - 290px)',
90
+ fullPage: true,
91
+ htmlEncodeOutput: true,
92
+ startupFocus: true,
93
+ allowedContent: {
94
+ // Allow all content.
95
+ $1: {
96
+ // elements: this.editorInstance.dtd,
97
+ //elements: window.CKEDITOR.dtd,
98
+ attributes: true,
99
+ styles: true,
100
+ classes: true,
101
+ },
102
+ },
103
+ disallowedContent: 'script; *[on*]',
104
+ language: locale,
105
+ toolbar_Basic:
106
+ [
107
+ ['SwitchBar', '-', 'Source', '-', 'Bold', 'Italic', 'Underline'],
108
+ ['NumberedList', 'BulletedList'],
109
+ ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
110
+ ['Link', 'Unlink', 'Anchor'],
111
+ ['Image', 'Table'],
112
+ ['Font', 'FontSize'],
113
+ ['TextColor', 'BGColor'],
114
+ ],
115
+ };
116
+
70
117
  class Ckeditor extends React.Component { // eslint-disable-line react/prefer-stateless-function
71
118
  constructor(props) {
72
119
  super(props);
73
- const config = CKEditorConfig;
120
+ let config = CKEditorConfig;
74
121
  if (this.props.channel && this.props.channel.toLowerCase() === 'wechat') {
122
+ config = weChatCKEditorConfig;
75
123
  config.startupFocus = false;
76
- config.toolbar[6].items = ['Table', 'HorizontalRule', 'Smiley'];
77
124
  config.height = 'calc(100vh - 450px)';
78
125
  }
79
126
  //State initialization
@@ -0,0 +1,46 @@
1
+ /**
2
+ *
3
+ * Header
4
+ *
5
+ */
6
+
7
+ import PropTypes from 'prop-types';
8
+
9
+ import React from 'react';
10
+ // import styled from 'styled-components';
11
+ import { FormattedMessage } from 'react-intl';
12
+
13
+ import { CapRow, CapColumn, CapInput, CapButton } from '@capillarytech/cap-ui-library';
14
+ import messages from './messages';
15
+
16
+
17
+ function Header(props) {
18
+ return (
19
+ <div>
20
+ <CapRow className="template-form-header">
21
+ <CapColumn span={10}>
22
+ <CapInput id="template-name" placeholder="Enter template name*" defaultValue={props.templateName} type="input" onChange={props.templateNameHandler}/>
23
+ </CapColumn>
24
+ <CapColumn span={2} offset={8}>
25
+ <CapButton id="preview-button" type="cancel" onClick={props.previewHandler}> <FormattedMessage {...messages.preview} /> </CapButton>
26
+ </CapColumn>
27
+ <CapColumn span={2}>
28
+ <CapButton id="cancel-button" type="cancel" onClick={props.cancelHandler}> <FormattedMessage {...messages.cancel} /> </CapButton>
29
+ </CapColumn>
30
+ <CapColumn span={2}>
31
+ <CapButton id="save-button" type="primary" onClick={props.saveHandler}> <FormattedMessage {...messages.save} /> </CapButton>
32
+ </CapColumn>
33
+ </CapRow>
34
+ </div>
35
+ );
36
+ }
37
+
38
+ Header.propTypes = {
39
+ templateNameHandler: PropTypes.func,
40
+ previewHandler: PropTypes.func,
41
+ cancelHandler: PropTypes.func,
42
+ saveHandler: PropTypes.func,
43
+ templateName: PropTypes.string,
44
+ };
45
+
46
+ export default Header;
@@ -0,0 +1,10 @@
1
+ // import React from 'react';
2
+ // import { shallow } from 'enzyme';
3
+
4
+ // import Header from '../index';
5
+
6
+ describe('<Header />', () => {
7
+ it('Expect to have unit tests specified', () => {
8
+ expect(true).toEqual(false);
9
+ });
10
+ });
@@ -0,0 +1,5 @@
1
+ .cap-tab-v2-wrapper{
2
+ .ant-tabs-tabpane {
3
+ border: none;
4
+ }
5
+ }
@@ -439,7 +439,6 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
439
439
  url: this.state.formData['is-internal-url'] ? this.maskTemplateUrl(this.state.formData['template-link']) : this.state.formData['template-link'],
440
440
  TopColor: "#000000",
441
441
  data: {},
442
- previewContent: stateFormData['sms-preview'],
443
442
  BrandId: (selectedWeChatAccount.configs.brand_id ? selectedWeChatAccount.configs.brand_id : ''),
444
443
  OriginalId: selectedWeChatAccount.sourceAccountIdentifier,
445
444
  content: encodeURIComponent(editTemplateData.versions.base.content),
@@ -243,7 +243,6 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
243
243
  TopColor: "#000000",
244
244
  touser: "{{wechat_open_id}}",
245
245
  creative_template_id: templateIdFromProp || templateId,
246
- previewContent: message.mediaList,
247
246
  };
248
247
  const response = {
249
248
  action: "getFormData",
@@ -6,11 +6,11 @@
6
6
  import PropTypes from 'prop-types';
7
7
  import React from 'react';
8
8
  import { connect } from 'react-redux';
9
- import { FormattedMessage } from 'react-intl';
10
- import {CapRadioCard} from '@capillarytech/cap-ui-library';
9
+ import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
10
+ import {CapRadioCard, CapLabel} from '@capillarytech/cap-ui-library';
11
11
  import ComponentWithLabelHOC from '@capillarytech/cap-ui-library/assets/HOCs/ComponentWithLabelHOC';
12
- import {isEmpty} from 'lodash';
13
12
  import styled from 'styled-components';
13
+ import { CAP_SPACE_04, CAP_SPACE_08 } from '@capillarytech/cap-ui-library/styled/variables';
14
14
  // import MobilepushCreate from '../MobilePush/Create';
15
15
  import MapTemplate from '../MapTemplates';
16
16
  import RichMediaCreate from '../RichmediaTemplates/Create';
@@ -52,12 +52,26 @@ export class Wrapper extends React.Component { // eslint-disable-line react/pref
52
52
  this.modes = [
53
53
  {
54
54
  title: <FormattedMessage {...messages.mapTemplate}/>,
55
- content: <WithNoImage height="124px" width={"224px"}/>,
55
+ content: (
56
+ <>
57
+ <CapLabel type="label1" style={{ paddingTop: CAP_SPACE_04, paddingBottom: CAP_SPACE_08 }}>
58
+ {props.intl.formatMessage(messages.mapTemplateSubtext)}
59
+ </CapLabel>
60
+ <WithNoImage height="124px" width={"224px"}/>
61
+ </>
62
+ ),
56
63
  value: MAP_TEMPLATE,
57
64
  },
58
65
  {
59
66
  title: <FormattedMessage {...messages.richMedia}/>,
60
- content: <WithImage height="216px" width={"224px"}/>,
67
+ content: (
68
+ <>
69
+ <CapLabel type="label1" style={{ paddingTop: CAP_SPACE_04, paddingBottom: CAP_SPACE_08 }}>
70
+ {props.intl.formatMessage(messages.richMediaSubtext)}
71
+ </CapLabel>
72
+ <WithImage height="216px" width={"224px"}/>
73
+ </>
74
+ ),
61
75
  value: RICH_MEDIA,
62
76
  },
63
77
  ];
@@ -101,7 +115,7 @@ export class Wrapper extends React.Component { // eslint-disable-line react/pref
101
115
  <CapRadioCardWithLabel
102
116
  label={<FormattedMessage {...messages.templateType}/>}
103
117
  panes={this.modes}
104
- cardHeight={"286px"}
118
+ cardHeight={"364px"}
105
119
  onChange={this.onChange}
106
120
  selected={templateType}
107
121
  />
@@ -185,6 +199,7 @@ Wrapper.propTypes = {
185
199
  query: PropTypes.object,
186
200
  selectedWeChatAccount: PropTypes.object,
187
201
  setIsLoadingContent: PropTypes.func,
202
+ intl: intlShape.isRequired,
188
203
  };
189
204
 
190
205
  function mapDispatchToProps(dispatch) {
@@ -193,4 +208,4 @@ function mapDispatchToProps(dispatch) {
193
208
  };
194
209
  }
195
210
 
196
- export default connect(null, mapDispatchToProps)(Wrapper);
211
+ export default connect(null, mapDispatchToProps)(injectIntl(Wrapper));
@@ -10,10 +10,18 @@ export default defineMessages({
10
10
  id: 'app.containers.WechatWrapper.richMedia',
11
11
  defaultMessage: 'Richmedia template',
12
12
  },
13
+ richMediaSubtext: {
14
+ id: 'app.containers.WechatWrapper.richMediaSubtext',
15
+ defaultMessage: 'Used for creating rich content using text, image, location and audio',
16
+ },
13
17
  mapTemplate: {
14
18
  id: 'app.containers.WechatWrapper.mapTemplate',
15
19
  defaultMessage: 'Map template',
16
20
  },
21
+ mapTemplateSubtext: {
22
+ id: 'app.containers.WechatWrapper.mapTemplateSubtext',
23
+ defaultMessage: 'Used for announcing offers and transaction related information',
24
+ },
17
25
  templateType: {
18
26
  id: 'app.containers.WechatWrapper.templateType',
19
27
  defaultMessage: 'Which type of template you want to create?',