@capillarytech/creatives-library 8.0.91 → 8.0.92

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "8.0.91",
4
+ "version": "8.0.92",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -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.fieldName] = field.value;
76
+ updatedButtonData[buttonIndex][field?.fieldName] = field?.value;
77
77
  });
78
78
  setCarouselData(
79
79
  carouselData.map((item, index) => index === carouselIndex
@@ -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': '11.857rem',
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).map((btn) => {
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.emptyCardBodyeErrorMessage);
1314
+ errorMessage = formatMessage(messages.emptyCardBodyErrorMessage);
1315
1315
  } else if(value?.length > TEMPLATE_MESSAGE_MAX_LENGTH) {
1316
1316
  errorMessage = formatMessage(messages.templateMessageLengthError);
1317
1317
  } else {
@@ -271,12 +271,12 @@
271
271
  padding: 0;
272
272
  line-height: normal;
273
273
  .add-carousel-content-button {
274
- padding: 9px 0px;
274
+ padding: 0.642rem 0px;
275
275
  margin: 0;
276
276
  }
277
277
  .cap-divider-v2{
278
278
  height: 1.5rem;
279
- margin-bottom: 7px;
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
- emptyCardBodyeErrorMessage: {
761
- id: `${prefix}.emptyCardBodyeErrorMessage`,
760
+ emptyCardBodyErrorMessage: {
761
+ id: `${prefix}.emptyCardBodyErrorMessage`,
762
762
  defaultMessage: 'Card body text cannot be empty',
763
763
  },
764
764
  carouselButtonInfo: {