@capillarytech/creatives-library 2.0.44 → 2.0.46
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/components/CmsTemplatesComponent/index.js +1 -0
- package/components/EmailMobilePreview/index.js +108 -0
- package/components/EmailMobilePreview/index.scss +66 -0
- package/components/FormBuilder/_formBuilder.scss +2 -14
- package/components/FormBuilder/index.js +106 -93
- package/components/Header/index.js +41 -0
- package/components/Header/messages.js +13 -0
- package/components/Header/tests/index.test.js +10 -0
- package/components/PreviewSideBar/index.js +7 -3
- package/components/TemplatePreview/index.js +6 -7
- package/config/app.js +2 -2
- package/containers/Cap/index.js +1 -1
- package/containers/Cap/selectors.js +11 -1
- package/containers/CreativesContainer/SlideBoxContent.js +5 -1
- package/containers/CreativesContainer/SlideBoxFooter.js +5 -9
- package/containers/CreativesContainer/index.js +59 -16
- package/containers/Email/actions.js +2 -3
- package/containers/Email/index.js +32 -26
- package/containers/Email/sagas.js +1 -0
- package/containers/EmailWrapper/index.js +43 -13
- package/containers/EmailWrapper/messages.js +8 -0
- package/containers/MobilePush/Create/index.js +1 -1
- package/containers/Sms/Create/actions.js +4 -4
- package/containers/Sms/Create/index.js +28 -17
- package/containers/Sms/Create/sagas.js +1 -2
- package/containers/Sms/Edit/actions.js +4 -5
- package/containers/Sms/Edit/index.js +31 -5
- package/containers/Sms/Edit/sagas.js +1 -3
- package/containers/Templates/actions.js +3 -1
- package/containers/Templates/index.js +219 -84
- package/containers/Templates/messages.js +8 -0
- package/containers/Templates/sagas.js +16 -4
- package/containers/Templates/selectors.js +2 -0
- package/containers/TemplatesV2/index.js +9 -4
- package/containers/TemplatesV2/reducer.js +34 -0
- package/containers/TemplatesV2/sagas.js +32 -0
- package/containers/WeChat/MapTemplates/_mapTemplates.scss +8 -0
- package/containers/WeChat/MapTemplates/actions.js +52 -0
- package/containers/WeChat/MapTemplates/constants.js +28 -0
- package/containers/WeChat/MapTemplates/index.js +1401 -0
- package/containers/WeChat/MapTemplates/messages.js +73 -0
- package/containers/WeChat/MapTemplates/reducer.js +74 -0
- package/containers/WeChat/MapTemplates/sagas.js +86 -0
- package/containers/WeChat/MapTemplates/selectors.js +25 -0
- package/containers/WeChat/MapTemplates/tests/actions.test.js +18 -0
- package/containers/WeChat/MapTemplates/tests/index.test.js +10 -0
- package/containers/WeChat/MapTemplates/tests/reducer.test.js +9 -0
- package/containers/WeChat/MapTemplates/tests/sagas.test.js +15 -0
- package/containers/WeChat/MapTemplates/tests/selectors.test.js +10 -0
- package/containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +13 -0
- package/containers/WeChat/RichmediaTemplates/Create/actions.js +35 -0
- package/containers/WeChat/RichmediaTemplates/Create/constants.js +14 -0
- package/containers/WeChat/RichmediaTemplates/Create/index.js +679 -0
- package/containers/WeChat/RichmediaTemplates/Create/messages.js +13 -0
- package/containers/WeChat/RichmediaTemplates/Create/reducer.js +49 -0
- package/containers/WeChat/RichmediaTemplates/Create/sagas.js +44 -0
- package/containers/WeChat/RichmediaTemplates/Create/selectors.js +32 -0
- package/containers/WeChat/RichmediaTemplates/Create/tests/actions.test.js +18 -0
- package/containers/WeChat/RichmediaTemplates/Create/tests/index.test.js +10 -0
- package/containers/WeChat/RichmediaTemplates/Create/tests/reducer.test.js +9 -0
- package/containers/WeChat/RichmediaTemplates/Create/tests/sagas.test.js +15 -0
- package/containers/WeChat/RichmediaTemplates/Create/tests/selectors.test.js +10 -0
- package/containers/WeChat/RichmediaTemplates/Create/testschema.js +379 -0
- package/containers/WeChat/RichmediaTemplates/Edit/actions.js +20 -0
- package/containers/WeChat/RichmediaTemplates/Edit/constants.js +10 -0
- package/containers/WeChat/RichmediaTemplates/Edit/index.js +98 -0
- package/containers/WeChat/RichmediaTemplates/Edit/messages.js +13 -0
- package/containers/WeChat/RichmediaTemplates/Edit/reducer.js +28 -0
- package/containers/WeChat/RichmediaTemplates/Edit/sagas.js +32 -0
- package/containers/WeChat/RichmediaTemplates/Edit/selectors.js +25 -0
- package/containers/WeChat/RichmediaTemplates/Edit/tests/actions.test.js +18 -0
- package/containers/WeChat/RichmediaTemplates/Edit/tests/index.test.js +10 -0
- package/containers/WeChat/RichmediaTemplates/Edit/tests/reducer.test.js +9 -0
- package/containers/WeChat/RichmediaTemplates/Edit/tests/sagas.test.js +15 -0
- package/containers/WeChat/RichmediaTemplates/Edit/tests/selectors.test.js +10 -0
- package/containers/WeChat/RichmediaTemplates/View/actions.js +15 -0
- package/containers/WeChat/RichmediaTemplates/View/constants.js +7 -0
- package/containers/WeChat/RichmediaTemplates/View/index.js +45 -0
- package/containers/WeChat/RichmediaTemplates/View/messages.js +13 -0
- package/containers/WeChat/RichmediaTemplates/View/reducer.js +23 -0
- package/containers/WeChat/RichmediaTemplates/View/sagas.js +11 -0
- package/containers/WeChat/RichmediaTemplates/View/selectors.js +25 -0
- package/containers/WeChat/RichmediaTemplates/View/tests/actions.test.js +18 -0
- package/containers/WeChat/RichmediaTemplates/View/tests/index.test.js +10 -0
- package/containers/WeChat/RichmediaTemplates/View/tests/reducer.test.js +9 -0
- package/containers/WeChat/RichmediaTemplates/View/tests/sagas.test.js +15 -0
- package/containers/WeChat/RichmediaTemplates/View/tests/selectors.test.js +10 -0
- package/index.js +3 -3
- package/package.json +1 -1
- package/routes.js +53 -13
- package/services/api.js +6 -1
|
@@ -14,6 +14,7 @@ const {CapCustomCardList} = CapCustomCard;
|
|
|
14
14
|
function CmsTemplatesComponent(props) {
|
|
15
15
|
const cardDataList = props.cmsTemplates.map((template) => (
|
|
16
16
|
{
|
|
17
|
+
key: template.name,
|
|
17
18
|
title: template.name,
|
|
18
19
|
url: template.versions.base.preview_http_url,
|
|
19
20
|
hoverOption: <CapButton onClick={() => props.handleEdmDefaultTemplateSelection(template._id)}><FormattedMessage {...messages.select}/></CapButton>,
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* EmailPreviewV2
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import React from 'react';
|
|
8
|
+
// import styled from 'styled-components';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import { FormattedMessage } from 'react-intl';
|
|
11
|
+
import {isEmpty} from 'lodash';
|
|
12
|
+
import { connect } from 'react-redux';
|
|
13
|
+
import { bindActionCreators } from 'redux';
|
|
14
|
+
import { createStructuredSelector } from 'reselect';
|
|
15
|
+
import { CapSpin } from '@capillarytech/cap-ui-library';
|
|
16
|
+
import moment from 'moment';
|
|
17
|
+
import messages from '../EmailPreviewV2/messages';
|
|
18
|
+
import './index.scss';
|
|
19
|
+
import mobileBody from '../../assets/mobile.png';
|
|
20
|
+
|
|
21
|
+
import {selectTemplateContent} from '../../containers/Templates/selectors';
|
|
22
|
+
import * as templateActions from '../../containers/Templates/actions';
|
|
23
|
+
|
|
24
|
+
const deviceAspectRatio = {
|
|
25
|
+
mobile: {
|
|
26
|
+
height: "500",
|
|
27
|
+
width: "300",
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
class EmailMobilePreview extends React.Component {
|
|
32
|
+
componentWillMount() {
|
|
33
|
+
const {templateData, templateContent} = this.props;
|
|
34
|
+
if (isEmpty(templateContent) && !isEmpty(templateData) && templateData._id) { // templateData: comes from templates list email preview
|
|
35
|
+
this.props.templateActions.getTemplateDetails(templateData._id); // templateContent: html data to be shown in iframe
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
getPreview = ({device, messageContainerName, templateContent}) => (
|
|
40
|
+
<div className={"shell align-center"}>
|
|
41
|
+
<img src={mobileBody} alt="capillary" width="85%" height="400px" />
|
|
42
|
+
<div className={messageContainerName}>
|
|
43
|
+
<iframe srcDoc={templateContent} {...deviceAspectRatio[device]} >
|
|
44
|
+
<p><FormattedMessage {...messages.noIframeSupport}/></p>
|
|
45
|
+
</iframe>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
render() {
|
|
51
|
+
const messageContainerName = 'mobile-message-container';
|
|
52
|
+
const {currentDevice} = this.state;
|
|
53
|
+
const { templateContent } = this.props;
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<div className="email-preview-v2">
|
|
57
|
+
|
|
58
|
+
<CapSpin spinning={!templateContent}>
|
|
59
|
+
<div id="emailPreivew-container">
|
|
60
|
+
<div id="emailPreivew-content-wrapper">
|
|
61
|
+
<div id="emailPreivew-content">
|
|
62
|
+
<div className="email-preview-container">
|
|
63
|
+
<div className={"shell align-center"}>
|
|
64
|
+
<img src={mobileBody} alt="capillary" width="85%" />
|
|
65
|
+
<div className={messageContainerName}>
|
|
66
|
+
<iframe srcDoc={templateContent} {...deviceAspectRatio[currentDevice]} >
|
|
67
|
+
<p><FormattedMessage {...messages.noIframeSupport}/></p>
|
|
68
|
+
</iframe>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
{this.props.templateData &&
|
|
76
|
+
[
|
|
77
|
+
<p className="preview-info"><FormattedMessage {...messages.lastModified} />: {moment(this.props.templateData.updatedAt).format('MM-DD-YYYY')}</p>,
|
|
78
|
+
<p style={{marginBottom: '8px'}} className="preview-info"><FormattedMessage {...messages.uploadedBy} /> : {this.props.templateData.updatedByName}</p>,
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
</CapSpin>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
EmailMobilePreview.propTypes = {
|
|
90
|
+
templateContent: PropTypes.string,
|
|
91
|
+
templateData: PropTypes.object,
|
|
92
|
+
templateActions: PropTypes.object,
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
EmailMobilePreview.defaultProps = {
|
|
96
|
+
showDeviceSelection: true,
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const mapStateToProps = (state, props) => createStructuredSelector({
|
|
100
|
+
templateContent: props.templateData ? selectTemplateContent() : () => props.templateContent, // when props has templateContent that means preview with content
|
|
101
|
+
});
|
|
102
|
+
function mapDispatchToProps(dispatch) {
|
|
103
|
+
return {
|
|
104
|
+
templateActions: bindActionCreators(templateActions, dispatch),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export default connect(mapStateToProps, mapDispatchToProps)(EmailMobilePreview);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
$classPrefix: email-preview-v2;
|
|
2
|
+
.#{$classPrefix}{
|
|
3
|
+
#emailPreivew-container {
|
|
4
|
+
position: relative;
|
|
5
|
+
// padding: 0 24px 0 24px;
|
|
6
|
+
overflow-y: auto;
|
|
7
|
+
// font-family: 'proxima-nova';
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
#emailPreivew-content-wrapper{
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 90%;
|
|
12
|
+
overflow: auto;
|
|
13
|
+
// display: table;
|
|
14
|
+
|
|
15
|
+
#emailPreivew-content {
|
|
16
|
+
.device-wrapper {
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
margin-bottom: 8px;
|
|
19
|
+
margin-top: 16px;
|
|
20
|
+
.device-name {
|
|
21
|
+
padding: 6px 24px;
|
|
22
|
+
background: #E6F0FB;
|
|
23
|
+
border: 2px solid #E6F0FB;
|
|
24
|
+
font-family: "open-sans";
|
|
25
|
+
line-height: 20px;
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
color: #4E92E5;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
}
|
|
30
|
+
.active {
|
|
31
|
+
background: #FFFFFF !important;
|
|
32
|
+
border: 2px solid #E6F0FB;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
.email-preview-container{
|
|
37
|
+
.tablet-message-container {
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: 9%;
|
|
40
|
+
left: 10%;
|
|
41
|
+
width: 100%;
|
|
42
|
+
height: 100%;
|
|
43
|
+
overflow: auto;
|
|
44
|
+
display: -webkit-box;
|
|
45
|
+
display: -ms-flexbox;
|
|
46
|
+
display: flex;
|
|
47
|
+
}
|
|
48
|
+
.mobile-message-container {
|
|
49
|
+
position: absolute;
|
|
50
|
+
top: 10.3%;
|
|
51
|
+
left: 14%;
|
|
52
|
+
overflow: auto;
|
|
53
|
+
display: -webkit-box;
|
|
54
|
+
display: -ms-flexbox;
|
|
55
|
+
display: flex;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
padding: 0 0px 0 24px;
|
|
59
|
+
// display: table-cell;
|
|
60
|
+
// vertical-align: middle;
|
|
61
|
+
text-align: center;
|
|
62
|
+
margin-bottom: 36px;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
text-align: center;
|
|
3
|
-
color: #333333;
|
|
4
|
-
line-height: 24px;
|
|
5
|
-
font-size: 16px;
|
|
6
|
-
font-family: open-sans, sans-serif;
|
|
7
|
-
font-style: normal;
|
|
8
|
-
font-weight: 600;
|
|
9
|
-
}
|
|
1
|
+
|
|
10
2
|
|
|
11
3
|
.form-tab-header{
|
|
12
4
|
display: flex;
|
|
@@ -16,11 +8,7 @@
|
|
|
16
8
|
font-weight: 600;
|
|
17
9
|
}
|
|
18
10
|
|
|
19
|
-
|
|
20
|
-
// border: 1px solid #1D5B96;
|
|
21
|
-
// border-bottom: 2px solid #1D5B96;
|
|
22
|
-
padding: 0 16px 0 8px !important;
|
|
23
|
-
}
|
|
11
|
+
|
|
24
12
|
|
|
25
13
|
.textarea-error-message {
|
|
26
14
|
top: initial !important;
|