@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.
Files changed (85) hide show
  1. package/assets/line-image-placeholder.svg +14 -0
  2. package/assets/line.png +0 -0
  3. package/assets/smiley-placeholder.svg +11 -0
  4. package/components/TemplatePreview/index.js +185 -8
  5. package/index.js +3 -3
  6. package/package.json +1 -1
  7. package/routes.js +2 -2
  8. package/services/api.js +3 -0
  9. package/styles/vendor/semantic/src/definitions/modules/accordion.less +219 -219
  10. package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +1 -1
  11. package/v2Components/TemplatePreview/assets/images/WECHAT_5x.png +0 -0
  12. package/v2Components/TemplatePreview/index.js +164 -12
  13. package/v2Components/TemplatePreview/messages.js +8 -0
  14. package/v2Containers/CreativesContainer/SlideBoxContent.js +51 -17
  15. package/v2Containers/CreativesContainer/index.js +23 -17
  16. package/v2Containers/Line/Container/Drawer/index.js +93 -0
  17. package/v2Containers/Line/Container/Image/constants.js +3 -0
  18. package/v2Containers/Line/Container/Image/index.js +460 -0
  19. package/v2Containers/Line/Container/Image/messages.js +86 -0
  20. package/v2Containers/Line/Container/Image/style.js +32 -0
  21. package/v2Containers/Line/Container/ImageMap/assets/hover/custom.png +0 -0
  22. package/v2Containers/Line/Container/ImageMap/assets/hover/templateEight.png +0 -0
  23. package/v2Containers/Line/Container/ImageMap/assets/hover/templateFive.png +0 -0
  24. package/v2Containers/Line/Container/ImageMap/assets/hover/templateFour.png +0 -0
  25. package/v2Containers/Line/Container/ImageMap/assets/hover/templateOne.png +0 -0
  26. package/v2Containers/Line/Container/ImageMap/assets/hover/templateSeven.png +0 -0
  27. package/v2Containers/Line/Container/ImageMap/assets/hover/templateSix.png +0 -0
  28. package/v2Containers/Line/Container/ImageMap/assets/hover/templateThree.png +0 -0
  29. package/v2Containers/Line/Container/ImageMap/assets/hover/templateTwo.png +0 -0
  30. package/v2Containers/Line/Container/ImageMap/assets/selected/custom.png +0 -0
  31. package/v2Containers/Line/Container/ImageMap/assets/selected/templateEight.png +0 -0
  32. package/v2Containers/Line/Container/ImageMap/assets/selected/templateFive.png +0 -0
  33. package/v2Containers/Line/Container/ImageMap/assets/selected/templateFour.png +0 -0
  34. package/v2Containers/Line/Container/ImageMap/assets/selected/templateOne.png +0 -0
  35. package/v2Containers/Line/Container/ImageMap/assets/selected/templateSeven.png +0 -0
  36. package/v2Containers/Line/Container/ImageMap/assets/selected/templateSix.png +0 -0
  37. package/v2Containers/Line/Container/ImageMap/assets/selected/templateThree.png +0 -0
  38. package/v2Containers/Line/Container/ImageMap/assets/selected/templateTwo.png +0 -0
  39. package/v2Containers/Line/Container/ImageMap/assets/templates/custom.png +0 -0
  40. package/v2Containers/Line/Container/ImageMap/assets/templates/templateEight.png +0 -0
  41. package/v2Containers/Line/Container/ImageMap/assets/templates/templateFive.png +0 -0
  42. package/v2Containers/Line/Container/ImageMap/assets/templates/templateFour.png +0 -0
  43. package/v2Containers/Line/Container/ImageMap/assets/templates/templateOne.png +0 -0
  44. package/v2Containers/Line/Container/ImageMap/assets/templates/templateSeven.png +0 -0
  45. package/v2Containers/Line/Container/ImageMap/assets/templates/templateSix.png +0 -0
  46. package/v2Containers/Line/Container/ImageMap/assets/templates/templateThree.png +0 -0
  47. package/v2Containers/Line/Container/ImageMap/assets/templates/templateTwo.png +0 -0
  48. package/v2Containers/Line/Container/ImageMap/assets/templates_with_alphabets/custom.png +0 -0
  49. package/v2Containers/Line/Container/ImageMap/assets/templates_with_alphabets/templateEight.png +0 -0
  50. package/v2Containers/Line/Container/ImageMap/assets/templates_with_alphabets/templateFive.png +0 -0
  51. package/v2Containers/Line/Container/ImageMap/assets/templates_with_alphabets/templateFour.png +0 -0
  52. package/v2Containers/Line/Container/ImageMap/assets/templates_with_alphabets/templateOne.png +0 -0
  53. package/v2Containers/Line/Container/ImageMap/assets/templates_with_alphabets/templateSeven.png +0 -0
  54. package/v2Containers/Line/Container/ImageMap/assets/templates_with_alphabets/templateSix.png +0 -0
  55. package/v2Containers/Line/Container/ImageMap/assets/templates_with_alphabets/templateThree.png +0 -0
  56. package/v2Containers/Line/Container/ImageMap/assets/templates_with_alphabets/templateTwo.png +0 -0
  57. package/v2Containers/Line/Container/ImageMap/constants.js +19 -0
  58. package/v2Containers/Line/Container/ImageMap/index.js +603 -0
  59. package/v2Containers/Line/Container/ImageMap/messages.js +126 -0
  60. package/v2Containers/Line/Container/ImageMap/style.js +94 -0
  61. package/v2Containers/Line/Container/ImageMap/templates.json +195 -0
  62. package/v2Containers/Line/Container/Sticker/index.js +224 -0
  63. package/v2Containers/Line/Container/Sticker/messages.js +34 -0
  64. package/v2Containers/Line/Container/Sticker/style.js +36 -0
  65. package/v2Containers/Line/Container/Sticker/utils.js +68 -0
  66. package/v2Containers/Line/Container/Text/index.js +338 -0
  67. package/v2Containers/Line/Container/Text/messages.js +74 -0
  68. package/v2Containers/Line/Container/Text/style.js +37 -0
  69. package/v2Containers/Line/Container/Wrapper/index.js +152 -0
  70. package/v2Containers/Line/Container/Wrapper/messages.js +46 -0
  71. package/v2Containers/Line/Container/Wrapper/style.js +44 -0
  72. package/v2Containers/Line/Container/Wrapper/utils.js +67 -0
  73. package/v2Containers/Line/Container/_lineCreate.scss +108 -0
  74. package/v2Containers/Line/Container/actions.js +99 -0
  75. package/v2Containers/Line/Container/constants.js +48 -0
  76. package/v2Containers/Line/Container/index.js +581 -0
  77. package/v2Containers/Line/Container/messages.js +66 -0
  78. package/v2Containers/Line/Container/reducer.js +103 -0
  79. package/v2Containers/Line/Container/sagas.js +137 -0
  80. package/v2Containers/Line/Container/selectors.js +30 -0
  81. package/v2Containers/Line/Container/style.js +57 -0
  82. package/v2Containers/Line/Create/index.js +1 -1
  83. package/v2Containers/Templates/index.js +40 -22
  84. package/v2Containers/Templates/messages.js +8 -0
  85. package/v2Containers/TemplatesV2/index.js +13 -0
