@capillarytech/creatives-library 6.8.6 → 6.8.7
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/app.js +0 -1
- package/config/app.js +1 -1
- package/package.json +1 -1
- 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 +380 -380
- 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/tests/index.test.js +10 -10
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +51 -51
- 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/Image/constants.js +2 -1
- package/v2Containers/Line/Container/Image/index.js +21 -19
- package/v2Containers/Line/Container/Image/messages.js +1 -1
- package/v2Containers/Line/Container/ImageMap/index.js +1 -1
- package/v2Containers/Line/Container/Wrapper/index.js +3 -3
- package/v2Containers/Line/Container/Wrapper/messages.js +1 -1
- package/v2Containers/Line/Container/Wrapper/utils.js +4 -2
- package/v2Containers/Line/Container/index.js +15 -9
- package/v2Containers/Templates/_templates.scss +405 -405
- package/v2Containers/Templates/actions.js +117 -117
- package/v2Containers/Templates/constants.js +47 -47
- package/v2Containers/Templates/index.js +0 -4
- package/v2Containers/Templates/messages.js +1 -5
- package/v2Containers/Templates/reducer.js +145 -145
- package/v2Containers/Templates/sagas.js +179 -179
- 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
- package/v2Components/TemplatePreview/assets/images/WECHAT_5x.png +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// import { take, call, put, select } from 'redux-saga/effects';
|
|
2
|
-
|
|
3
|
-
// Individual exports for testing
|
|
4
|
-
export function* defaultSaga() {
|
|
5
|
-
// See example in v2Containers/HomePage/sagas.js
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
// All sagas to be loaded
|
|
9
|
-
export default [
|
|
10
|
-
defaultSaga,
|
|
11
|
-
];
|
|
1
|
+
// import { take, call, put, select } from 'redux-saga/effects';
|
|
2
|
+
|
|
3
|
+
// Individual exports for testing
|
|
4
|
+
export function* defaultSaga() {
|
|
5
|
+
// See example in v2Containers/HomePage/sagas.js
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// All sagas to be loaded
|
|
9
|
+
export default [
|
|
10
|
+
defaultSaga,
|
|
11
|
+
];
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { createSelector } from 'reselect';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Direct selector to the creativesContainer state domain
|
|
5
|
-
*/
|
|
6
|
-
const selectCreativesContainerDomain = () => (state) => state.get('creativesContainer');
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Other specific selectors
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Default selector used by CreativesContainer
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
const makeSelectCreativesContainer = () => createSelector(
|
|
18
|
-
selectCreativesContainerDomain(),
|
|
19
|
-
(substate) => substate.toJS()
|
|
20
|
-
);
|
|
21
|
-
const isLoading = () => createSelector(
|
|
22
|
-
makeSelectCreativesContainer(),
|
|
23
|
-
(substate) => substate.containerLoader
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
export default makeSelectCreativesContainer;
|
|
27
|
-
export {
|
|
28
|
-
selectCreativesContainerDomain,
|
|
29
|
-
isLoading,
|
|
30
|
-
};
|
|
1
|
+
import { createSelector } from 'reselect';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Direct selector to the creativesContainer state domain
|
|
5
|
+
*/
|
|
6
|
+
const selectCreativesContainerDomain = () => (state) => state.get('creativesContainer');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Other specific selectors
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Default selector used by CreativesContainer
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const makeSelectCreativesContainer = () => createSelector(
|
|
18
|
+
selectCreativesContainerDomain(),
|
|
19
|
+
(substate) => substate.toJS()
|
|
20
|
+
);
|
|
21
|
+
const isLoading = () => createSelector(
|
|
22
|
+
makeSelectCreativesContainer(),
|
|
23
|
+
(substate) => substate.containerLoader
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export default makeSelectCreativesContainer;
|
|
27
|
+
export {
|
|
28
|
+
selectCreativesContainerDomain,
|
|
29
|
+
isLoading,
|
|
30
|
+
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
defaultAction,
|
|
4
|
-
} from '../actions';
|
|
5
|
-
import {
|
|
6
|
-
DEFAULT_ACTION,
|
|
7
|
-
} from '../constants';
|
|
8
|
-
|
|
9
|
-
describe('CreativesContainer 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('CreativesContainer 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 { CreativesContainer } from '../index';
|
|
5
|
-
|
|
6
|
-
describe('<CreativesContainer />', () => {
|
|
7
|
-
it('Expect to have unit tests specified', () => {
|
|
8
|
-
expect(true).toEqual(true);
|
|
9
|
-
});
|
|
10
|
-
});
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
// import { shallow } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
// import { CreativesContainer } from '../index';
|
|
5
|
+
|
|
6
|
+
describe('<CreativesContainer />', () => {
|
|
7
|
+
it('Expect to have unit tests specified', () => {
|
|
8
|
+
expect(true).toEqual(true);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import { fromJS } from 'immutable';
|
|
3
|
-
import creativesContainerReducer from '../reducer';
|
|
4
|
-
|
|
5
|
-
describe('creativesContainerReducer', () => {
|
|
6
|
-
it('returns the initial state', () => {
|
|
7
|
-
expect(creativesContainerReducer(undefined, {})).toEqual(fromJS({}));
|
|
8
|
-
});
|
|
9
|
-
});
|
|
1
|
+
|
|
2
|
+
import { fromJS } from 'immutable';
|
|
3
|
+
import creativesContainerReducer from '../reducer';
|
|
4
|
+
|
|
5
|
+
describe('creativesContainerReducer', () => {
|
|
6
|
+
it('returns the initial state', () => {
|
|
7
|
+
expect(creativesContainerReducer(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(true);
|
|
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(true);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// import { fromJS } from 'immutable';
|
|
2
|
-
// import { makeSelectCreativesContainerDomain } from '../selectors';
|
|
3
|
-
|
|
4
|
-
// const selector = makeSelectCreativesContainerDomain();
|
|
5
|
-
|
|
6
|
-
describe('makeSelectCreativesContainerDomain', () => {
|
|
7
|
-
it('Expect to have unit tests specified', () => {
|
|
8
|
-
expect(true).toEqual(true);
|
|
9
|
-
});
|
|
10
|
-
});
|
|
1
|
+
// import { fromJS } from 'immutable';
|
|
2
|
+
// import { makeSelectCreativesContainerDomain } from '../selectors';
|
|
3
|
+
|
|
4
|
+
// const selector = makeSelectCreativesContainerDomain();
|
|
5
|
+
|
|
6
|
+
describe('makeSelectCreativesContainerDomain', () => {
|
|
7
|
+
it('Expect to have unit tests specified', () => {
|
|
8
|
+
expect(true).toEqual(true);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -6,12 +6,11 @@ import CapUploader from '@capillarytech/cap-ui-library/CapUploader';
|
|
|
6
6
|
import CapHeading from '@capillarytech/cap-ui-library/CapHeading';
|
|
7
7
|
import CapButton from '@capillarytech/cap-ui-library/CapButton';
|
|
8
8
|
import CapDrawer from '@capillarytech/cap-ui-library/CapDrawer';
|
|
9
|
-
import CapLabel from '@capillarytech/cap-ui-library/CapLabel';
|
|
10
9
|
import CapImage from '@capillarytech/cap-ui-library/CapImage';
|
|
11
10
|
import CapHeader from '@capillarytech/cap-ui-library/CapHeader';
|
|
12
11
|
import LabelHOC from '@capillarytech/cap-ui-library/assets/HOCs/ComponentWithLabelHOC';
|
|
13
12
|
import LineDrawer from '../Drawer';
|
|
14
|
-
import { CAP_SPACE_12, CAP_SPACE_08, FONT_COLOR_05
|
|
13
|
+
import { CAP_SPACE_12, CAP_SPACE_08, FONT_COLOR_05 } from '@capillarytech/cap-ui-library/styled/variables';
|
|
15
14
|
import Gallery from '../../../Assets/Gallery';
|
|
16
15
|
import style from './style';
|
|
17
16
|
import { CAP_G06, CAP_G09 } from '@capillarytech/cap-ui-library/styled/variables';
|
|
@@ -22,6 +21,7 @@ import {
|
|
|
22
21
|
LINE_IMG_HEIGHT,
|
|
23
22
|
LINE_IMG_WIDTH,
|
|
24
23
|
LINE_IMG_SIZE,
|
|
24
|
+
ALLOWED_EXTENSIONS_REGEX,
|
|
25
25
|
} from './constants';
|
|
26
26
|
|
|
27
27
|
export const LineImage = ({
|
|
@@ -168,11 +168,8 @@ export const LineImage = ({
|
|
|
168
168
|
const _URL = window.URL || window.webkitURL;
|
|
169
169
|
let incorrectFile = false;
|
|
170
170
|
const file = files[0];
|
|
171
|
-
if (
|
|
172
|
-
|
|
173
|
-
if (!allowedExtensions.exec(file.name)) {
|
|
174
|
-
incorrectFile = true;
|
|
175
|
-
}
|
|
171
|
+
if (!ALLOWED_EXTENSIONS_REGEX.test(file.name)) {
|
|
172
|
+
incorrectFile = true;
|
|
176
173
|
}
|
|
177
174
|
const img = new Image();
|
|
178
175
|
img.src = _URL.createObjectURL(file);
|
|
@@ -402,18 +399,23 @@ export const LineImage = ({
|
|
|
402
399
|
const image = get(imageTemplate, 'metaInfo.secure_file_path');
|
|
403
400
|
const imagePreview = get(imageTemplate, 'metaInfo.secure_file_path_preview');
|
|
404
401
|
updateDrawerRequirement(false);
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
402
|
+
if (!ALLOWED_EXTENSIONS_REGEX.test(image)) {
|
|
403
|
+
updateImageErrorMessage(formatMessage(messages.lineImageIncorrectSize));
|
|
404
|
+
} else {
|
|
405
|
+
updateImageErrorMessage('');
|
|
406
|
+
updateImageStatus(true);
|
|
407
|
+
updateImageSrc(image);
|
|
408
|
+
updateImagePreview(imagePreview);
|
|
409
|
+
updateMessageState({
|
|
410
|
+
isError: !image || !(isFullMode ? messageTitle : true) || (isImageError && errorMessageTitle),
|
|
411
|
+
originalContentUrl: image,
|
|
412
|
+
previewImageUrl: imagePreview,
|
|
413
|
+
messageTitle,
|
|
414
|
+
index,
|
|
415
|
+
type: 'image',
|
|
416
|
+
messageType: 'originalContentUrl',
|
|
417
|
+
});
|
|
418
|
+
}
|
|
417
419
|
}
|
|
418
420
|
|
|
419
421
|
const getGalleryDrawerContent = () => {
|
|
@@ -37,7 +37,7 @@ export default defineMessages({
|
|
|
37
37
|
},
|
|
38
38
|
"imageDimenstionDescription": {
|
|
39
39
|
id: `${scope}.imageDimenstionDescription`,
|
|
40
|
-
defaultMessage: 'Dimensions: 300px x 400px Size:
|
|
40
|
+
defaultMessage: 'Dimensions: 300px x 400px Size: 10mb',
|
|
41
41
|
},
|
|
42
42
|
"imageReUpload": {
|
|
43
43
|
id: `${scope}.imageReUpload`,
|
|
@@ -435,7 +435,7 @@ export const LineImageMap = ({
|
|
|
435
435
|
}] = [{}],
|
|
436
436
|
} = {},
|
|
437
437
|
} = template.versions.base;
|
|
438
|
-
templateData.url = baseUrl
|
|
438
|
+
templateData.url = `${baseUrl}/1040`;
|
|
439
439
|
templateData.title = template.name;
|
|
440
440
|
templateData.key = template.name;
|
|
441
441
|
templateData.hoverOption = (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
1
|
+
import React, { useState, useEffect, Fragment } from 'react';
|
|
2
2
|
import { injectIntl, FormattedMessage } from 'react-intl';
|
|
3
3
|
import CapTab from '@capillarytech/cap-ui-library/CapTab';
|
|
4
4
|
import CapButton from '@capillarytech/cap-ui-library/CapButton';
|
|
@@ -126,9 +126,9 @@ export const LineWrapper = ({
|
|
|
126
126
|
<CapTab
|
|
127
127
|
defaultActiveKey={TEXT}
|
|
128
128
|
activeKey={activeKey}
|
|
129
|
-
tabBarExtraContent={operations}
|
|
129
|
+
tabBarExtraContent={rest.isFullMode ? <Fragment /> : operations}
|
|
130
130
|
onChange={onTabChange}
|
|
131
|
-
panes={getTabPanes({ ...rest, index, activeKey, formatMessage: intl.formatMessage })}
|
|
131
|
+
panes={getTabPanes({ ...rest, index, activeKey, formatMessage: intl.formatMessage, isFullMode: rest.isFullMode })}
|
|
132
132
|
/>
|
|
133
133
|
<StyledCapModal
|
|
134
134
|
title={intl.formatMessage(messages.changeModalTitle)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
import { CAP_WHITE } from '@capillarytech/cap-ui-library/styled/variables';
|
|
4
|
+
import { CAP_WHITE, FONT_SIZE_VL } from '@capillarytech/cap-ui-library/styled/variables';
|
|
5
5
|
|
|
6
6
|
import { TEXT, IMAGE, IMAGE_MAP, STICKER } from '../constants';
|
|
7
7
|
import LineText from '../Text';
|
|
@@ -37,7 +37,8 @@ export const itemIcons = {
|
|
|
37
37
|
|
|
38
38
|
export const getTabPanes = (props) => {
|
|
39
39
|
const tableKeys = [TEXT, IMAGE, STICKER, IMAGE_MAP];
|
|
40
|
-
|
|
40
|
+
const tableKeysCreatives = [TEXT, IMAGE, IMAGE_MAP];
|
|
41
|
+
return (props.isFullMode ? tableKeysCreatives : tableKeys).map((item) => {
|
|
41
42
|
const isSelected = props.activeKey === item;
|
|
42
43
|
return {
|
|
43
44
|
key: item,
|
|
@@ -48,6 +49,7 @@ export const getTabPanes = (props) => {
|
|
|
48
49
|
<CapIcon
|
|
49
50
|
type={itemIcons[item]}
|
|
50
51
|
size="s"
|
|
52
|
+
style={{ fontSize: FONT_SIZE_VL }}
|
|
51
53
|
theme={isSelected ? 'filled' : ''}
|
|
52
54
|
svgProps={{
|
|
53
55
|
fill: isSelected ? '#000' : CAP_WHITE,
|
|
@@ -544,15 +544,21 @@ export const LineContainer = ({
|
|
|
544
544
|
description={formatMessage(messages.lineCreativeDescription)}
|
|
545
545
|
/>
|
|
546
546
|
{getLineWrappers()}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
547
|
+
{
|
|
548
|
+
!isFullMode
|
|
549
|
+
? (
|
|
550
|
+
<CapButton
|
|
551
|
+
onClick={addLineWrappers}
|
|
552
|
+
disabled={lineWrapperContents.length === (isFullMode ? MAX_LINE_WRAPPER_LIMIT_FULL_MODE : MAX_LINE_WRAPPER_LIMIT)}
|
|
553
|
+
type="flat"
|
|
554
|
+
isAddBtn
|
|
555
|
+
className="add-msg"
|
|
556
|
+
>
|
|
557
|
+
<FormattedMessage {...messages.addMessageButtonLabel} />
|
|
558
|
+
</CapButton>
|
|
559
|
+
)
|
|
560
|
+
: null
|
|
561
|
+
}
|
|
556
562
|
</CapColumn>
|
|
557
563
|
<CapColumn span={6}>
|
|
558
564
|
<CapRow>
|