@capillarytech/creatives-library 8.0.144 → 8.0.145
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/MobilePushPreviewV2/index.js +2 -2
- package/v2Components/TemplatePreview/index.js +4 -4
- package/v2Containers/CreativesContainer/index.js +4 -4
- package/v2Containers/Line/Container/Text/index.js +6 -6
- package/v2Containers/Templates/_templates.scss +0 -3
- package/v2Containers/Templates/index.js +4 -4
package/package.json
CHANGED
|
@@ -87,8 +87,8 @@ class MobilePushPreviewV2 extends React.Component { // eslint-disable-line react
|
|
|
87
87
|
|
|
88
88
|
if (media?.length > 0) {
|
|
89
89
|
const mediaItem = media[0];
|
|
90
|
-
const { type, url } = mediaItem;
|
|
91
|
-
if (
|
|
90
|
+
const { type: mediaType, url } = mediaItem;
|
|
91
|
+
if (mediaType === VIDEO) {
|
|
92
92
|
// Distinguish between actual video and GIF based on URL extension
|
|
93
93
|
if (url && url?.toLowerCase()?.includes('.gif')) {
|
|
94
94
|
bodyGif = url;
|
|
@@ -182,17 +182,17 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
182
182
|
key={`carousel-card-${idx}`}
|
|
183
183
|
className="mobile-push-carousel-card message-pop align-left message-pop-carousel"
|
|
184
184
|
>
|
|
185
|
-
{item?.mediaType === IMAGE
|
|
185
|
+
{item?.mediaType?.toLowerCase() === IMAGE && (item?.imageUrl || item?.url) && (
|
|
186
186
|
<CapImage
|
|
187
|
-
src={item?.imageUrl}
|
|
187
|
+
src={item?.imageUrl || item?.url}
|
|
188
188
|
alt="carousel-img"
|
|
189
189
|
className="carousel-image"
|
|
190
190
|
/>
|
|
191
191
|
)}
|
|
192
|
-
{item?.mediaType === VIDEO
|
|
192
|
+
{item?.mediaType?.toLowerCase() === VIDEO && item?.videoPreviewImg && (
|
|
193
193
|
<CapRow className="video-preview">
|
|
194
194
|
<CapImage
|
|
195
|
-
src={item?.videoPreviewImg}
|
|
195
|
+
src={item?.videoPreviewImg || item?.url}
|
|
196
196
|
alt="carousel-video-preview"
|
|
197
197
|
className="carousel-video-preview"
|
|
198
198
|
/>
|
|
@@ -363,16 +363,16 @@ export class Creatives extends React.Component {
|
|
|
363
363
|
const iosContent = { ...(templateData?.iosContent || {}) };
|
|
364
364
|
if (androidCarouselMedia?.length) {
|
|
365
365
|
androidContent.expandableDetails.carouselData = androidCarouselMedia.map((media) => ({
|
|
366
|
-
mediaType: media
|
|
367
|
-
imageUrl: media
|
|
366
|
+
mediaType: media?.type,
|
|
367
|
+
imageUrl: media?.url,
|
|
368
368
|
buttons: [],
|
|
369
369
|
videoSrc: '',
|
|
370
370
|
}));
|
|
371
371
|
}
|
|
372
372
|
if (iosCarouselMedia?.length) {
|
|
373
373
|
iosContent.expandableDetails.carouselData = iosCarouselMedia.map((media) => ({
|
|
374
|
-
mediaType: media
|
|
375
|
-
imageUrl: media
|
|
374
|
+
mediaType: media?.type,
|
|
375
|
+
imageUrl: media?.url,
|
|
376
376
|
buttons: [],
|
|
377
377
|
videoSrc: '',
|
|
378
378
|
}));
|
|
@@ -104,12 +104,12 @@ export const LineText = ({
|
|
|
104
104
|
layout: 'LINE',
|
|
105
105
|
type: 'TAG',
|
|
106
106
|
context:
|
|
107
|
-
location
|
|
107
|
+
location?.query?.type === 'embedded'
|
|
108
108
|
? 'outbound'
|
|
109
109
|
: 'default',
|
|
110
110
|
embedded:
|
|
111
|
-
location
|
|
112
|
-
? location
|
|
111
|
+
location?.query?.type === 'embedded'
|
|
112
|
+
? location?.query?.type
|
|
113
113
|
: 'full',
|
|
114
114
|
};
|
|
115
115
|
if (getDefaultTags) {
|
|
@@ -125,8 +125,8 @@ export const LineText = ({
|
|
|
125
125
|
context:
|
|
126
126
|
(data || '').toLowerCase() === 'all' ? 'default' : (data || '').toLowerCase(),
|
|
127
127
|
embedded:
|
|
128
|
-
location
|
|
129
|
-
? location
|
|
128
|
+
location?.query?.type === 'embedded'
|
|
129
|
+
? location?.query?.type
|
|
130
130
|
: 'full',
|
|
131
131
|
};
|
|
132
132
|
globalActions.fetchSchemaForEntity(query);
|
|
@@ -266,7 +266,7 @@ export const LineText = ({
|
|
|
266
266
|
/>
|
|
267
267
|
<TagList
|
|
268
268
|
key={`${id}_tags`}
|
|
269
|
-
moduleFilterEnabled={location && location
|
|
269
|
+
moduleFilterEnabled={location && location?.query && location?.query?.type !== 'embedded'}
|
|
270
270
|
label={formatMessage(messages.addLabels)}
|
|
271
271
|
onTagSelect={onTagSelect}
|
|
272
272
|
onContextChange={handleOnTagsContextChange}
|
|
@@ -1309,9 +1309,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1309
1309
|
</div>
|
|
1310
1310
|
</div>
|
|
1311
1311
|
)}
|
|
1312
|
-
{
|
|
1312
|
+
{[MANUAL_CAROUSEL, AUTO_CAROUSEL, FILMSTRIP_CAROUSEL].includes(style) && (
|
|
1313
1313
|
<div className="scroll-container">
|
|
1314
|
-
{carouselData
|
|
1314
|
+
{carouselData?.map((data, index) => {
|
|
1315
1315
|
return (
|
|
1316
1316
|
<div
|
|
1317
1317
|
key={`carousel-${index + 1}`}
|
|
@@ -1321,14 +1321,14 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1321
1321
|
<div className="whatsapp-carousel-card">
|
|
1322
1322
|
{data?.mediaType === IMAGE.toLowerCase() && (
|
|
1323
1323
|
<CapImage
|
|
1324
|
-
src={data?.imageUrl ? data?.imageUrl : whatsappImageEmptyPreview}
|
|
1324
|
+
src={data?.imageUrl ? data?.imageUrl : data?.url ? data?.url : whatsappImageEmptyPreview}
|
|
1325
1325
|
className="whatsapp-image"
|
|
1326
1326
|
/>
|
|
1327
1327
|
)}
|
|
1328
1328
|
{data?.mediaType === VIDEO.toLowerCase() && (
|
|
1329
1329
|
<div className="video-preview">
|
|
1330
1330
|
<CapImage
|
|
1331
|
-
src={data?.videoPreviewImg ? data?.videoPreviewImg : whatsappVideoEmptyPreview}
|
|
1331
|
+
src={data?.videoPreviewImg ? data?.videoPreviewImg : data?.url ? data?.url : whatsappVideoEmptyPreview}
|
|
1332
1332
|
className="whatsapp-image"
|
|
1333
1333
|
/>
|
|
1334
1334
|
<div className="icon-position">
|