@capillarytech/creatives-library 2.0.83 → 2.0.84

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,55 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="360px" height="725px" viewBox="0 0 360 725" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 55.2 (78181) - https://sketchapp.com -->
4
+ <title>Artboard Copy 3</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <g id="Artboard-Copy-3" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
7
+ <rect id="Rectangle" fill="#FFFFFF" x="0" y="660" width="360" height="65"></rect>
8
+ <g id="Organisms/ui/android/screenshots/wallpaper" transform="translate(120.000000, 0.000000)"></g>
9
+ <g id="Group-5" transform="translate(16.000000, 680.000000)">
10
+ <polygon id="Stroke-1" stroke-opacity="0.0117647061" stroke="#000000" stroke-width="1.33333336e-11" points="0 0 23.999999 0 23.999999 23.999999 0 23.999999"></polygon>
11
+ <polygon id="Fill-3" fill="#7F7F7F" points="18.9999989 12.9999992 12.9999992 12.9999992 12.9999992 18.9999989 10.9999993 18.9999989 10.9999993 12.9999992 4.9999997 12.9999992 4.9999997 10.9999993 10.9999993 10.9999993 10.9999993 4.9999997 12.9999992 4.9999997 12.9999992 10.9999993 18.9999989 10.9999993"></polygon>
12
+ </g>
13
+ <text id="Add-text-to-this-mes" font-family="Roboto-Regular, Roboto" font-size="15" font-weight="normal" letter-spacing="0.3" fill="#959595">
14
+ <tspan x="53" y="697">Add text to this message</tspan>
15
+ </text>
16
+ <g id="Group-5" transform="translate(320.000000, 679.000000)">
17
+ <polygon id="Stroke-1" stroke-opacity="0.0117647061" stroke="#000000" stroke-width="1.33333336e-11" points="0 0 23.999999 0 23.999999 23.999999 0 23.999999"></polygon>
18
+ <polygon id="Fill-3" fill="#757575" points="2.00999988 20.9999987 22.9999986 11.9999993 2.00999988 2.99999982 1.99999988 9.9999994 16.999999 11.9999993 1.99999988 13.9999992"></polygon>
19
+ </g>
20
+ <rect id="Rectangle" stroke="#E6E6E6" fill="#F4F5F7" x="0.5" y="86.5" width="359" height="573"></rect>
21
+ <g id="Group">
22
+ <g id="Toolbar">
23
+ <polygon id="Toolbar-bg" fill="#E51FA3" points="360 0 0 0 0 86 360 86"></polygon>
24
+ <g id="Toolbar-contents" transform="translate(16.000000, 40.000000)">
25
+ <g id="Back">
26
+ <rect id="Bounds" x="0" y="0" width="24" height="24"></rect>
27
+ <polygon id="Shape" fill="#FFFFFF" points="20 11 7.8 11 13.4 5.4 12 4 4 12 12 20 13.4 18.6 7.8 13 20 13"></polygon>
28
+ </g>
29
+ </g>
30
+ </g>
31
+ <g id="Status-bar">
32
+ <rect id="Status-bar-bg" fill="#CF0E8F" x="0" y="0" width="360" height="24"></rect>
33
+ <rect id="bounds" x="242" y="0" width="118" height="24"></rect>
34
+ <g id="battery" transform="translate(337.000000, 4.000000)">
35
+ <polygon id="bounds" points="0 0 16 0 16 16 0 16"></polygon>
36
+ <polygon id="Shape" fill="#FFFFFF" points="9 1.875 9 1 6 1 6 1.875 3 1.875 3 15 12 15 12 1.875"></polygon>
37
+ </g>
38
+ <g id="cellular" transform="translate(317.000000, 4.000000)">
39
+ <polygon id="bounds" points="0 0 16 0 16 16 0 16"></polygon>
40
+ <polygon id="Shape" fill="#FFFFFF" points="0 15 14 15 14 1"></polygon>
41
+ </g>
42
+ <g id="wifi" transform="translate(296.000000, 4.000000)">
43
+ <polygon id="bounds" points="2 0 18 0 18 16 2 16"></polygon>
44
+ <path d="M0.977372085,4.01593123 C3.48821908,2.12256382 6.61301513,1 10,1 C13.3869849,1 16.5117809,2.12256382 19.0226279,4.01593123 L10,15 L0.977372085,4.01593123 Z" id="Shape" fill="#FFFFFF"></path>
45
+ </g>
46
+ </g>
47
+ <g id="Icons-/-Navigation-24px-/-White-/-More" transform="translate(332.000000, 42.000000)">
48
+ <g id="More">
49
+ <rect id="Bounds" x="0" y="0" width="12" height="24"></rect>
50
+ <path d="M6,8 C7.1,8 8,7.1 8,6 C8,4.9 7.1,4 6,4 C4.9,4 4,4.9 4,6 C4,7.1 4.9,8 6,8 L6,8 Z M6,10 C4.9,10 4,10.9 4,12 C4,13.1 4.9,14 6,14 C7.1,14 8,13.1 8,12 C8,10.9 7.1,10 6,10 L6,10 Z M6,16 C4.9,16 4,16.9 4,18 C4,19.1 4.9,20 6,20 C7.1,20 8,19.1 8,18 C8,16.9 7.1,16 6,16 L6,16 Z" id="Shape" fill="#FFFFFF"></path>
51
+ </g>
52
+ </g>
53
+ </g>
54
+ </g>
55
+ </svg>
@@ -0,0 +1,353 @@
1
+ .shell {
2
+ position: relative;
3
+ -webkit-transform: translate(-50%);
4
+ transform: translate(-50%);
5
+ left: 50%;
6
+ padding: 0 10px;
7
+ width: 450px;
8
+
9
+ .preview-image {
10
+ width: 51%;
11
+ &.sms {
12
+ width: 45%;
13
+ }
14
+ }
15
+
16
+ .msgContainer {
17
+ position: absolute;
18
+ top: 18%;
19
+ left: 28.8%;
20
+ width: 42%;
21
+ height: 336px;
22
+ display: -webkit-box;
23
+ display: -ms-flexbox;
24
+ display: flex;
25
+
26
+ .sms-icon{
27
+ top: 0;
28
+ left: 2px;
29
+ width: 25px;
30
+ position: absolute;
31
+ }
32
+ &.sms{
33
+ height: 290px;
34
+ width: 40%;
35
+ .sms-icon{
36
+ width: 20px;
37
+ left: 14px;
38
+ }
39
+ }
40
+
41
+ .message-pop{
42
+ .unicode-disabled{
43
+ font-size: 16px;
44
+ }
45
+ &.sms {
46
+ max-height: 100%;
47
+ position: absolute;
48
+ // width: initial;
49
+ overflow: auto;
50
+ top: 0;
51
+ left: 17%;
52
+ white-space: pre-wrap;
53
+ word-break: break-word;
54
+ line-height: 14px;
55
+ padding: 0 8px 8px 8px;
56
+ font-size: 10px;
57
+ width: 80%;
58
+ font-family: 'open-sans';
59
+ .message-pop-item{
60
+ padding: 4px;
61
+ background: #3F51B5;
62
+ color: #FFFFFF;
63
+ margin-top: 8px;
64
+ border-radius: 4px;
65
+ min-height: 26px;
66
+ &:first-child{
67
+ margin-top: 0;
68
+ }
69
+ }
70
+ }
71
+ &:not(.sms){
72
+ padding: 4px;
73
+ background: #3F51B5;
74
+ position: absolute;
75
+ // width: initial;
76
+ overflow: auto;
77
+ top: 0;
78
+ left: 17%;
79
+ white-space: pre-wrap;
80
+ word-break: break-word;
81
+ border-radius: 4px;
82
+ max-height: 100%;
83
+ color: #FFFFFF;
84
+ width: 70%;
85
+ min-height: 26px;
86
+ line-height: 14px;
87
+ padding: 8px;
88
+ font-size: 10px;
89
+ font-family: 'open-sans';
90
+ }
91
+ }
92
+ }
93
+ .android-push-message-Container, .iphone-push-message-Container{
94
+ position: absolute;
95
+ top: 11%;
96
+ left: 28.8%;
97
+ width: 42%;
98
+ height: 336px;
99
+ overflow: auto;
100
+ display: -webkit-box;
101
+ display: -ms-flexbox;
102
+ display: flex;
103
+ .message-pop{
104
+ position: absolute;
105
+ // width: initial;
106
+ overflow: auto;
107
+ word-wrap: break-word;
108
+ white-space: pre-wrap;
109
+ border-top-left-radius: 4px;
110
+ border-top-right-radius: 4px;
111
+ max-height: 100%;
112
+ width: 100%;
113
+ min-height: 26px;
114
+ line-height: 15px;
115
+ font-size: 10px;
116
+ .body-image{
117
+ img{
118
+ max-width: 100%;
119
+ max-height: 90px;
120
+ margin: auto;
121
+ display: block;
122
+ }
123
+ }
124
+ }
125
+ }
126
+ .android-push-message-Container{
127
+ .title, .body-text, .body-image, .app-name{
128
+ background-color: #FFFFFF;
129
+ color: #333333;
130
+ }
131
+ .app-name{
132
+ color: #5D5D5D;
133
+ font-weight: 600;
134
+ padding: 8px 8px 4px 8px;
135
+ }
136
+ .title, .body-image{
137
+ padding: 0 8px 0 8px;
138
+
139
+ }
140
+ .body-text{
141
+ padding: 0 8px 4px 8px;
142
+ color: #5a5959;
143
+ }
144
+ .title{
145
+ overflow: hidden;
146
+ white-space: nowrap;
147
+ text-overflow: ellipsis;
148
+ }
149
+ .actions{
150
+ background-color: #EEEEEE;
151
+ height: 32px;
152
+ padding: 4px;
153
+ .action{
154
+ line-height: 24px;
155
+ font-size: 10px;
156
+ font-weight: 600;
157
+ color: #1970DA;
158
+ height: 12px;
159
+ margin-left: 8px;
160
+ }
161
+ }
162
+ }
163
+ .iphone-push-message-Container{
164
+ top: 8%;
165
+ .message-pop{
166
+ border-radius: 4px;
167
+ word-wrap: break-word;
168
+ }
169
+ .title, .body-text, .body-image, .app-name{
170
+ background-color: #FFFFFF;
171
+ color: #333333;
172
+ }
173
+ .body-image{
174
+ padding-top: 8px;
175
+ }
176
+ .title{
177
+ overflow: hidden;
178
+ white-space: nowrap;
179
+ text-overflow: ellipsis;
180
+ }
181
+ .app-name{
182
+ padding: 8px;
183
+ color: #5D5D5D;
184
+ border-bottom: solid 1px #D6D6D6;
185
+ .material-icons{
186
+ font-size: 12px;
187
+ float: right;
188
+ }
189
+ }
190
+ .title, .body-text{
191
+ padding: 4px;
192
+ }
193
+ .title{
194
+ overflow: hidden;
195
+ white-space: nowrap;
196
+ text-overflow: ellipsis;
197
+ }
198
+ .body-text{
199
+ border-bottom-left-radius: 4px;
200
+ border-bottom-right-radius: 4px;
201
+ }
202
+ .actions{
203
+ background-color: #FFFFFF;
204
+ opacity: 0.8;
205
+ height: 32px;
206
+ line-height: 26px;
207
+ margin-top: 4px;
208
+ border-radius: 6px;
209
+ text-align: center;
210
+ padding: 4px;
211
+ .action{
212
+ font-size: 12px;
213
+ font-weight: 600;
214
+ color: #000000;
215
+ text-align: center;
216
+ margin-left: 8px;
217
+ }
218
+ }
219
+ }
220
+ }
221
+
222
+ .align-center {
223
+ text-align: center;
224
+ }
225
+
226
+ .align-left {
227
+ text-align: left;
228
+ }
229
+
230
+ .preview-container{
231
+ .preview-info {
232
+ // font-family: 'proxima-nova';
233
+ font-weight: 600;
234
+ font-size: 16px;
235
+ text-align: center;
236
+ }
237
+ }
238
+
239
+ .preview-container.embedded-preview{
240
+ .preview-image {
241
+ width: 38% !important;
242
+ }
243
+ .message-pop{
244
+ left: 21% !important;
245
+ width: 67% !important;
246
+ }
247
+ .sms-icon{
248
+ left: 12% !important;
249
+ }
250
+ }
251
+
252
+
253
+
254
+ #slidebox-container {
255
+ left: 60vw;
256
+ width: 40vw;
257
+
258
+ .shell {
259
+ position: relative;
260
+ -webkit-transform: translate(-50%);
261
+ transform: translate(-50%);
262
+ left: 50%;
263
+ padding: 0 10px;
264
+ width: initial;
265
+
266
+ .preview-image {
267
+ &.sms{
268
+ width: 45%;
269
+ }
270
+ }
271
+
272
+
273
+ .msgContainer {
274
+ position: absolute;
275
+ top: 14%;
276
+ left: 29%;
277
+ width: 42%;
278
+ height: 275px;
279
+ display: -webkit-box;
280
+ display: -ms-flexbox;
281
+ display: flex;
282
+
283
+ .sms-icon{
284
+ top: 6%;
285
+ left: 2%;
286
+ width: 12%;
287
+ position: absolute;
288
+ }
289
+
290
+ &.sms{
291
+ height: 290px;
292
+ width: 40%;
293
+ top: 16%;
294
+ .sms-icon{
295
+ left: 7%;
296
+ }
297
+ }
298
+ .message-pop{
299
+ &.sms {
300
+ max-height: 100%;
301
+ position: absolute;
302
+ // width: initial;
303
+ overflow: auto;
304
+ top: 6%;
305
+ left: 17%;
306
+ width: 80%;
307
+ white-space: pre-wrap;
308
+ word-break: break-word;
309
+ line-height: 14px;
310
+ padding: 0 8px 8px 8px;
311
+ font-size: 10px;
312
+ font-family: 'open-sans';
313
+ .message-pop-item{
314
+ padding: 8px;
315
+ background: #3F51B5;
316
+ color: #FFFFFF;
317
+ margin-top: 8px;
318
+ border-radius: 4px;
319
+ min-height: 26px;
320
+ &:first-child{
321
+ margin-top: 0;
322
+ }
323
+ }
324
+ }
325
+ &:not(.sms){
326
+ padding: 8px 8px;
327
+ background: #3F51B5;
328
+ position: absolute;
329
+ width: 65%;
330
+ top: 15%;
331
+ left: 19%;
332
+ word-break: break-all;
333
+ border-radius: 6px;
334
+ max-height: 100%;
335
+ overflow: auto;
336
+ color: #FFFFFF;
337
+ line-height: 14px;
338
+ font-family: "open-sans";
339
+ font-size: 10px;
340
+ }
341
+ }
342
+ }
343
+ }
344
+ }
345
+ .app-icon{
346
+ width: 10px;
347
+ height: 10px;
348
+ opacity: 1;
349
+ display: inline-block;
350
+ background-color: #333333;
351
+ margin-right: 4px;
352
+ }
353
+
@@ -0,0 +1,69 @@
1
+ /**
2
+ *
3
+ * SmsPreviewV2
4
+ *
5
+ */
6
+
7
+ import React from 'react';
8
+ // import styled from 'styled-components';
9
+
10
+ import { FormattedMessage } from 'react-intl';
11
+ import messages from './messages';
12
+ import {CapColumn, CapRow, CapHeading} from '@capillarytech/cap-ui-library';
13
+ import androidPhoneImage from '../../assets/android-message-gui-2.svg';
14
+
15
+ class SmsPreviewV2 extends React.Component { // eslint-disable-line react/prefer-stateless-function
16
+ render() {
17
+ let content = [this.props.content];
18
+ const channel = this.props.channel;
19
+ let smsDetails = {};
20
+ if (this.props.content && this.props.charCounterEnabled) {
21
+ smsDetails = updateCharCount(this.props.content, this.props.unicodeEnabled);
22
+ content = [];
23
+ for (let i = 0, limit = 0; i < smsDetails.parts; i += 1, limit += smsDetails.chars_sms) {
24
+ content.push(smsDetails.char_list.slice(limit, smsDetails.chars_sms * (i + 1)));
25
+ }
26
+ if (document.getElementById("msg_count") && this.props.showCount) {
27
+ document.getElementById("msg_count").val = smsDetails.parts;
28
+ }
29
+ }
30
+ const type = this.props.location && this.props.location.query.type ? this.props.location.query.type : '';
31
+ return (
32
+ <CapRow>
33
+ {this.props.showCount && <CapColumn span={16}>
34
+ {channel && channel.toLowerCase() === 'sms' && <CapHeading type="h3">
35
+ <FormattedMessage {...messages.charactersTotal} values={{smsCount: smsDetails.parts, charCount: smsDetails.chars_used}}/>
36
+ {smsDetails.unicode &&
37
+ <FormattedMessage {...messages.smsFormatType}/>
38
+ }
39
+ </CapHeading>}
40
+ </CapColumn>}
41
+ <CapColumn span={this.props.showCount ? 8 : 24}>
42
+ <div className={`preview-container ${type === 'embedded' ? 'embedded-preview' : ''}`}>
43
+ { channel && channel.toLowerCase() === 'sms' &&
44
+ <div className="shell align-center" id="sms-preview">
45
+ <img className="preview-image sms" src={smsBody} alt="Preview is being generated"/>
46
+ <div className="msgContainer sms">
47
+ <img className="sms-icon" src={smsIcon} alt="Sms icon" />
48
+ <div className={"message-pop sms"}>
49
+ {content && content.length && content.map((msg, index) =>
50
+ <CapColumn key={`"message-pop-content-${index}`} className="message-pop-item align-left" style={{ background: '#3F51B5', color: '#ffffff'}}>
51
+ {msg}
52
+ </CapColumn>)
53
+ }
54
+ </div>
55
+ </div>
56
+ </div>
57
+ }
58
+ </div>
59
+ </CapColumn>
60
+ </CapRow>
61
+ );
62
+ }
63
+ }
64
+
65
+ SmsPreviewV2.propTypes = {
66
+
67
+ };
68
+
69
+ export default SmsPreviewV2;
@@ -0,0 +1,13 @@
1
+ /*
2
+ * SmsPreviewV2 Messages
3
+ *
4
+ * This contains all the text for the SmsPreviewV2 component.
5
+ */
6
+ import { defineMessages } from 'react-intl';
7
+
8
+ export default defineMessages({
9
+ header: {
10
+ id: 'app.components.SmsPreviewV2.header',
11
+ defaultMessage: 'This is the SmsPreviewV2 component !',
12
+ },
13
+ });
@@ -0,0 +1,10 @@
1
+ // import React from 'react';
2
+ // import { shallow } from 'enzyme';
3
+
4
+ // import SmsPreviewV2 from '../index';
5
+
6
+ describe('<SmsPreviewV2 />', () => {
7
+ it('Expect to have unit tests specified', () => {
8
+ expect(true).toEqual(false);
9
+ });
10
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "2.0.83",
4
+ "version": "2.0.84",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",