@capillarytech/creatives-library 8.0.91 → 8.0.93
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/CapWhatsappCarouselButton/index.js +4 -4
- package/v2Components/TemplatePreview/_templatePreview.scss +11 -0
- package/v2Components/TemplatePreview/index.js +3 -14
- package/v2Containers/CreativesContainer/index.js +2 -2
- package/v2Containers/Whatsapp/index.js +4 -4
- package/v2Containers/Whatsapp/index.scss +4 -4
- package/v2Containers/Whatsapp/messages.js +2 -2
- package/v2Containers/Whatsapp/styles.scss +5 -0
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +28041 -30501
- package/v2Containers/Whatsapp/utils.js +1 -2
package/package.json
CHANGED
|
@@ -73,7 +73,7 @@ export const CapWhatsappCarouselButton = (props) => {
|
|
|
73
73
|
const onValueChange = (buttonIndex, fields = []) => {
|
|
74
74
|
const updatedButtonData = cloneDeep(buttonData);
|
|
75
75
|
fields.forEach((field) => {
|
|
76
|
-
updatedButtonData[buttonIndex][field
|
|
76
|
+
updatedButtonData[buttonIndex][field?.fieldName] = field?.value;
|
|
77
77
|
});
|
|
78
78
|
setCarouselData(
|
|
79
79
|
carouselData.map((item, index) => index === carouselIndex
|
|
@@ -309,10 +309,9 @@ export const CapWhatsappCarouselButton = (props) => {
|
|
|
309
309
|
return (
|
|
310
310
|
<CapRow
|
|
311
311
|
key={`${button.buttonType}_${index}`}
|
|
312
|
-
className=
|
|
312
|
+
className={`cap-whatsapp-saved-cta cap-whatsapp-saved-carousel-button margin-t-12 ${isEditFlow ? 'margin-l-0' : ''}`}
|
|
313
313
|
align="middle"
|
|
314
314
|
type="flex"
|
|
315
|
-
style={{ marginLeft: isEditFlow ? 0 : '' }}
|
|
316
315
|
>
|
|
317
316
|
<CapColumn
|
|
318
317
|
span={1}
|
|
@@ -345,7 +344,7 @@ export const CapWhatsappCarouselButton = (props) => {
|
|
|
345
344
|
</CapLabel>
|
|
346
345
|
</CapColumn>
|
|
347
346
|
<CapTooltip title={button?.url} placement="top">
|
|
348
|
-
<CapColumn span={7}
|
|
347
|
+
<CapColumn span={7} className="margin-r-0">
|
|
349
348
|
<CapLabel className="url">{button?.url}</CapLabel>
|
|
350
349
|
</CapColumn>
|
|
351
350
|
</CapTooltip>
|
|
@@ -415,6 +414,7 @@ export const CapWhatsappCarouselButton = (props) => {
|
|
|
415
414
|
);
|
|
416
415
|
})}
|
|
417
416
|
<CapRow>
|
|
417
|
+
{/* user can add only two button in the first carousel in other carousel user dont allow to add buttons */}
|
|
418
418
|
{buttonData?.length < 2 && !isEditFlow && parseInt(carouselIndex, 10) === 0 && (
|
|
419
419
|
<CapRow>
|
|
420
420
|
<CapTooltip
|
|
@@ -755,6 +755,17 @@
|
|
|
755
755
|
.msg-container-carousel {
|
|
756
756
|
display: flex;
|
|
757
757
|
flex-direction: column;
|
|
758
|
+
.scroll-container {
|
|
759
|
+
overflow-x: auto;
|
|
760
|
+
display: flex;
|
|
761
|
+
padding-top: $CAP_SPACE_06;
|
|
762
|
+
padding-right: $CAP_SPACE_06;
|
|
763
|
+
white-space: nowrap;
|
|
764
|
+
scrollbar-width: none; // Hide scrollbar in Firefox
|
|
765
|
+
&::-webkit-scrollbar {
|
|
766
|
+
display: none; // Hide scrollbar in Chrome/Safari/Opera
|
|
767
|
+
}
|
|
768
|
+
}
|
|
758
769
|
}
|
|
759
770
|
}
|
|
760
771
|
|
|
@@ -260,7 +260,7 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
260
260
|
'padding': `${CAP_SPACE_04} 0 ${CAP_SPACE_08}`,
|
|
261
261
|
'border-radius': '0.428rem',
|
|
262
262
|
'background-color': CAP_WHITE,
|
|
263
|
-
'width': '
|
|
263
|
+
'width': '10.4rem',
|
|
264
264
|
'cursor': 'pointer',
|
|
265
265
|
'flex-shrink': 0,
|
|
266
266
|
'left': 0,
|
|
@@ -1039,21 +1039,10 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
1039
1039
|
</div>
|
|
1040
1040
|
</div>
|
|
1041
1041
|
{content?.carouselData && (
|
|
1042
|
-
<div
|
|
1043
|
-
style={{
|
|
1044
|
-
overflowX: "auto",
|
|
1045
|
-
display: "flex",
|
|
1046
|
-
paddingTop: "5px",
|
|
1047
|
-
paddingRight: "5px",
|
|
1048
|
-
whiteSpace: "nowrap",
|
|
1049
|
-
scrollbarWidth: "none", // Hide scrollbar in Firefox
|
|
1050
|
-
msOverflowStyle: "none", // Hide scrollbar in IE/Edge
|
|
1051
|
-
}}
|
|
1052
|
-
className="scroll-container"
|
|
1053
|
-
>
|
|
1042
|
+
<div className="scroll-container">
|
|
1054
1043
|
{content?.carouselData?.map((data, index) => (
|
|
1055
1044
|
<div
|
|
1056
|
-
key={`carousel-${index}`}
|
|
1045
|
+
key={`carousel-${index}-${data?.bodyText}`}
|
|
1057
1046
|
className="message-pop align-left message-pop-carousel"
|
|
1058
1047
|
style={carouselWhatsappSectionStyle}>
|
|
1059
1048
|
<div className="whatsapp-content">
|
|
@@ -527,7 +527,7 @@ export class Creatives extends React.Component {
|
|
|
527
527
|
default:
|
|
528
528
|
break;
|
|
529
529
|
}
|
|
530
|
-
const modifiedButtons = cloneDeep(buttons)
|
|
530
|
+
const modifiedButtons = cloneDeep(buttons)?.map((btn) => {
|
|
531
531
|
if (btn.type === 'PHONE_NUMBER') {
|
|
532
532
|
btn.phone_number = btn.phoneNumber;
|
|
533
533
|
delete btn.phoneNumber;
|
|
@@ -910,7 +910,7 @@ export class Creatives extends React.Component {
|
|
|
910
910
|
isPreviewUrl,
|
|
911
911
|
...(mediaType === WHATSAPP_MEDIA_TYPES.CAROUSEL && {
|
|
912
912
|
cards: this.getCarouselMappedData(carouselData),
|
|
913
|
-
mediaType: carouselData[0]?.mediaType,
|
|
913
|
+
mediaType: carouselData[0]?.mediaType?.toUpperCase(),
|
|
914
914
|
}),
|
|
915
915
|
},
|
|
916
916
|
};
|
|
@@ -1311,7 +1311,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
1311
1311
|
const carouselBodyTextErrorHandler = (value, carouselIndex) => {
|
|
1312
1312
|
let errorMessage = false;
|
|
1313
1313
|
if (value === "") {
|
|
1314
|
-
errorMessage = formatMessage(messages.
|
|
1314
|
+
errorMessage = formatMessage(messages.emptyCardBodyErrorMessage);
|
|
1315
1315
|
} else if(value?.length > TEMPLATE_MESSAGE_MAX_LENGTH) {
|
|
1316
1316
|
errorMessage = formatMessage(messages.templateMessageLengthError);
|
|
1317
1317
|
} else {
|
|
@@ -2784,8 +2784,8 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2784
2784
|
data.carouselTagValidationErr ||
|
|
2785
2785
|
Object.values(data.varMap).some((inputValue) => inputValue === "") ||
|
|
2786
2786
|
computeTextLength(CAROUSEL_TEXT, data) > TEMPLATE_MESSAGE_MAX_LENGTH ||
|
|
2787
|
-
(carouselMediaType ===
|
|
2788
|
-
(carouselMediaType ===
|
|
2787
|
+
(carouselMediaType === IMAGE.toLowerCase() && !data.imageSrc) ||
|
|
2788
|
+
(carouselMediaType === VIDEO.toLowerCase() && !data.videoSrc) ||
|
|
2789
2789
|
data?.buttons.some((btn) => btn?.url?.includes("{{1}}"))
|
|
2790
2790
|
);
|
|
2791
2791
|
});
|
|
@@ -2840,7 +2840,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2840
2840
|
</CapButton>
|
|
2841
2841
|
</>
|
|
2842
2842
|
)}
|
|
2843
|
-
{
|
|
2843
|
+
{!isFullMode && isEditFlow && (
|
|
2844
2844
|
<CapTooltip
|
|
2845
2845
|
title={
|
|
2846
2846
|
isEditDoneDisabled()
|
|
@@ -111,11 +111,11 @@
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
#select-whatsapp-category {
|
|
114
|
-
padding-right:
|
|
114
|
+
padding-right: 0.357rem;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
#select-whatsapp-media {
|
|
118
|
-
padding-left:
|
|
118
|
+
padding-left: 0.357rem;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
#select-whatsapp-category,
|
|
@@ -271,12 +271,12 @@
|
|
|
271
271
|
padding: 0;
|
|
272
272
|
line-height: normal;
|
|
273
273
|
.add-carousel-content-button {
|
|
274
|
-
padding:
|
|
274
|
+
padding: 0.642rem 0px;
|
|
275
275
|
margin: 0;
|
|
276
276
|
}
|
|
277
277
|
.cap-divider-v2{
|
|
278
278
|
height: 1.5rem;
|
|
279
|
-
margin-bottom:
|
|
279
|
+
margin-bottom: 0.499rem;
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
}
|
|
@@ -757,8 +757,8 @@ export default defineMessages({
|
|
|
757
757
|
id: `${prefix}.buttonType`,
|
|
758
758
|
defaultMessage: 'Button type',
|
|
759
759
|
},
|
|
760
|
-
|
|
761
|
-
id: `${prefix}.
|
|
760
|
+
emptyCardBodyErrorMessage: {
|
|
761
|
+
id: `${prefix}.emptyCardBodyErrorMessage`,
|
|
762
762
|
defaultMessage: 'Card body text cannot be empty',
|
|
763
763
|
},
|
|
764
764
|
carouselButtonInfo: {
|