@capillarytech/creatives-library 6.7.1 → 6.8.0
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/assets/line-image-placeholder.svg +14 -0
- package/assets/line.png +0 -0
- package/assets/smiley-placeholder.svg +11 -0
- package/components/TemplatePreview/index.js +185 -8
- package/index.js +3 -3
- package/package.json +1 -1
- package/routes.js +2 -2
- package/services/api.js +3 -0
- package/styles/vendor/semantic/src/definitions/modules/accordion.less +219 -219
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +1 -1
- package/v2Components/TemplatePreview/assets/images/WECHAT_5x.png +0 -0
- package/v2Components/TemplatePreview/index.js +164 -12
- package/v2Components/TemplatePreview/messages.js +8 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +51 -17
- package/v2Containers/CreativesContainer/index.js +23 -17
- package/v2Containers/Line/Container/Drawer/index.js +93 -0
- package/v2Containers/Line/Container/Image/constants.js +3 -0
- package/v2Containers/Line/Container/Image/index.js +460 -0
- package/v2Containers/Line/Container/Image/messages.js +86 -0
- package/v2Containers/Line/Container/Image/style.js +32 -0
- package/v2Containers/Line/Container/ImageMap/assets/hover/custom.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/hover/templateEight.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/hover/templateFive.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/hover/templateFour.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/hover/templateOne.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/hover/templateSeven.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/hover/templateSix.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/hover/templateThree.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/hover/templateTwo.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/selected/custom.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/selected/templateEight.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/selected/templateFive.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/selected/templateFour.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/selected/templateOne.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/selected/templateSeven.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/selected/templateSix.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/selected/templateThree.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/selected/templateTwo.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/templates/custom.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/templates/templateEight.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/templates/templateFive.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/templates/templateFour.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/templates/templateOne.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/templates/templateSeven.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/templates/templateSix.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/templates/templateThree.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/templates/templateTwo.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/templates_with_alphabets/custom.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/templates_with_alphabets/templateEight.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/templates_with_alphabets/templateFive.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/templates_with_alphabets/templateFour.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/templates_with_alphabets/templateOne.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/templates_with_alphabets/templateSeven.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/templates_with_alphabets/templateSix.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/templates_with_alphabets/templateThree.png +0 -0
- package/v2Containers/Line/Container/ImageMap/assets/templates_with_alphabets/templateTwo.png +0 -0
- package/v2Containers/Line/Container/ImageMap/constants.js +19 -0
- package/v2Containers/Line/Container/ImageMap/index.js +603 -0
- package/v2Containers/Line/Container/ImageMap/messages.js +126 -0
- package/v2Containers/Line/Container/ImageMap/style.js +94 -0
- package/v2Containers/Line/Container/ImageMap/templates.json +195 -0
- package/v2Containers/Line/Container/Sticker/index.js +224 -0
- package/v2Containers/Line/Container/Sticker/messages.js +34 -0
- package/v2Containers/Line/Container/Sticker/style.js +36 -0
- package/v2Containers/Line/Container/Sticker/utils.js +68 -0
- package/v2Containers/Line/Container/Text/index.js +338 -0
- package/v2Containers/Line/Container/Text/messages.js +74 -0
- package/v2Containers/Line/Container/Text/style.js +37 -0
- package/v2Containers/Line/Container/Wrapper/index.js +152 -0
- package/v2Containers/Line/Container/Wrapper/messages.js +46 -0
- package/v2Containers/Line/Container/Wrapper/style.js +44 -0
- package/v2Containers/Line/Container/Wrapper/utils.js +67 -0
- package/v2Containers/Line/Container/_lineCreate.scss +108 -0
- package/v2Containers/Line/Container/actions.js +99 -0
- package/v2Containers/Line/Container/constants.js +48 -0
- package/v2Containers/Line/Container/index.js +581 -0
- package/v2Containers/Line/Container/messages.js +66 -0
- package/v2Containers/Line/Container/reducer.js +103 -0
- package/v2Containers/Line/Container/sagas.js +137 -0
- package/v2Containers/Line/Container/selectors.js +30 -0
- package/v2Containers/Line/Container/style.js +57 -0
- package/v2Containers/Line/Create/index.js +1 -1
- package/v2Containers/Templates/index.js +40 -22
- package/v2Containers/Templates/messages.js +8 -0
- package/v2Containers/TemplatesV2/index.js +13 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="40" height="40" viewBox="0 0 40 40">
|
|
2
|
+
<defs>
|
|
3
|
+
<path id="fmb5mu5hna" d="M22.607 7.974c.3.174.55.424.724.724l10.447 17.969H0l7.45-9.671c.673-.875 1.929-1.038 2.804-.364.137.105.259.227.364.364l2.525 3.277 6.73-11.575c.555-.955 1.78-1.28 2.734-.724zM5.333 0c2.946 0 5.334 2.388 5.334 5.333 0 2.946-2.388 5.334-5.334 5.334C2.388 10.667 0 8.279 0 5.333 0 2.388 2.388 0 5.333 0z"/>
|
|
4
|
+
</defs>
|
|
5
|
+
<g fill="none" fill-rule="evenodd" transform="translate(3.333 6.667)">
|
|
6
|
+
<mask id="y1v9lb6dbb" fill="#fff">
|
|
7
|
+
<use xlink:href="#fmb5mu5hna"/>
|
|
8
|
+
</mask>
|
|
9
|
+
<use fill="#BCD0FA" xlink:href="#fmb5mu5hna"/>
|
|
10
|
+
<g fill="#B3BAC5" mask="url(#y1v9lb6dbb)">
|
|
11
|
+
<path d="M1 0H41V40H1z" transform="translate(-4 -7)"/>
|
|
12
|
+
</g>
|
|
13
|
+
</g>
|
|
14
|
+
</svg>
|
package/assets/line.png
ADDED
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="48px" height="48px" viewBox="0 0 48 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<!-- Generator: Sketch 59 (86127) - https://sketch.com -->
|
|
4
|
+
<title>Shape</title>
|
|
5
|
+
<desc>Created with Sketch.</desc>
|
|
6
|
+
<g id="➍-creatives-line" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
7
|
+
<g id="04b.23.17.creatives_line" transform="translate(-1199.000000, -210.000000)" fill="#FFFFFF" fill-rule="nonzero">
|
|
8
|
+
<path d="M1223,210 C1209.746,210 1199,220.746 1199,234 C1199,247.254 1209.746,258 1223,258 C1236.254,258 1247,247.254 1247,234 C1247,220.746 1236.254,210 1223,210 Z M1230,226 C1231.656,226 1233,227.342 1233,229 C1233,230.658 1231.656,232 1230,232 C1228.344,232 1227,230.658 1227,229 C1227,227.342 1228.344,226 1230,226 Z M1216,226 C1217.656,226 1219,227.342 1219,229 C1219,230.658 1217.656,232 1216,232 C1214.344,232 1213,230.658 1213,229 C1213,227.342 1214.344,226 1216,226 Z M1223.002,246 C1217.4,246 1213.254,242.308 1211,238.868 L1211.986,237.882 C1215.01,240.272 1218.334,241.744 1223.002,241.744 C1227.668,241.744 1230.99,240.272 1234.014,237.882 L1235,238.868 C1232.746,242.308 1228.602,246 1223.002,246 L1223.002,246 Z" id="Shape"></path>
|
|
9
|
+
</g>
|
|
10
|
+
</g>
|
|
11
|
+
</svg>
|
|
@@ -18,11 +18,15 @@ const smsMobileAndroid = require('./assets/images/sms_mobile_android.svg');
|
|
|
18
18
|
const wechatMobileAndroid = require('./assets/images/wechat_mobile_android.svg');
|
|
19
19
|
const smsMobileIos = require('./assets/images/sms_mobile_ios.svg');
|
|
20
20
|
const smsAndroidHomeScreen = require('./assets/images/home-screen-android.svg');
|
|
21
|
+
const lineMobileAndroid = require('../../assets/line.png');
|
|
22
|
+
const lineImgPlaceholder = require('../../assets/line-image-placeholder.svg');
|
|
23
|
+
const lineStickerPlaceholder = require('../../assets/smiley-placeholder.svg');
|
|
21
24
|
const smsIosHomeScreen = require('./assets/images/home-screen-ios.svg');
|
|
22
25
|
const wechatBody = require('./assets/images/WECHAT_5x.png');
|
|
23
26
|
const smsBody = require('./assets/images/mobile.svg');
|
|
24
27
|
const androidPushMessagePhone = require('./assets/images/androidPushMessage.svg');
|
|
25
28
|
const iPhonePushMessagePhone = require('./assets/images/iPhonePushMessage.svg');
|
|
29
|
+
import { CAP_COLOR_03, CAP_WHITE, FONT_COLOR_01, CAP_G08 } from '@capillarytech/cap-ui-library/styled/variables';
|
|
26
30
|
|
|
27
31
|
class TemplatePreview extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
28
32
|
getWechatAndroidPreview = (content) => (
|
|
@@ -147,6 +151,22 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
147
151
|
</div>
|
|
148
152
|
);
|
|
149
153
|
|
|
154
|
+
renderLineMultiText = (content) => {
|
|
155
|
+
let textCount = 0;
|
|
156
|
+
return content.map((item) => {
|
|
157
|
+
const { type, messageContent = '' } = item || {};
|
|
158
|
+
if (type === 'text' && messageContent) {
|
|
159
|
+
textCount += 1;
|
|
160
|
+
return (
|
|
161
|
+
<p style={{fontSize: 16, fontWeight: "bold", margin: 0}}>
|
|
162
|
+
text msg-{textCount}: ({messageContent.length}/{1600} characters)
|
|
163
|
+
</p>
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
return null
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
150
170
|
render() {
|
|
151
171
|
console.log('preview props', this.props);
|
|
152
172
|
let content = channel && channel.toLowerCase() === 'sms' ? [this.props.content] : this.props.content;
|
|
@@ -292,14 +312,171 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
292
312
|
(channel || '').toLowerCase() === 'line' ? (
|
|
293
313
|
<div className="shell align-center" id="sms-preview">
|
|
294
314
|
<CapImage className="preview-image" src={wechatBody} alt={this.props.intl.formatMessage(messages.previewGenerated)}/>
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
315
|
+
{
|
|
316
|
+
content && Array.isArray(content)
|
|
317
|
+
? (
|
|
318
|
+
<>
|
|
319
|
+
<div
|
|
320
|
+
className="msgContainer line-preview"
|
|
321
|
+
style={{
|
|
322
|
+
maxHeight: 300,
|
|
323
|
+
overflow: 'scroll',
|
|
324
|
+
flexDirection: 'column',
|
|
325
|
+
marginLeft: 40,
|
|
326
|
+
left: '20%',
|
|
327
|
+
}}
|
|
328
|
+
>
|
|
329
|
+
<div
|
|
330
|
+
className="sms-icon"
|
|
331
|
+
style={{
|
|
332
|
+
width: 25,
|
|
333
|
+
height: 25,
|
|
334
|
+
background: '#2E89DF',
|
|
335
|
+
borderRadius: '50%',
|
|
336
|
+
paddingTop: 2,
|
|
337
|
+
top: 12,
|
|
338
|
+
}}
|
|
339
|
+
>
|
|
340
|
+
{this.props.lineAccountName}
|
|
341
|
+
</div>
|
|
342
|
+
{
|
|
343
|
+
content.map((item) => {
|
|
344
|
+
const {
|
|
345
|
+
type,
|
|
346
|
+
messageContent,
|
|
347
|
+
previewImageUrl = lineImgPlaceholder,
|
|
348
|
+
baseUrl,
|
|
349
|
+
selectedSticker = {
|
|
350
|
+
stickerUrl: lineStickerPlaceholder,
|
|
351
|
+
},
|
|
352
|
+
} = item || {};
|
|
353
|
+
if (type === 'text') {
|
|
354
|
+
return (
|
|
355
|
+
<div
|
|
356
|
+
className="message-pop align-left"
|
|
357
|
+
style={{
|
|
358
|
+
background: CAP_WHITE,
|
|
359
|
+
color: FONT_COLOR_01,
|
|
360
|
+
borderRadius: 8,
|
|
361
|
+
position: 'static',
|
|
362
|
+
margin: '6px 0 20px 28px',
|
|
363
|
+
height: 'auto'
|
|
364
|
+
}}
|
|
365
|
+
>
|
|
366
|
+
<p style={{ marginBottom: 5 }}>{messageContent || ''}</p>
|
|
367
|
+
</div>
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
if ((type === 'image' && previewImageUrl)) {
|
|
371
|
+
return (
|
|
372
|
+
<div
|
|
373
|
+
className="message-pop align-left"
|
|
374
|
+
style={{
|
|
375
|
+
background: CAP_G08,
|
|
376
|
+
color: FONT_COLOR_01,
|
|
377
|
+
borderRadius: 8,
|
|
378
|
+
position: 'static',
|
|
379
|
+
margin: '6px 0 20px 28px',
|
|
380
|
+
height: 184,
|
|
381
|
+
display: 'flex',
|
|
382
|
+
justifyContent: 'center',
|
|
383
|
+
alignItems: 'center',
|
|
384
|
+
}}
|
|
385
|
+
>
|
|
386
|
+
<CapImage
|
|
387
|
+
src={previewImageUrl}
|
|
388
|
+
alt="brand-name"
|
|
389
|
+
rest={{
|
|
390
|
+
style: {
|
|
391
|
+
maxWidth: '100%',
|
|
392
|
+
marginBottom: 5,
|
|
393
|
+
},
|
|
394
|
+
}}
|
|
395
|
+
/>
|
|
396
|
+
</div>
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
if ((type === 'imageMap' && baseUrl)) {
|
|
400
|
+
return (
|
|
401
|
+
<div
|
|
402
|
+
className="message-pop align-left"
|
|
403
|
+
style={{
|
|
404
|
+
background: CAP_G08,
|
|
405
|
+
color: FONT_COLOR_01,
|
|
406
|
+
borderRadius: 8,
|
|
407
|
+
position: 'static',
|
|
408
|
+
margin: '6px 0 20px 28px',
|
|
409
|
+
height: 184,
|
|
410
|
+
display: 'flex',
|
|
411
|
+
justifyContent: 'center',
|
|
412
|
+
alignItems: 'center',
|
|
413
|
+
}}
|
|
414
|
+
>
|
|
415
|
+
<CapImage
|
|
416
|
+
src={baseUrl ? `${baseUrl}/1040` : lineImgPlaceholder}
|
|
417
|
+
alt="brand-name"
|
|
418
|
+
rest={{
|
|
419
|
+
style: {
|
|
420
|
+
maxWidth: '100%',
|
|
421
|
+
marginBottom: 5,
|
|
422
|
+
},
|
|
423
|
+
}}
|
|
424
|
+
/>
|
|
425
|
+
</div>
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
if (type === 'sticker' && selectedSticker) {
|
|
429
|
+
return (
|
|
430
|
+
<div
|
|
431
|
+
className="message-pop align-left"
|
|
432
|
+
style={{
|
|
433
|
+
background: 'transparent',
|
|
434
|
+
color: FONT_COLOR_01,
|
|
435
|
+
color: FONT_COLOR_01,
|
|
436
|
+
position: 'static',
|
|
437
|
+
margin: '6px 0 20px 28px',
|
|
438
|
+
display: 'flex',
|
|
439
|
+
justifyContent: 'center',
|
|
440
|
+
alignItems: 'center',
|
|
441
|
+
}}
|
|
442
|
+
>
|
|
443
|
+
<CapImage
|
|
444
|
+
src={selectedSticker.stickerUrl}
|
|
445
|
+
style={{maxWidth: '100%', marginBottom: 5 }}
|
|
446
|
+
rest={{
|
|
447
|
+
style: {
|
|
448
|
+
maxWidth: '100%',
|
|
449
|
+
marginBottom: 5,
|
|
450
|
+
},
|
|
451
|
+
height: 70,
|
|
452
|
+
onMouseOut: e => (e.currentTarget.src = selectedSticker.stickerUrl),
|
|
453
|
+
onMouseOver: e => (e.currentTarget.src = selectedSticker.animatedStickerUrl || selectedSticker.stickerUrl),
|
|
454
|
+
}}
|
|
455
|
+
/>
|
|
456
|
+
</div>
|
|
457
|
+
);
|
|
458
|
+
}
|
|
459
|
+
return null;
|
|
460
|
+
})
|
|
461
|
+
}
|
|
462
|
+
</div>
|
|
463
|
+
{this.renderLineMultiText(content)}
|
|
464
|
+
</>
|
|
465
|
+
)
|
|
466
|
+
: (
|
|
467
|
+
<>
|
|
468
|
+
<div className="msgContainer line-preview">
|
|
469
|
+
<div className="sms-icon" style={{ width: '25px', height: '25px', background: '#2E89DF' }}></div>
|
|
470
|
+
<div className="message-pop align-left" style={{ background: '#ffffff', color: '#333333' }}>
|
|
471
|
+
{ (content && content.bodyImage) ? <CapImage src={content.bodyImage} alt="ddd" style={{maxWidth: '100%'}}/> : '' }
|
|
472
|
+
{ (content && content.bodyText) ? content.bodyText : ''}
|
|
473
|
+
</div>
|
|
474
|
+
</div>
|
|
475
|
+
{ (content && content.bodyText) ? <p style={{fontSize: 16, fontWeight: "bold"}}>Chars Count: {content.bodyText.length} / (1600)</p> : '' }
|
|
476
|
+
</>
|
|
477
|
+
)
|
|
478
|
+
}
|
|
479
|
+
|
|
303
480
|
</div>
|
|
304
481
|
) : ''
|
|
305
482
|
}
|
package/index.js
CHANGED
|
@@ -56,9 +56,9 @@ import mobilepushEditReducer from './v2Containers/MobilePush/Edit/reducer';
|
|
|
56
56
|
import mobilepushEditSaga from './v2Containers/MobilePush/Edit/sagas';
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
import LineCreate from './v2Containers/Line/
|
|
60
|
-
import lineCreateReducer from './v2Containers/Line/
|
|
61
|
-
import lineCreateSaga from './v2Containers/Line/
|
|
59
|
+
import LineCreate from './v2Containers/Line/Container';
|
|
60
|
+
import lineCreateReducer from './v2Containers/Line/Container/reducer';
|
|
61
|
+
import lineCreateSaga from './v2Containers/Line/Container/sagas';
|
|
62
62
|
|
|
63
63
|
import LineEdit from './v2Containers/Line/Edit';
|
|
64
64
|
import lineEditReducer from './v2Containers/Line/Edit/reducer';
|
package/package.json
CHANGED
package/routes.js
CHANGED
|
@@ -630,8 +630,8 @@ export default function createRoutes(store) {
|
|
|
630
630
|
import('v2Containers/Assets/Gallery/sagas'),
|
|
631
631
|
import('v2Containers/Facebook/sagas'),
|
|
632
632
|
import('v2Containers/Facebook/reducer'),
|
|
633
|
-
import('v2Containers/Line/
|
|
634
|
-
import('v2Containers/Line/
|
|
633
|
+
import('v2Containers/Line/Container/sagas'),
|
|
634
|
+
import('v2Containers/Line/Container/reducer'),
|
|
635
635
|
]);
|
|
636
636
|
|
|
637
637
|
const renderRoute = loadModule(cb);
|
package/services/api.js
CHANGED
|
@@ -368,3 +368,6 @@ export const getMarketingObjectives = (channel) =>
|
|
|
368
368
|
`${CAMPAIGNS_API_ENDPOINT}/socialObjectives?channel=${channel}`,
|
|
369
369
|
getAPICallObject('GET', null, false, true),
|
|
370
370
|
);
|
|
371
|
+
|
|
372
|
+
export const getAllLineStickers = () =>
|
|
373
|
+
request(`${API_ENDPOINT}/meta/sticker`, getAPICallObject('GET'))
|