@capillarytech/creatives-library 7.12.75 → 7.12.77

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": "7.12.75",
4
+ "version": "7.12.77",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -7,7 +7,8 @@ import { parse } from 'node-html-parser';
7
7
  const CDN_BASE_URL = `https://storage.crm.n.content-cdn.io`;
8
8
  const CDN_TRANSFORMATION_URL_SUFFIX = `/cdn-cgi/image/`;
9
9
  const QUALITY = 75;
10
- const regex = /https:\/\/.*intouch_creative_assets.*(?:jpg|png|jpeg|gif)$/;
10
+ // const regex = /https:\/\/.*intouch_creative_assets.*(?:jpg|png|jpeg|gif)$/;
11
+ const regex = /https:\/\/.*intouch_creative_assets.*$/;
11
12
  const INTOUCH_CREATIVE_ASSETS = 'intouch_creative_assets';
12
13
 
13
14
  /**
@@ -34,6 +34,7 @@ import * as templateActionsConfig from '../../Templates/actions';
34
34
  import withCreatives from '../../../hoc/withCreatives';
35
35
  import { gtmPush } from '../../../utils/gtmTrackers';
36
36
  import { LINE } from '../../CreativesContainer/constants';
37
+ import { getCdnUrl } from '../../../utils/cdnTransformation';
37
38
 
38
39
  const { stopTimer } = GA.timeTracker;
39
40
 
@@ -401,7 +402,7 @@ export const LineContainer = ({
401
402
  messageData.previewImageUrl = previewImageUrl;
402
403
  }
403
404
  if (originalContentUrl) {
404
- messageData.originalContentUrl = originalContentUrl;
405
+ messageData.originalContentUrl = getCdnUrl({url: originalContentUrl});
405
406
  }
406
407
  if (selectedSticker) {
407
408
  messageData.stickerUrl = selectedSticker.stickerUrl;
@@ -410,7 +411,7 @@ export const LineContainer = ({
410
411
  messageData.stickerId = `${selectedSticker.stickerId}`;
411
412
  }
412
413
  if (baseUrl) {
413
- messageData.baseUrl = baseUrl;
414
+ messageData.baseUrl = getCdnUrl({url: baseUrl});
414
415
  messageData.altText = altText;
415
416
  }
416
417
  if (baseSize) {
@@ -426,7 +427,7 @@ export const LineContainer = ({
426
427
  type: 'bubble',
427
428
  hero: {
428
429
  type: 'image',
429
- url: item.imageUrl,
430
+ url: getCdnUrl({url: item.imageUrl}),
430
431
  size: 'full',
431
432
  aspectRatio: item.aspectRatio,
432
433
  aspectMode: 'cover',
@@ -473,7 +474,7 @@ export const LineContainer = ({
473
474
  height: videoHeight,
474
475
  width: videoWidth,
475
476
  },
476
- originalContentUrl: videoSrc,
477
+ originalContentUrl: getCdnUrl({url: videoSrc, transformationEnabled: false, reduceQuality: false}),
477
478
  previewImageUrl,
478
479
  };
479
480
  if (actionLabel) {
@@ -31,6 +31,7 @@ import { GA } from '@capillarytech/cap-ui-utils';
31
31
  import { CREATE, TRACK_CREATE_MPUSH } from '../../App/constants';
32
32
  import { MOBILE_PUSH } from '../../CreativesContainer/constants';
33
33
  import { getContent } from '../commonMethods';
34
+ import { getCdnUrl } from '../../../utils/cdnTransformation'
34
35
 
35
36
  const PrefixWrapper = styled.div`
36
37
  margin-right: 16px;
@@ -464,7 +465,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
464
465
  const secondaryCta2 = !!android['cta-deeplink-secondary-cta-1-select'] || !!android['secondary-cta-1-label'];
465
466
  const imageLink = android.image;
466
467
  if (imageLink) {
467
- obj.versions.base.ANDROID.expandableDetails.image = imageLink;
468
+ obj.versions.base.ANDROID.expandableDetails.image = getCdnUrl({url: imageLink});
468
469
  obj.versions.base.ANDROID.expandableDetails.style = "BIG_PICTURE";
469
470
  }
470
471
  if (secondaryCta1 || secondaryCta2 ) {
@@ -538,7 +539,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
538
539
  const imageLinkIos = ios.image;
539
540
  const secondaryCtaIos = !!ios['cta-deeplink-secondary-cta-1-select'] || !!ios['secondary-cta-1-label'];
540
541
  if (imageLinkIos) {
541
- obj.versions.base.IOS.expandableDetails.image = imageLinkIos;
542
+ obj.versions.base.IOS.expandableDetails.image = getCdnUrl({url: imageLinkIos});
542
543
  obj.versions.base.IOS.expandableDetails.style = "BIG_PICTURE";
543
544
  }
544
545
  if (secondaryCtaIos) {
@@ -33,6 +33,7 @@ import {getPrimaryCtaFields, getSecondaryCtaFields, getLinkTypeFields, getConten
33
33
  import { GA } from '@capillarytech/cap-ui-utils';
34
34
  import { EDIT, TRACK_EDIT_MPUSH } from '../../App/constants';
35
35
  import { MOBILE_PUSH } from '../../CreativesContainer/constants';
36
+ import { getCdnUrl } from '../../../utils/cdnTransformation';
36
37
 
37
38
  const PrefixWrapper = styled.div`
38
39
  margin-right: 16px;
@@ -421,7 +422,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
421
422
  }
422
423
  const imageLink = android.image;
423
424
  if (imageLink) {
424
- obj.versions.base.ANDROID.expandableDetails.image = imageLink;
425
+ obj.versions.base.ANDROID.expandableDetails.image = getCdnUrl({url: imageLink});
425
426
  obj.versions.base.ANDROID.expandableDetails.style = "BIG_PICTURE";
426
427
  }
427
428
  if (obj.versions.base.ANDROID && obj.versions.base.ANDROID.cta) {
@@ -492,7 +493,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
492
493
  }
493
494
  const imageLinkIos = ios.image;
494
495
  if (imageLinkIos) {
495
- obj.versions.base.IOS.expandableDetails.image = imageLinkIos;
496
+ obj.versions.base.IOS.expandableDetails.image = getCdnUrl({url: imageLinkIos});
496
497
  obj.versions.base.IOS.expandableDetails.style = "BIG_PICTURE";
497
498
  }
498
499
  if (obj.versions.base.IOS && obj.versions.base.IOS.cta) {