@capillarytech/creatives-library 6.11.6 → 6.11.8
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/rich-video-placeholder.svg +20 -0
- package/components/TemplatePreview/_templatePreview.scss +14 -0
- package/components/TemplatePreview/index.js +83 -3
- package/components/TemplatePreview/messages.js +8 -0
- package/index.js +0 -5
- package/package.json +3 -3
- package/services/getSchema.js +0 -3
- package/v2Components/BeeEditor/index.js +263 -0
- package/v2Components/BeeEditor/index.scss +11 -0
- package/v2Components/BeeEditor/messages.js +71 -0
- package/v2Components/BeeEditor/tests/index.test.js +10 -0
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +151 -151
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +33 -33
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/tests/index.test.js +10 -10
- package/v2Components/TemplatePreview/_templatePreview.scss +14 -0
- package/v2Components/TemplatePreview/assets/images/androidPushMessage.svg +44 -44
- package/v2Components/TemplatePreview/assets/images/home-screen-android.svg +21 -21
- package/v2Components/TemplatePreview/assets/images/home-screen-ios.svg +16 -16
- package/v2Components/TemplatePreview/assets/images/iPhonePushMessage.svg +134 -134
- package/v2Components/TemplatePreview/assets/images/mobile.svg +23 -23
- package/v2Components/TemplatePreview/assets/images/sms_mobile_android.svg +22 -22
- package/v2Components/TemplatePreview/assets/images/user-icon.svg +18 -18
- package/v2Components/TemplatePreview/assets/images/wechat-home-screen-android.svg +21 -21
- package/v2Components/TemplatePreview/assets/images/wechat-mobile.svg +77 -77
- package/v2Components/TemplatePreview/assets/images/wechat_mobile_android.svg +20 -20
- package/v2Components/TemplatePreview/index.js +81 -2
- package/v2Components/TemplatePreview/messages.js +8 -0
- package/v2Components/TemplatePreview/tests/index.test.js +10 -10
- package/v2Containers/CreativesContainer/SlideBoxContent.js +11 -0
- package/v2Containers/CreativesContainer/actions.js +27 -27
- package/v2Containers/CreativesContainer/constants.js +17 -17
- package/v2Containers/CreativesContainer/index.scss +44 -44
- package/v2Containers/CreativesContainer/messages.js +305 -305
- package/v2Containers/CreativesContainer/reducer.js +29 -29
- package/v2Containers/CreativesContainer/sagas.js +11 -11
- package/v2Containers/CreativesContainer/selectors.js +30 -30
- package/v2Containers/CreativesContainer/tests/actions.test.js +18 -18
- package/v2Containers/CreativesContainer/tests/index.test.js +10 -10
- package/v2Containers/CreativesContainer/tests/reducer.test.js +9 -9
- package/v2Containers/CreativesContainer/tests/sagas.test.js +15 -15
- package/v2Containers/CreativesContainer/tests/selectors.test.js +10 -10
- package/v2Containers/Line/Container/ImageMap/index.js +2 -1
- package/v2Containers/Line/Container/Video/constants.js +10 -0
- package/v2Containers/Line/Container/Video/index.js +768 -0
- package/v2Containers/Line/Container/Video/messages.js +142 -0
- package/v2Containers/Line/Container/Video/style.js +61 -0
- package/v2Containers/Line/Container/Wrapper/index.js +2 -0
- package/v2Containers/Line/Container/Wrapper/messages.js +4 -0
- package/v2Containers/Line/Container/Wrapper/utils.js +8 -3
- package/v2Containers/Line/Container/constants.js +2 -0
- package/v2Containers/Line/Container/index.js +109 -2
- package/v2Containers/Line/Container/messages.js +4 -0
- package/v2Containers/Templates/index.js +15 -1
- package/v2Containers/Templates/messages.js +4 -0
- package/v2Containers/Templates/tests/actions.test.js +18 -18
- package/v2Containers/Templates/tests/index.test.js +10 -10
- package/v2Containers/Templates/tests/reducer.test.js +9 -9
- package/v2Containers/Templates/tests/sagas.test.js +15 -15
- package/v2Containers/Templates/tests/selectors.test.js +10 -10
- package/v2Containers/TemplatesV2/TemplatesV2.style.js +29 -29
- package/v2Containers/TemplatesV2/actions.js +16 -16
- package/v2Containers/TemplatesV2/constants.js +10 -10
- package/v2Containers/TemplatesV2/messages.js +61 -61
- package/v2Containers/TemplatesV2/selectors.js +25 -25
- package/v2Containers/TemplatesV2/tests/actions.test.js +18 -18
- package/v2Containers/TemplatesV2/tests/index.test.js +10 -10
- package/v2Containers/TemplatesV2/tests/reducer.test.js +9 -9
- package/v2Containers/TemplatesV2/tests/sagas.test.js +15 -15
- package/v2Containers/TemplatesV2/tests/selectors.test.js +10 -10
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* LineVideo Messages
|
|
3
|
+
*
|
|
4
|
+
* This contains all the text for the LineVideo component.
|
|
5
|
+
*/
|
|
6
|
+
import { defineMessages } from 'react-intl';
|
|
7
|
+
const scope = `creatives.containersV2.LineVideo`;
|
|
8
|
+
|
|
9
|
+
export default defineMessages({
|
|
10
|
+
"textMessageAddLabel": {
|
|
11
|
+
id: `${scope}.textMessageAddLabel`,
|
|
12
|
+
defaultMessage: 'How do you want to upload the image?',
|
|
13
|
+
},
|
|
14
|
+
"textMessageCreateNew": {
|
|
15
|
+
id: `${scope}.textMessageCreateNew`,
|
|
16
|
+
defaultMessage: 'Create new',
|
|
17
|
+
},
|
|
18
|
+
"textMessageSelectTemplate": {
|
|
19
|
+
id: `${scope}.textMessageSelectTemplate`,
|
|
20
|
+
defaultMessage: 'Select template',
|
|
21
|
+
},
|
|
22
|
+
"textMessageORLabel": {
|
|
23
|
+
id: `${scope}.textMessageORLabel`,
|
|
24
|
+
defaultMessage: 'OR',
|
|
25
|
+
},
|
|
26
|
+
"textMessageTitlePlaceholder": {
|
|
27
|
+
id: `${scope}.textMessageTitlePlaceholder`,
|
|
28
|
+
defaultMessage: 'Enter template name',
|
|
29
|
+
},
|
|
30
|
+
"textMessageTitleLabel": {
|
|
31
|
+
id: `${scope}.textMessageTitleLabel`,
|
|
32
|
+
defaultMessage: 'Template name',
|
|
33
|
+
},
|
|
34
|
+
"emptyTitleErrorMessage": {
|
|
35
|
+
id: `${scope}.emptyTitleErrorMessage`,
|
|
36
|
+
defaultMessage: 'Template title can not be empty',
|
|
37
|
+
},
|
|
38
|
+
"videoFormatDescription": {
|
|
39
|
+
id: `${scope}.videoFormatDescription`,
|
|
40
|
+
defaultMessage: 'File formats: MP4',
|
|
41
|
+
},
|
|
42
|
+
videoSizeDescription: {
|
|
43
|
+
id: `${scope}.videoSizeDescription`,
|
|
44
|
+
defaultMessage: 'File size: Up to 200 MB',
|
|
45
|
+
},
|
|
46
|
+
"imageReUpload": {
|
|
47
|
+
id: `${scope}.imageReUpload`,
|
|
48
|
+
defaultMessage: 'Re upload',
|
|
49
|
+
},
|
|
50
|
+
"uploadGallery": {
|
|
51
|
+
id: `${scope}.uploadGallery`,
|
|
52
|
+
defaultMessage: 'Gallery',
|
|
53
|
+
},
|
|
54
|
+
"uploadComputer": {
|
|
55
|
+
id: `${scope}.uploadComputer`,
|
|
56
|
+
defaultMessage: 'Your computer',
|
|
57
|
+
},
|
|
58
|
+
"or": {
|
|
59
|
+
id: `${scope}.or`,
|
|
60
|
+
defaultMessage: 'OR',
|
|
61
|
+
},
|
|
62
|
+
"dragAndDrop": {
|
|
63
|
+
id: `${scope}.dragAndDrop`,
|
|
64
|
+
defaultMessage: 'Drag and drop video here',
|
|
65
|
+
},
|
|
66
|
+
"lineVideoIncorrectSize": {
|
|
67
|
+
id: `${scope}.lineVideoIncorrectSize`,
|
|
68
|
+
defaultMessage: 'This file format/size is not supported.',
|
|
69
|
+
},
|
|
70
|
+
"imageGallery": {
|
|
71
|
+
id: `${scope}.imageGallery`,
|
|
72
|
+
defaultMessage: 'Gallery',
|
|
73
|
+
},
|
|
74
|
+
"uploadVideoLabel": {
|
|
75
|
+
id: `${scope}.uploadVideoLabel`,
|
|
76
|
+
defaultMessage: 'Upload Video',
|
|
77
|
+
},
|
|
78
|
+
"select": {
|
|
79
|
+
id: `${scope}.select`,
|
|
80
|
+
defaultMessage: 'Select',
|
|
81
|
+
},
|
|
82
|
+
"lineTemplateImage": {
|
|
83
|
+
id: `${scope}.lineTemplateImage`,
|
|
84
|
+
defaultMessage: 'Line templates - Image',
|
|
85
|
+
},
|
|
86
|
+
"searchImages": {
|
|
87
|
+
id: `${scope}.searchImages`,
|
|
88
|
+
defaultMessage: 'Search Images',
|
|
89
|
+
},
|
|
90
|
+
"emptyAltTextErrorMessage": {
|
|
91
|
+
id: `${scope}.emptyAltTextErrorMessage`,
|
|
92
|
+
defaultMessage: 'Title can not be empty',
|
|
93
|
+
},
|
|
94
|
+
"titleLabel": {
|
|
95
|
+
id: `${scope}.titleLabel`,
|
|
96
|
+
defaultMessage: 'Title',
|
|
97
|
+
},
|
|
98
|
+
"titleDescription": {
|
|
99
|
+
id: `${scope}.titleDescription`,
|
|
100
|
+
defaultMessage: 'The title is shown in push notifications and in the user\'s chat list.',
|
|
101
|
+
},
|
|
102
|
+
actionLabelPlaceholder: {
|
|
103
|
+
id: `${scope}.actionLabelPlaceholder`,
|
|
104
|
+
defaultMessage: 'Enter Label',
|
|
105
|
+
},
|
|
106
|
+
actionLabelTitle: {
|
|
107
|
+
id: `${scope}.actionLabelTitle`,
|
|
108
|
+
defaultMessage: 'Action button label',
|
|
109
|
+
},
|
|
110
|
+
actionLabelInductiveTitle: {
|
|
111
|
+
id: `${scope}.actionLabelInductiveTitle`,
|
|
112
|
+
defaultMessage: 'Make your own action button label',
|
|
113
|
+
},
|
|
114
|
+
"maxActionLabelErrorMessage": {
|
|
115
|
+
id: `${scope}.maxActionLabelErrorMessage`,
|
|
116
|
+
defaultMessage: 'Action label can not be more than 20 character',
|
|
117
|
+
},
|
|
118
|
+
"emptyLabelErrorMessage": {
|
|
119
|
+
id: `${scope}.emptyLabelErrorMessage`,
|
|
120
|
+
defaultMessage: 'Action label can not be more empty',
|
|
121
|
+
},
|
|
122
|
+
actionUrlPlaceholder: {
|
|
123
|
+
id: `${scope}.actionUrlPlaceholder`,
|
|
124
|
+
defaultMessage: 'Enter URL',
|
|
125
|
+
},
|
|
126
|
+
actionUrlTitle: {
|
|
127
|
+
id: `${scope}.actionUrlTitle`,
|
|
128
|
+
defaultMessage: 'Link Url',
|
|
129
|
+
},
|
|
130
|
+
emptyUrlErrorMessage: {
|
|
131
|
+
id: `${scope}.emptyUrlErrorMessage`,
|
|
132
|
+
defaultMessage: 'Action URL can not be more empty',
|
|
133
|
+
},
|
|
134
|
+
actionButtonLabel: {
|
|
135
|
+
id: `${scope}.actionButtonLabel`,
|
|
136
|
+
defaultMessage: 'Action button',
|
|
137
|
+
},
|
|
138
|
+
inValidUrlErrorMessage: {
|
|
139
|
+
id: `${scope}.inValidUrlErrorMessage`,
|
|
140
|
+
defaultMessage: 'Action url is not valid',
|
|
141
|
+
},
|
|
142
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { css } from 'styled-components';
|
|
2
|
+
import {
|
|
3
|
+
CAP_SPACE_20,
|
|
4
|
+
CAP_G10,
|
|
5
|
+
CAP_G06,
|
|
6
|
+
CAP_SPACE_16,
|
|
7
|
+
CAP_SPACE_24,
|
|
8
|
+
FONT_COLOR_02,
|
|
9
|
+
FONT_SIZE_M,
|
|
10
|
+
} from '@capillarytech/cap-ui-library/styled/variables';
|
|
11
|
+
|
|
12
|
+
export default css`
|
|
13
|
+
padding: 0 ${CAP_SPACE_16} ${CAP_SPACE_16};
|
|
14
|
+
position: relative;
|
|
15
|
+
|
|
16
|
+
.image-container {
|
|
17
|
+
background-color: ${CAP_G06};
|
|
18
|
+
margin-top: ${CAP_SPACE_20};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.choice-title {
|
|
22
|
+
margin-bottom: ${CAP_SPACE_24};
|
|
23
|
+
color: ${FONT_COLOR_02};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ant-radio-group {
|
|
27
|
+
margin-bottom: ${CAP_SPACE_24};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.video-description {
|
|
31
|
+
span:nth-child(2) {
|
|
32
|
+
float: right;
|
|
33
|
+
}
|
|
34
|
+
margin-bottom: ${CAP_SPACE_24};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.form-builder-dragger {
|
|
38
|
+
.ant-upload-drag {
|
|
39
|
+
background-color: ${CAP_G10};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.action-label-section {
|
|
44
|
+
.component-with-label-label {
|
|
45
|
+
font-size: ${FONT_SIZE_M};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.action-url-section {
|
|
50
|
+
margin-bottom: ${CAP_SPACE_20};
|
|
51
|
+
}
|
|
52
|
+
.action-url-section,
|
|
53
|
+
.action-label-section {
|
|
54
|
+
padding-left: ${CAP_SPACE_24};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.line-image-src {
|
|
58
|
+
width: 230px;
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
61
|
+
|
|
@@ -49,6 +49,7 @@ export const LineWrapper = ({
|
|
|
49
49
|
selectedTemplate,
|
|
50
50
|
template,
|
|
51
51
|
altText,
|
|
52
|
+
videoSrc,
|
|
52
53
|
} = content;
|
|
53
54
|
|
|
54
55
|
const isTouched = (
|
|
@@ -65,6 +66,7 @@ export const LineWrapper = ({
|
|
|
65
66
|
|| selectedTemplate
|
|
66
67
|
|| template
|
|
67
68
|
|| altText
|
|
69
|
+
|| videoSrc
|
|
68
70
|
);
|
|
69
71
|
if (!isTouched) {
|
|
70
72
|
updateActiveKey(type);
|
|
@@ -2,12 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import CapIcon from '@capillarytech/cap-ui-library/CapIcon';
|
|
3
3
|
import CapTooltip from '@capillarytech/cap-ui-library/CapTooltip';
|
|
4
4
|
|
|
5
|
-
import { TEXT, IMAGE, IMAGE_MAP, STICKER, IMAGE_CAROUSEL, TEMPLATE } from '../constants';
|
|
5
|
+
import { TEXT, IMAGE, IMAGE_MAP, STICKER, IMAGE_CAROUSEL, TEMPLATE, VIDEO } from '../constants';
|
|
6
6
|
import LineText from '../Text';
|
|
7
7
|
import LineImage from '../Image';
|
|
8
8
|
import LineSticker from '../Sticker';
|
|
9
9
|
import LineImageMap from '../ImageMap';
|
|
10
10
|
import LineImageCarousel from '../ImageCarousel';
|
|
11
|
+
import LineVideo from '../Video';
|
|
11
12
|
import messages from './messages';
|
|
12
13
|
|
|
13
14
|
export const getTabContent = ({ item, props }) => {
|
|
@@ -27,6 +28,9 @@ export const getTabContent = ({ item, props }) => {
|
|
|
27
28
|
case TEMPLATE: {
|
|
28
29
|
return <LineImageCarousel {...props} />;
|
|
29
30
|
}
|
|
31
|
+
case VIDEO: {
|
|
32
|
+
return <LineVideo {...props} />;
|
|
33
|
+
}
|
|
30
34
|
}
|
|
31
35
|
};
|
|
32
36
|
|
|
@@ -36,12 +40,13 @@ export const itemIcons = {
|
|
|
36
40
|
[STICKER]: 'smiley-message',
|
|
37
41
|
[IMAGE_MAP]: 'rich-message',
|
|
38
42
|
[TEMPLATE]: 'carousel-message',
|
|
43
|
+
[VIDEO]: 'rich-video-message',
|
|
39
44
|
};
|
|
40
45
|
|
|
41
46
|
|
|
42
47
|
export const getTabPanes = (props) => {
|
|
43
|
-
const tableKeys = [TEXT, IMAGE, STICKER, IMAGE_MAP, TEMPLATE];
|
|
44
|
-
const tableKeysCreatives = [TEXT, IMAGE, IMAGE_MAP, TEMPLATE];
|
|
48
|
+
const tableKeys = [TEXT, IMAGE, STICKER, IMAGE_MAP, TEMPLATE, VIDEO];
|
|
49
|
+
const tableKeysCreatives = [TEXT, IMAGE, IMAGE_MAP, TEMPLATE, VIDEO];
|
|
45
50
|
return (props.isFullMode ? tableKeysCreatives : tableKeys).map((item) => {
|
|
46
51
|
const isSelected = props.activeKey === item;
|
|
47
52
|
return {
|
|
@@ -4,9 +4,11 @@ export const IMAGE = 'image';
|
|
|
4
4
|
export const IMAGE_MAP = 'imagemap';
|
|
5
5
|
export const IMAGE_CAROUSEL = 'image_carousel';
|
|
6
6
|
export const TEMPLATE = 'template';
|
|
7
|
+
export const VIDEO = 'video';
|
|
7
8
|
export const MAX_LINE_WRAPPER_LIMIT = 5;
|
|
8
9
|
export const MAX_LINE_WRAPPER_LIMIT_FULL_MODE = 1;
|
|
9
10
|
export const IMAGE_MAP_CAMEL_CASE = 'imageMap';
|
|
11
|
+
export const DEFAULT_VIDEO_URI = window.location.href;
|
|
10
12
|
|
|
11
13
|
/*
|
|
12
14
|
*
|
|
@@ -22,7 +22,7 @@ import { TRACK_CREATE_LINE, TRACK_EDIT_LINE } from '../../App/constants';
|
|
|
22
22
|
|
|
23
23
|
import LineWrapper from './Wrapper';
|
|
24
24
|
import messages from './messages';
|
|
25
|
-
import { TEXT, IMAGE, IMAGE_MAP, IMAGE_CAROUSEL, MAX_LINE_WRAPPER_LIMIT, MAX_LINE_WRAPPER_LIMIT_FULL_MODE } from './constants';
|
|
25
|
+
import { TEXT, IMAGE, IMAGE_MAP, IMAGE_CAROUSEL, MAX_LINE_WRAPPER_LIMIT, MAX_LINE_WRAPPER_LIMIT_FULL_MODE, DEFAULT_VIDEO_URI } from './constants';
|
|
26
26
|
import { FONT_COLOR_05 } from '@capillarytech/cap-ui-library/styled/variables';
|
|
27
27
|
|
|
28
28
|
import { makeSelectMetaEntities, setInjectedTags } from '../../Cap/selectors';
|
|
@@ -114,6 +114,9 @@ export const LineContainer = ({
|
|
|
114
114
|
const assetType = get(Line, 'templateDetails.assetType');
|
|
115
115
|
const actionLinks = get(Line, 'templateDetails.actionLinks');
|
|
116
116
|
const template = get(Line, `templateDetails.versions.base.content.messages.0.template`);
|
|
117
|
+
const video = get(Line, `templateDetails.versions.base.content.messages.0.video`);
|
|
118
|
+
const videoName = get(Line, `templateDetails.versions.base.content.messages.0.videoName`);
|
|
119
|
+
const videoDuration = get(Line, `templateDetails.versions.base.content.messages.0.videoDuration`);
|
|
117
120
|
const lineContent = {
|
|
118
121
|
type,
|
|
119
122
|
messageContent,
|
|
@@ -133,6 +136,9 @@ export const LineContainer = ({
|
|
|
133
136
|
baseSize,
|
|
134
137
|
template,
|
|
135
138
|
altText,
|
|
139
|
+
video,
|
|
140
|
+
videoName,
|
|
141
|
+
videoDuration,
|
|
136
142
|
};
|
|
137
143
|
updateLineWrapperContent([lineContent]);
|
|
138
144
|
}
|
|
@@ -159,6 +165,9 @@ export const LineContainer = ({
|
|
|
159
165
|
selectedTemplate,
|
|
160
166
|
template,
|
|
161
167
|
altText,
|
|
168
|
+
video,
|
|
169
|
+
videoName,
|
|
170
|
+
videoDuration,
|
|
162
171
|
}) => {
|
|
163
172
|
const obj = {
|
|
164
173
|
type,
|
|
@@ -173,6 +182,9 @@ export const LineContainer = ({
|
|
|
173
182
|
selectedTemplate,
|
|
174
183
|
template,
|
|
175
184
|
altText,
|
|
185
|
+
video,
|
|
186
|
+
videoName,
|
|
187
|
+
videoDuration,
|
|
176
188
|
};
|
|
177
189
|
if (stickerUrl) {
|
|
178
190
|
obj.selectedSticker = {
|
|
@@ -182,6 +194,9 @@ export const LineContainer = ({
|
|
|
182
194
|
packageId: `${packageId}`,
|
|
183
195
|
};
|
|
184
196
|
}
|
|
197
|
+
if (video) {
|
|
198
|
+
obj.type = 'video';
|
|
199
|
+
}
|
|
185
200
|
lineContent.push(obj);
|
|
186
201
|
});
|
|
187
202
|
updateLineWrapperContent(lineContent);
|
|
@@ -337,6 +352,12 @@ export const LineContainer = ({
|
|
|
337
352
|
actionLinks,
|
|
338
353
|
template,
|
|
339
354
|
altText,
|
|
355
|
+
videoSrc,
|
|
356
|
+
videoName,
|
|
357
|
+
actionLabel,
|
|
358
|
+
actionUrl,
|
|
359
|
+
videoHeight,
|
|
360
|
+
videoWidth,
|
|
340
361
|
} = {}] = lineWrapperContents;
|
|
341
362
|
let messageData = { type };
|
|
342
363
|
messageData[messageType] = messageContent;
|
|
@@ -363,6 +384,43 @@ export const LineContainer = ({
|
|
|
363
384
|
messageData.template = template;
|
|
364
385
|
messageData.altText = altText;
|
|
365
386
|
}
|
|
387
|
+
if (videoSrc) {
|
|
388
|
+
delete messageData.previewImageUrl;
|
|
389
|
+
messageData.type = 'imagemap';
|
|
390
|
+
messageData.altText = altText;
|
|
391
|
+
messageData.baseSize = {
|
|
392
|
+
height: videoHeight,
|
|
393
|
+
width: videoWidth,
|
|
394
|
+
};
|
|
395
|
+
messageData.actions = [{
|
|
396
|
+
type: 'uri',
|
|
397
|
+
linkUri: actionUrl || DEFAULT_VIDEO_URI,
|
|
398
|
+
area: {
|
|
399
|
+
height: 1,
|
|
400
|
+
width: 1,
|
|
401
|
+
x: 0,
|
|
402
|
+
y: 0,
|
|
403
|
+
},
|
|
404
|
+
}];
|
|
405
|
+
messageData.baseUrl = previewImageUrl.replace('/1040', '');
|
|
406
|
+
messageData.video = {
|
|
407
|
+
area: {
|
|
408
|
+
x: 0,
|
|
409
|
+
y: 0,
|
|
410
|
+
height: videoHeight,
|
|
411
|
+
width: videoWidth,
|
|
412
|
+
},
|
|
413
|
+
originalContentUrl: videoSrc,
|
|
414
|
+
previewImageUrl,
|
|
415
|
+
};
|
|
416
|
+
if (actionLabel) {
|
|
417
|
+
messageData.video.externalLink = {
|
|
418
|
+
label: actionLabel,
|
|
419
|
+
linkUri: actionUrl,
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
messageData.videoName = videoName;
|
|
423
|
+
}
|
|
366
424
|
return {
|
|
367
425
|
versions: {
|
|
368
426
|
base: {
|
|
@@ -398,6 +456,12 @@ export const LineContainer = ({
|
|
|
398
456
|
actionLinks,
|
|
399
457
|
template,
|
|
400
458
|
altText,
|
|
459
|
+
videoSrc,
|
|
460
|
+
videoName,
|
|
461
|
+
actionLabel,
|
|
462
|
+
actionUrl,
|
|
463
|
+
videoHeight,
|
|
464
|
+
videoWidth,
|
|
401
465
|
}) => {
|
|
402
466
|
let messageData = { type };
|
|
403
467
|
messageData[messageType] = messageContent;
|
|
@@ -425,6 +489,43 @@ export const LineContainer = ({
|
|
|
425
489
|
messageData.template = template;
|
|
426
490
|
messageData.altText = altText;
|
|
427
491
|
}
|
|
492
|
+
if (videoSrc) {
|
|
493
|
+
delete messageData.previewImageUrl;
|
|
494
|
+
messageData.type = 'imagemap';
|
|
495
|
+
messageData.altText = altText;
|
|
496
|
+
messageData.baseSize = {
|
|
497
|
+
height: videoHeight,
|
|
498
|
+
width: videoWidth,
|
|
499
|
+
};
|
|
500
|
+
messageData.actions = [{
|
|
501
|
+
type: 'uri',
|
|
502
|
+
linkUri: actionUrl || DEFAULT_VIDEO_URI,
|
|
503
|
+
area: {
|
|
504
|
+
height: 1,
|
|
505
|
+
width: 1,
|
|
506
|
+
x: 0,
|
|
507
|
+
y: 0,
|
|
508
|
+
},
|
|
509
|
+
}];
|
|
510
|
+
messageData.baseUrl = previewImageUrl.replace('/1040', '');
|
|
511
|
+
messageData.video = {
|
|
512
|
+
area: {
|
|
513
|
+
x: 0,
|
|
514
|
+
y: 0,
|
|
515
|
+
height: videoHeight,
|
|
516
|
+
width: videoWidth,
|
|
517
|
+
},
|
|
518
|
+
originalContentUrl: videoSrc,
|
|
519
|
+
previewImageUrl,
|
|
520
|
+
};
|
|
521
|
+
if (actionLabel) {
|
|
522
|
+
messageData.video.externalLink = {
|
|
523
|
+
label: actionLabel,
|
|
524
|
+
linkUri: actionUrl,
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
messageData.videoName = videoName;
|
|
528
|
+
}
|
|
428
529
|
return messageData;
|
|
429
530
|
});
|
|
430
531
|
return ({
|
|
@@ -459,12 +560,14 @@ export const LineContainer = ({
|
|
|
459
560
|
|
|
460
561
|
const getPreviewSection = () => {
|
|
461
562
|
const accountName = get(lineData, 'selectedLineAccount.name', '');
|
|
462
|
-
const templateContent = lineWrapperContents.map(({ messageContent, type, previewImageUrl, selectedSticker, baseUrl, template }) => ({
|
|
563
|
+
const templateContent = lineWrapperContents.map(({ messageContent, type, previewImageUrl, selectedSticker, baseUrl, template, videoSrc, actionUrl }) => ({
|
|
463
564
|
messageContent,
|
|
464
565
|
previewImageUrl,
|
|
465
566
|
selectedSticker,
|
|
466
567
|
type,
|
|
467
568
|
baseUrl,
|
|
569
|
+
video: videoSrc,
|
|
570
|
+
actionUrl,
|
|
468
571
|
imageCarousel: get(template, 'columns', [{}]).map(({ imageUrl, action: { label: actionLabel } = {} }) => ({ imageUrl, actionLabel }) ),
|
|
469
572
|
}));
|
|
470
573
|
|
|
@@ -576,6 +679,10 @@ export const LineContainer = ({
|
|
|
576
679
|
<CapSpin spinning={isLoading}>
|
|
577
680
|
<CapRow>
|
|
578
681
|
<CapColumn span={14} style={{ zIndex: 1 }}>
|
|
682
|
+
<CapHeader
|
|
683
|
+
title={formatMessage(messages.lineAccountLabel)}
|
|
684
|
+
size="regular"
|
|
685
|
+
/>
|
|
579
686
|
{getAccountSection()}
|
|
580
687
|
<CapHeader
|
|
581
688
|
title={formatMessage(messages.lineCreativeTitle)}
|
|
@@ -83,6 +83,7 @@ const LINE_FILTERS = {
|
|
|
83
83
|
IMAGE_VIDEO: 'image',
|
|
84
84
|
IMAGE_MAP: 'imagemap',
|
|
85
85
|
IMAGE_CAROUSEL: 'template',
|
|
86
|
+
IMAGE_MAP_VIDEO: 'video',
|
|
86
87
|
};
|
|
87
88
|
|
|
88
89
|
export class Templates extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
@@ -637,11 +638,21 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
637
638
|
animatedStickerUrl = '',
|
|
638
639
|
baseUrl = '',
|
|
639
640
|
template: carouselTemplate,
|
|
641
|
+
video: {
|
|
642
|
+
originalContentUrl: originalVideoContentUrl,
|
|
643
|
+
} = {},
|
|
640
644
|
}] = [{}],
|
|
641
645
|
} = {},
|
|
642
646
|
} = template.versions.base;
|
|
643
647
|
templateData.content = text;
|
|
644
648
|
templateData.url = originalContentUrl || animatedStickerUrl || stickerUrl || (baseUrl ? `${baseUrl}/1040` : '');
|
|
649
|
+
if (originalVideoContentUrl) {
|
|
650
|
+
templateData.content = (
|
|
651
|
+
<video height="279">
|
|
652
|
+
<source src={originalVideoContentUrl} type="video/mp4" />
|
|
653
|
+
</video>
|
|
654
|
+
)
|
|
655
|
+
}
|
|
645
656
|
if (carouselTemplate) {
|
|
646
657
|
const carouselContent = get(carouselTemplate, 'columns', [{}]).map(({ imageUrl, action: { label: actionLabel } = {} }) => ({ imageUrl, actionLabel }) );
|
|
647
658
|
templateData.content = (
|
|
@@ -1813,7 +1824,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1813
1824
|
<CapRadio.CapRadioGroup className="line-filters" defaultValue={lineFilter} onChange={this.setLineFilter}>
|
|
1814
1825
|
{
|
|
1815
1826
|
(() => {
|
|
1816
|
-
const { ALL, TEXT, IMAGE_VIDEO, IMAGE_CAROUSEL, IMAGE_MAP } = LINE_FILTERS;
|
|
1827
|
+
const { ALL, TEXT, IMAGE_VIDEO, IMAGE_CAROUSEL, IMAGE_MAP, IMAGE_MAP_VIDEO } = LINE_FILTERS;
|
|
1817
1828
|
return (
|
|
1818
1829
|
<>
|
|
1819
1830
|
<CapRadio.Button value={ALL}><CapLabel type="label2">
|
|
@@ -1831,6 +1842,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1831
1842
|
<CapRadio.Button value={IMAGE_CAROUSEL}><CapLabel type="label2">
|
|
1832
1843
|
<FormattedMessage {...messages.imageCarouselTemplate} />
|
|
1833
1844
|
</CapLabel></CapRadio.Button>
|
|
1845
|
+
<CapRadio.Button value={IMAGE_MAP_VIDEO}><CapLabel type="label2">
|
|
1846
|
+
<FormattedMessage {...messages.imageMapVideoTemplate} />
|
|
1847
|
+
</CapLabel></CapRadio.Button>
|
|
1834
1848
|
</>
|
|
1835
1849
|
);
|
|
1836
1850
|
})()
|
|
@@ -242,6 +242,10 @@ export default defineMessages({
|
|
|
242
242
|
id: `${scope}.imageMapTemplate`,
|
|
243
243
|
defaultMessage: `Rich message`,
|
|
244
244
|
},
|
|
245
|
+
"imageMapVideoTemplate": {
|
|
246
|
+
id: `${scope}.imageMapVideoTemplate`,
|
|
247
|
+
defaultMessage: `Rich video message`,
|
|
248
|
+
},
|
|
245
249
|
"imageCarouselTemplate": {
|
|
246
250
|
id: `${scope}.imageCarouselTemplate`,
|
|
247
251
|
defaultMessage: `Card message`,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
defaultAction,
|
|
4
|
-
} from '../actions';
|
|
5
|
-
import {
|
|
6
|
-
DEFAULT_ACTION,
|
|
7
|
-
} from '../constants';
|
|
8
|
-
|
|
9
|
-
describe('Templates actions', () => {
|
|
10
|
-
describe('Default Action', () => {
|
|
11
|
-
it('has a type of DEFAULT_ACTION', () => {
|
|
12
|
-
const expected = {
|
|
13
|
-
type: DEFAULT_ACTION,
|
|
14
|
-
};
|
|
15
|
-
expect(defaultAction()).toEqual(expected);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
});
|
|
1
|
+
|
|
2
|
+
import {
|
|
3
|
+
defaultAction,
|
|
4
|
+
} from '../actions';
|
|
5
|
+
import {
|
|
6
|
+
DEFAULT_ACTION,
|
|
7
|
+
} from '../constants';
|
|
8
|
+
|
|
9
|
+
describe('Templates actions', () => {
|
|
10
|
+
describe('Default Action', () => {
|
|
11
|
+
it('has a type of DEFAULT_ACTION', () => {
|
|
12
|
+
const expected = {
|
|
13
|
+
type: DEFAULT_ACTION,
|
|
14
|
+
};
|
|
15
|
+
expect(defaultAction()).toEqual(expected);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// import React from 'react';
|
|
2
|
-
// import { shallow } from 'enzyme';
|
|
3
|
-
|
|
4
|
-
// import { Templates } from '../index';
|
|
5
|
-
|
|
6
|
-
describe('<Templates />', () => {
|
|
7
|
-
it('Expect to have unit tests specified', () => {
|
|
8
|
-
expect(true).toEqual(false);
|
|
9
|
-
});
|
|
10
|
-
});
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
// import { shallow } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
// import { Templates } from '../index';
|
|
5
|
+
|
|
6
|
+
describe('<Templates />', () => {
|
|
7
|
+
it('Expect to have unit tests specified', () => {
|
|
8
|
+
expect(true).toEqual(false);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import { fromJS } from 'immutable';
|
|
3
|
-
import templatesReducer from '../reducer';
|
|
4
|
-
|
|
5
|
-
describe('templatesReducer', () => {
|
|
6
|
-
it('returns the initial state', () => {
|
|
7
|
-
expect(templatesReducer(undefined, {})).toEqual(fromJS({}));
|
|
8
|
-
});
|
|
9
|
-
});
|
|
1
|
+
|
|
2
|
+
import { fromJS } from 'immutable';
|
|
3
|
+
import templatesReducer from '../reducer';
|
|
4
|
+
|
|
5
|
+
describe('templatesReducer', () => {
|
|
6
|
+
it('returns the initial state', () => {
|
|
7
|
+
expect(templatesReducer(undefined, {})).toEqual(fromJS({}));
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Test sagas
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/* eslint-disable redux-saga/yield-effects */
|
|
6
|
-
// import { take, call, put, select } from 'redux-saga/effects';
|
|
7
|
-
// import { defaultSaga } from '../sagas';
|
|
8
|
-
|
|
9
|
-
// const generator = defaultSaga();
|
|
10
|
-
|
|
11
|
-
describe('defaultSaga Saga', () => {
|
|
12
|
-
it('Expect to have unit tests specified', () => {
|
|
13
|
-
expect(true).toEqual(false);
|
|
14
|
-
});
|
|
15
|
-
});
|
|
1
|
+
/**
|
|
2
|
+
* Test sagas
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/* eslint-disable redux-saga/yield-effects */
|
|
6
|
+
// import { take, call, put, select } from 'redux-saga/effects';
|
|
7
|
+
// import { defaultSaga } from '../sagas';
|
|
8
|
+
|
|
9
|
+
// const generator = defaultSaga();
|
|
10
|
+
|
|
11
|
+
describe('defaultSaga Saga', () => {
|
|
12
|
+
it('Expect to have unit tests specified', () => {
|
|
13
|
+
expect(true).toEqual(false);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// import { fromJS } from 'immutable';
|
|
2
|
-
// import { makeSelectTemplatesDomain } from '../selectors';
|
|
3
|
-
|
|
4
|
-
// const selector = makeSelectTemplatesDomain();
|
|
5
|
-
|
|
6
|
-
describe('makeSelectTemplatesDomain', () => {
|
|
7
|
-
it('Expect to have unit tests specified', () => {
|
|
8
|
-
expect(true).toEqual(false);
|
|
9
|
-
});
|
|
10
|
-
});
|
|
1
|
+
// import { fromJS } from 'immutable';
|
|
2
|
+
// import { makeSelectTemplatesDomain } from '../selectors';
|
|
3
|
+
|
|
4
|
+
// const selector = makeSelectTemplatesDomain();
|
|
5
|
+
|
|
6
|
+
describe('makeSelectTemplatesDomain', () => {
|
|
7
|
+
it('Expect to have unit tests specified', () => {
|
|
8
|
+
expect(true).toEqual(false);
|
|
9
|
+
});
|
|
10
|
+
});
|