@capillarytech/creatives-library 3.1.18 → 3.1.21

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.
Binary file
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "3.1.18",
4
+ "version": "3.1.21",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -29,4 +29,4 @@
29
29
  "styled-components": "^3.2.1",
30
30
  "whatwg-fetch": "2.0.1"
31
31
  }
32
- }
32
+ }
@@ -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
@@ -93,6 +93,7 @@
93
93
  height: 56px;
94
94
  background-color: white;
95
95
  border-radius: 4px;
96
+ border: 1px solid #dfe2e7;
96
97
  display: flex;
97
98
  .title {
98
99
  padding: 12px;
@@ -0,0 +1,5 @@
1
+ .template-image {
2
+ margin: 0 -1.142rem;
3
+ height: 274px;
4
+ width: 370px;
5
+ }
@@ -6,19 +6,19 @@
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';
17
17
  import RichMediaEdit from '../RichmediaTemplates/Edit';
18
18
  import WechatRichmediaTemplatePreview from '../../../v2Components/TemplatePreview/WechatRichmediaTemplatePreview';
19
19
  import TemplatePreview from '../../../v2Components/TemplatePreview';
20
- import WithImage from '../../../assets/WithImage1';
21
- import WithNoImage from '../../../assets/NoImage1';
20
+ import mapTemplateImage from "../../../assets/mapTemplate.png";
21
+ import richMediaImage from "../../../assets/richMedia.png";
22
22
  import {
23
23
  CREATE,
24
24
  RICH_MEDIA,
@@ -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
+ <img alt="" className="template-image" src={mapTemplateImage} />
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
+ <img alt="" className="template-image" src={richMediaImage} />
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?',