@capillarytech/creatives-library 9.0.33 → 9.0.34-alpha.2
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/package.json +1 -1
- package/v2Components/CommonTestAndPreview/UnifiedPreview/ViberCarouselPreviewCards.js +132 -0
- package/v2Components/CommonTestAndPreview/UnifiedPreview/ViberPreviewContent.js +108 -15
- package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +139 -1
- package/v2Components/CommonTestAndPreview/UnifiedPreview/_viberCarouselPreviewCards.scss +131 -0
- package/v2Components/CommonTestAndPreview/index.js +240 -26
- package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/ViberPreviewContent.test.js +364 -0
- package/v2Containers/Templates/_templates.scss +114 -0
- package/v2Containers/Templates/index.js +90 -10
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +5 -0
- package/v2Containers/TemplatesV2/TemplatesV2.style.js +0 -1
- package/v2Containers/TemplatesV2/index.js +1 -9
- package/v2Containers/Viber/constants.js +21 -0
- package/v2Containers/Viber/index.js +719 -49
- package/v2Containers/Viber/index.scss +175 -0
- package/v2Containers/Viber/messages.js +121 -0
- package/v2Containers/Viber/tests/index.test.js +80 -0
|
@@ -10,7 +10,7 @@ import { connect } from 'react-redux';
|
|
|
10
10
|
import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
|
|
11
11
|
import { createStructuredSelector } from 'reselect';
|
|
12
12
|
import { bindActionCreators, compose } from 'redux';
|
|
13
|
-
import { CapTab, CapCustomCard, CapButton,
|
|
13
|
+
import { CapTab, CapCustomCard, CapButton, CapIcon, CapSpin, CapTooltip } from '@capillarytech/cap-ui-library';
|
|
14
14
|
import { find, get, pick } from 'lodash';
|
|
15
15
|
import Helmet from 'react-helmet';
|
|
16
16
|
|
|
@@ -443,14 +443,6 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
443
443
|
/>
|
|
444
444
|
)}
|
|
445
445
|
<section className="component-wrapper">
|
|
446
|
-
{isFullMode && (
|
|
447
|
-
<CapHeader
|
|
448
|
-
title={<FormattedMessage {...messages.creatives} />}
|
|
449
|
-
{...(!useLocalTemplates && {
|
|
450
|
-
description: <FormattedMessage {...messages.creativesDesc} />,
|
|
451
|
-
})}
|
|
452
|
-
/>
|
|
453
|
-
)}
|
|
454
446
|
{hideChannelTabsForLocalSms ? (
|
|
455
447
|
<section className="templates-v2-local-sms-pane">{activeLocalPane?.content}</section>
|
|
456
448
|
) : (
|
|
@@ -47,7 +47,24 @@ export const VIBER_MEDIA_TYPES = {
|
|
|
47
47
|
TEXT: 'TEXT',
|
|
48
48
|
IMAGE: 'IMAGE',
|
|
49
49
|
VIDEO: 'VIDEO',
|
|
50
|
+
CAROUSEL: 'CAROUSEL',
|
|
50
51
|
};
|
|
52
|
+
export const VIBER_CAROUSEL_MIN_CARDS = 2;
|
|
53
|
+
export const VIBER_CAROUSEL_MAX_CARDS = 5;
|
|
54
|
+
export const VIBER_CAROUSEL_MAX_BUTTONS = 2;
|
|
55
|
+
export const VIBER_CAROUSEL_CARD_TITLE_MIN_LENGTH = 2;
|
|
56
|
+
export const VIBER_CAROUSEL_CARD_TITLE_MAX_LENGTH = 38;
|
|
57
|
+
export const VIBER_CAROUSEL_FIRST_BUTTON_TITLE_MAX_LENGTH = 10;
|
|
58
|
+
export const VIBER_CAROUSEL_SECOND_BUTTON_TITLE_MAX_LENGTH = 12;
|
|
59
|
+
export const VIBER_CAROUSEL_BUTTON_URL_MAX_LENGTH = 1000;
|
|
60
|
+
export const STATIC_URL = 'STATIC_URL';
|
|
61
|
+
export const DYNAMIC_URL = 'DYNAMIC_URL';
|
|
62
|
+
/** Recommended / validated carousel image height in pixels (passed to image upload). */
|
|
63
|
+
export const VIBER_CAROUSEL_IMG_HEIGHT = 600;
|
|
64
|
+
/** Recommended / validated carousel image width in pixels (passed to image upload). */
|
|
65
|
+
export const VIBER_CAROUSEL_IMG_WIDTH = 696;
|
|
66
|
+
/** Maximum carousel image file size (bytes). 10_000_000 ≈ 10 MB (decimal). */
|
|
67
|
+
export const VIBER_CAROUSEL_IMG_SIZE = 10000000;
|
|
51
68
|
export const ALLOWED_IMAGE_EXTENSIONS_REGEX_VIBER = /\.(jpe?g|png)$/i;
|
|
52
69
|
export const ALLOWED_EXTENSIONS_VIDEO_REGEX_VIBER = /\.(mp4|3gp|m4v|mov)$/i;
|
|
53
70
|
export const NONE = 'NONE';
|
|
@@ -69,6 +86,10 @@ export const mediaRadioOptions = [
|
|
|
69
86
|
value: VIBER_MEDIA_TYPES.VIDEO,
|
|
70
87
|
label: <FormattedMessage {...messages.mediaVideo} />,
|
|
71
88
|
},
|
|
89
|
+
{
|
|
90
|
+
value: VIBER_MEDIA_TYPES.CAROUSEL,
|
|
91
|
+
label: <FormattedMessage {...messages.mediaCarousel} />,
|
|
92
|
+
},
|
|
72
93
|
];
|
|
73
94
|
|
|
74
95
|
export const buttonRadioOptions = [
|