@@ -0,0 +1,46 @@
1
+ /*
2
+ * LineWrapper Messages
3
+ *
4
+ * This contains all the text for the LineWrapper component.
5
+ */
6
+ import { defineMessages } from 'react-intl';
7
+ const scope = `creatives.containersV2.LineWrapper`;
8
+
9
+ export default defineMessages({
10
+ "changeModalTitle": {
11
+ id: `${scope}.changeModalTitle`,
12
+ defaultMessage: 'Changing content tab?',
13
+ },
14
+ "changeModalDescription": {
15
+ id: `${scope}.changeModalDescription`,
16
+ defaultMessage: 'The already added content for this card will be lost by changing the content tab.',
17
+ },
18
+ "changeModalLabel": {
19
+ id: `${scope}.changeModalLabel`,
20
+ defaultMessage: 'Do you still want to make the changes to content tab',
21
+ },
22
+ "modalSaveChangesButtonLabel": {
23
+ id: `${scope}.modalSaveChangesButtonLabel`,
24
+ defaultMessage: 'Yes, change',
25
+ },
26
+ "modalDiscardChangesButtonLabel": {
27
+ id: `${scope}.modalDiscardChangesButtonLabel`,
28
+ defaultMessage: 'No',
29
+ },
30
+ "stickerLabel": {
31
+ id: `${scope}.stickerLabel`,
32
+ defaultMessage: 'Sticker',
33
+ },
34
+ "textLabel": {
35
+ id: `${scope}.textLabel`,
36
+ defaultMessage: 'Text',
37
+ },
38
+ "imageLabel": {
39
+ id: `${scope}.imageLabel`,
40
+ defaultMessage: 'Image',
41
+ },
42
+ "imagemapLabel": {
43
+ id: `${scope}.imagemapLabel`,
44
+ defaultMessage: 'Image Map',
45
+ },
46
+ });
@@ -0,0 +1,44 @@
1
+ import { css } from 'styled-components';
2
+ import {
3
+ CAP_SPACE_44,
4
+ CAP_SPACE_28,
5
+ CAP_SPACE_20,
6
+ CAP_SPACE_12,
7
+ CAP_SPACE_08,
8
+ CAP_G07,
9
+ CAP_G12,
10
+ CAP_G06,
11
+ FONT_COLOR_05,
12
+ CAP_SPACE_16,
13
+ CAP_SPACE_40,
14
+ FONT_WEIGHT_MEDIUM,
15
+ CAP_SPACE_24,
16
+ } from '@capillarytech/cap-ui-library/styled/variables';
17
+
18
+ export default css`
19
+ max-width: 600px;
20
+ border-radius: 6px;
21
+ border: 1px solid ${CAP_G07};
22
+ margin: 10px 0 14px;
23
+
24
+ .ant-tabs-bar {
25
+ padding: 0 ${CAP_SPACE_24};
26
+ }
27
+ `;
28
+
29
+ export const CapModalStyles = css`
30
+ .ant-modal.cap-modal-v2 {
31
+ max-width: unset;
32
+ }
33
+
34
+ .modal-description {
35
+ margin-top: ${CAP_SPACE_12};
36
+ }
37
+
38
+ .ant-modal.cap-modal-v2 .ant-modal-footer {
39
+ padding-bottom: ${CAP_SPACE_20};
40
+ padding-left: ${CAP_SPACE_24};
41
+ }
42
+ `;
43
+
44
+
@@ -0,0 +1,67 @@
1
+ import React from 'react';
2
+ import CapIcon from '@capillarytech/cap-ui-library/CapIcon';
3
+ import CapTooltip from '@capillarytech/cap-ui-library/CapTooltip';
4
+ import { CAP_WHITE } from '@capillarytech/cap-ui-library/styled/variables';
5
+
6
+ import { TEXT, IMAGE, IMAGE_MAP, STICKER } from '../constants';
7
+ import LineText from '../Text';
8
+ import LineImage from '../Image';
9
+ import LineSticker from '../Sticker';
10
+ import LineImageMap from '../ImageMap';
11
+ import messages from './messages';
12
+
13
+ export const getTabContent = ({ item, props }) => {
14
+ switch (item) {
15
+ case TEXT: {
16
+ return <LineText {...props} />;
17
+ }
18
+ case IMAGE: {
19
+ return <LineImage {...props} />;
20
+ }
21
+ case STICKER: {
22
+ return <LineSticker {...props} />;
23
+ }
24
+ case IMAGE_MAP: {
25
+ return <LineImageMap {...props} />;
26
+ }
27
+ }
28
+ };
29
+
30
+ export const itemIcons = {
31
+ [TEXT]: 'chat-bubble',
32
+ [IMAGE]: 'picture',
33
+ [STICKER]: 'smile',
34
+ [IMAGE_MAP]: 'add-media', // to change
35
+ };
36
+
37
+
38
+ export const getTabPanes = (props) => {
39
+ const tableKeys = [TEXT, IMAGE, STICKER, IMAGE_MAP];
40
+ return tableKeys.map((item) => {
41
+ const isSelected = props.activeKey === item;
42
+ return {
43
+ key: item,
44
+ tab: (
45
+ <CapTooltip
46
+ title={props.formatMessage(messages[`${item}Label`])}
47
+ >
48
+ <CapIcon
49
+ type={itemIcons[item]}
50
+ size="s"
51
+ theme={isSelected ? 'filled' : ''}
52
+ svgProps={{
53
+ fill: isSelected ? '#000' : CAP_WHITE,
54
+ stroke: isSelected ? CAP_WHITE : '#000',
55
+ }}
56
+ />
57
+ </CapTooltip>
58
+ ),
59
+ content: getTabContent({ item, props }),
60
+ }
61
+ });
62
+ };
63
+
64
+ export const isUrl = (url) => {
65
+ const res = url.match(/(http(s)?:\/\/.)(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g);
66
+ return res;
67
+ }
@@ -0,0 +1,108 @@
1
+ @import '~@capillarytech/cap-ui-library/styles/_variables.scss';
2
+
3
+ .line-row{
4
+ margin-bottom: 16px;
5
+ }
6
+ .slidebox-content-container {
7
+ overflow-x: hidden;
8
+ }
9
+ .line-image {
10
+ position: relative;
11
+ }
12
+ .knSUjl .component-wrapper .cap-tab-v2.ant-tabs-line {
13
+ height: auto;
14
+ }
15
+ .pagination-container {
16
+ .LINE {
17
+ .ant-card-body {
18
+ background-color: $CAP_G09;
19
+ height: 320px;
20
+ }
21
+
22
+ &.no-image .ant-card-meta {
23
+ height: 276px;
24
+ background: $CAP_WHITE;
25
+ padding: $CAP_SPACE_16 $CAP_SPACE_12;
26
+
27
+ .ant-card-meta-description {
28
+ height: 250px;
29
+ word-wrap: break-word;
30
+ }
31
+ }
32
+ }
33
+ }
34
+ .create-msg,
35
+ .cancel-msg {
36
+ position: fixed;
37
+ bottom: 20px;
38
+ }
39
+ .cancel-msg {
40
+ margin-left: 120px;
41
+ }
42
+
43
+ .image-container {
44
+ display: flex;
45
+ & > div {
46
+ min-width: 516px;
47
+ }
48
+ border-radius: 5px;
49
+ .image-placeholder{
50
+ line-height: 150px;
51
+ }
52
+ img {
53
+ object-fit: cover;
54
+ max-width: 100%;
55
+ max-height: 100%;
56
+ height: auto !important;
57
+ width: auto !important;
58
+ }
59
+ }
60
+
61
+ .drawer-head {
62
+ padding-bottom: $CAP_SPACE_16;
63
+ padding-left: $CAP_SPACE_24;
64
+ border-bottom: 1px solid rgba(9, 30, 66, 0.25);
65
+ margin-bottom: $CAP_SPACE_16;
66
+ margin-left: -24px;
67
+ min-width: 624px;
68
+ }
69
+
70
+ .search-text {
71
+ margin-bottom: $CAP_SPACE_12;
72
+ }
73
+
74
+ .pagination-container.gallery-upload {
75
+ height: calc(100vh - 60px);
76
+
77
+ .cap-custom-card-list-col {
78
+ max-width: 156px;
79
+ max-height: 156px;
80
+ display: inline-block;
81
+ margin-left: $CAP_SPACE_04;
82
+ margin-right: $CAP_SPACE_04;
83
+ }
84
+
85
+ .ant-card-body {
86
+ padding-top: 0;
87
+
88
+ .ant-card-meta-description img {
89
+ height: 80px;
90
+ width: auto;
91
+ }
92
+ }
93
+ }
94
+
95
+ .gallery-image {
96
+ height: 156px;
97
+ width: 156px;
98
+ border-radius: 4px;
99
+ margin: 3px;
100
+ }
101
+
102
+ .sms-text {
103
+ img {
104
+ display: block;
105
+ max-width: 100%;
106
+ object-fit: cover;
107
+ }
108
+ }
@@ -0,0 +1,99 @@
1
+ /*
2
+ *
3
+ * Create actions
4
+ *
5
+ */
6
+
7
+ import * as types from './constants';
8
+
9
+ export function createTemplate(template, callback) {
10
+ console.log('action trigereed createtemplate');
11
+ return {
12
+ type: types.CREATE_TEMPLATE_REQUEST,
13
+ template,
14
+ callback,
15
+ };
16
+ }
17
+
18
+ export function clearCreateResponse() {
19
+ console.log('clearCreateResponse');
20
+ return {
21
+ type: types.CLEAR_CREATE_RESPONSE_REQUEST,
22
+ };
23
+ }
24
+
25
+ export function defaultAction() {
26
+ return {
27
+ type: types.DEFAULT_ACTION,
28
+ };
29
+ }
30
+
31
+ export function uploadAsset(file, assetType, fileParams) {
32
+ return {
33
+ type: types.UPLOAD_ASSET_REQUEST,
34
+ file,
35
+ assetType,
36
+ fileParams,
37
+ };
38
+ }
39
+
40
+ export function clearAsset() {
41
+ return {
42
+ type: types.CLEAR_ASSET,
43
+ };
44
+ }
45
+
46
+
47
+ // FOR EDIT
48
+
49
+
50
+ export function editTemplate(template, callback) {
51
+ console.log('action trigereed editTemplate line @@@');
52
+ return {
53
+ type: types.EDIT_TEMPLATE_REQUEST,
54
+ template,
55
+ callback,
56
+ };
57
+ }
58
+
59
+ export function getTemplateDetails(id, callback) {
60
+ console.log('getting template line @@@', id);
61
+ return {
62
+ type: types.GET_TEMPLATE_DETAILS_REQUEST,
63
+ id,
64
+ channel: 'LINE',
65
+ callback,
66
+ };
67
+ }
68
+
69
+ export function clearEditResponse() {
70
+ console.log('clearEditResponse');
71
+ return {
72
+ type: types.CLEAR_EDIT_RESPONSE_REQUEST,
73
+ };
74
+ }
75
+
76
+ export function clearData() {
77
+ return {
78
+ type: types.CLEAR_DATA,
79
+ };
80
+ }
81
+
82
+ export function getLineTemplatesList(channel, queryParams) {
83
+ return {
84
+ type: types.GET_LINE_TEMPLATES_LIST_REQUEST,
85
+ channel,
86
+ queryParams,
87
+ };
88
+ }
89
+
90
+ export function setSelectedTemplate(templateData) {
91
+ return {
92
+ type: types.SET_SELECTED_TEMPLATE,
93
+ data: templateData,
94
+ };
95
+ }
96
+
97
+ export const getLineStickers = () => ({
98
+ type: types.GET_STICKER_REQUEST,
99
+ })
@@ -0,0 +1,48 @@
1
+ export const TEXT = 'text';
2
+ export const STICKER = 'sticker';
3
+ export const IMAGE = 'image';
4
+ export const IMAGE_MAP = 'imagemap';
5
+ export const MAX_LINE_WRAPPER_LIMIT = 5;
6
+ export const MAX_LINE_WRAPPER_LIMIT_FULL_MODE = 1;
7
+
8
+ /*
9
+ *
10
+ * Create constants
11
+ *
12
+ */
13
+
14
+ export const DEFAULT_ACTION = 'app/Create/DEFAULT_ACTION';
15
+
16
+
17
+ export const CREATE_TEMPLATE_REQUEST = 'app/v2Containers/LineContainer/Create/CREATE_TEMPLATE_REQUEST';
18
+ export const CREATE_TEMPLATE_SUCCESS = 'app/v2Containers/LineContainer/Create/CREATE_TEMPLATE_SUCCESS';
19
+ export const CREATE_TEMPLATE_FAILURE = 'app/v2Containers/LineContainer/Create/CREATE_TEMPLATE_FAILURE';
20
+ export const UPLOAD_ASSET_REQUEST = 'app/v2Containers/LineContainer/Create/UPLOAD_ASSET_REQUEST';
21
+ export const UPLOAD_ASSET_SUCCESS = 'app/v2Containers/LineContainer/Create/UPLOAD_ASSET_SUCCESS';
22
+ export const UPLOAD_ASSET_FAILURE = 'app/v2Containers/LineContainer/Create/UPLOAD_ASSET_FAILURE';
23
+ export const CLEAR_ASSET = 'app/v2Containers/LineContainer/Create/CLEAR_ASSET';
24
+
25
+ export const CLEAR_CREATE_RESPONSE_REQUEST = 'app/v2Containers/LineContainer/Create/CLEAR_CREATE_RESPONSE_REQUEST';
26
+ export const CLEAR_CREATE_RESPONSE_SUCCESS = 'app/v2Containers/LineContainer/Create/CLEAR_CREATE_RESPONSE_SUCCESS';
27
+ export const CLEAR_CREATE_RESPONSE_FAILURE = 'app/v2Containers/LineContainer/Create/CLEAR_CREATE_RESPONSE_FAILURE';
28
+
29
+ // edit
30
+
31
+ export const GET_TEMPLATE_DETAILS_REQUEST = 'app/v2Containers/line/Edit/GET_TEMPLATE_DETAILS_REQUEST';
32
+ export const GET_TEMPLATE_DETAILS_SUCCESS = 'app/v2Containers/line/Edit/GET_TEMPLATE_DETAILS_SUCCESS';
33
+ export const GET_TEMPLATE_DETAILS_FAILURE = 'app/v2Containers/line/Edit/GET_TEMPLATE_DETAILS_FAILURE';
34
+
35
+ export const EDIT_TEMPLATE_REQUEST = 'app/v2Containers/line/Edit/EDIT_TEMPLATE_REQUEST';
36
+ export const EDIT_TEMPLATE_SUCCESS = 'app/v2Containers/line/Edit/EDIT_TEMPLATE_SUCCESS';
37
+ export const EDIT_TEMPLATE_FAILURE = 'app/v2Containers/line/Edit/EDIT_TEMPLATE_FAILURE';
38
+
39
+ export const CLEAR_EDIT_RESPONSE_REQUEST = 'app/v2Containers/line/Edit/CLEAR_EDIT_RESPONSE_REQUEST';
40
+ export const CLEAR_DATA = 'app/v2Containers/LineContainer/Edit/CLEAR_DATA';
41
+ export const SET_SELECTED_TEMPLATE = 'app/v2Containers/LineContainer/Edit/SET_SELECTED_TEMPLATE';
42
+
43
+ export const GET_LINE_TEMPLATES_LIST_REQUEST = 'app/v2Containers/LineContainer/GET_LINE_TEMPLATES_LIST_REQUEST';
44
+ export const GET_LINE_TEMPLATES_LIST_SUCCESS = 'app/v2Containers/LineContainer/GET_LINE_TEMPLATES_LIST_SUCCESS';
45
+ export const GET_LINE_TEMPLATES_LIST_FAILURE = 'app/v2Containers/LineContainer/GET_LINE_TEMPLATES_LIST_FAILURE';
46
+
47
+ export const GET_STICKER_REQUEST = 'app/v2Containers/LineContainer/GET_STICKER_REQUEST';
48
+ export const GET_STICKER_RESPONSE = 'app/v2Containers/LineContainer/GET_STICKER_RESPONSE';