pb-sxp-ui 1.0.23 → 1.0.25
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/dist/index.cjs +104 -96
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +104 -96
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +104 -96
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/ExpandableText.js +1 -1
- package/es/core/components/SxpPageRender/PictureGroup/Picture.d.ts +3 -2
- package/es/core/components/SxpPageRender/PictureGroup/Picture.js +13 -13
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +2 -0
- package/es/core/components/SxpPageRender/PictureGroup/index.js +4 -3
- package/es/core/components/SxpPageRender/RenderCard.js +1 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.d.ts +2 -0
- package/es/core/components/SxpPageRender/VideoWidget/index.js +77 -67
- package/es/core/components/SxpPageRender/index.d.ts +8 -1
- package/es/core/components/SxpPageRender/index.js +3 -3
- package/es/materials/sxp/template/components/Img.js +1 -1
- package/lib/core/components/SxpPageRender/ExpandableText.js +1 -1
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.d.ts +3 -2
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.js +12 -12
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +2 -0
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +4 -3
- package/lib/core/components/SxpPageRender/RenderCard.js +1 -1
- package/lib/core/components/SxpPageRender/VideoWidget/index.d.ts +2 -0
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +77 -67
- package/lib/core/components/SxpPageRender/index.d.ts +8 -1
- package/lib/core/components/SxpPageRender/index.js +3 -3
- package/lib/materials/sxp/template/components/Img.js +1 -1
- package/package.json +1 -1
@@ -4,14 +4,16 @@ const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
5
5
|
const react_2 = require("swiper/react");
|
6
6
|
const useIconLink_1 = require("../useIconLink");
|
7
|
+
const FormatImage_1 = tslib_1.__importDefault(require("../FormatImage"));
|
7
8
|
const hooks_1 = require("../../../../core/hooks");
|
8
9
|
const event_1 = tslib_1.__importStar(require("../../../../core/utils/event"));
|
9
|
-
const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
10
|
+
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig }) => {
|
10
11
|
const [isPauseVideo, setIsPauseVideo] = (0, react_1.useState)(false);
|
11
12
|
const videoRef = (0, react_1.useRef)(null);
|
12
13
|
const { bffEventReport, sxpParameter, waterFallData, openHashtag } = (0, hooks_1.useSxpDataSource)();
|
13
14
|
const videoStartTime = (0, react_1.useRef)(0);
|
14
|
-
const [
|
15
|
+
const [isLoadFinish, setIsLoadFinish] = (0, react_1.useState)(false);
|
16
|
+
const [isFirstPlay, setIsFirstPlay] = (0, react_1.useState)(true);
|
15
17
|
const { isActive } = (0, react_2.useSwiperSlide)();
|
16
18
|
(0, react_1.useEffect)(() => {
|
17
19
|
if (!videoRef.current)
|
@@ -27,11 +29,11 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
27
29
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
28
30
|
setIsPauseVideo(false);
|
29
31
|
const item = data[index];
|
30
|
-
if (item &&
|
32
|
+
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
31
33
|
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
|
32
34
|
const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
33
35
|
const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
34
|
-
const playType = '1';
|
36
|
+
const playType = isFirstPlay ? '0' : '1';
|
35
37
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
36
38
|
eventInfo: {
|
37
39
|
eventSubject: 'playVideo',
|
@@ -47,72 +49,41 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
47
49
|
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
48
50
|
}
|
49
51
|
});
|
52
|
+
setIsFirstPlay(false);
|
50
53
|
}
|
51
|
-
|
52
|
-
setIsLoad(true);
|
53
|
-
}
|
54
|
-
}, [bffEventReport, data, index, isLoad]);
|
54
|
+
}, [bffEventReport, data, index, isFirstPlay]);
|
55
55
|
const handleLoadedMetadata = (0, react_1.useCallback)(() => {
|
56
|
-
|
57
|
-
|
58
|
-
if (item && !isLoad && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
59
|
-
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
|
60
|
-
const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
61
|
-
const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
62
|
-
const playType = '0';
|
63
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
64
|
-
eventInfo: {
|
65
|
-
eventSubject: 'playVideo',
|
66
|
-
eventDescription: 'User played the video',
|
67
|
-
contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
68
|
-
contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
69
|
-
playType,
|
70
|
-
startTime: videoCurrentTime,
|
71
|
-
videoDuration,
|
72
|
-
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
73
|
-
position: index + '',
|
74
|
-
contentFormat: 'video',
|
75
|
-
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
76
|
-
}
|
77
|
-
});
|
78
|
-
}
|
79
|
-
setTimeout(() => {
|
80
|
-
var _a;
|
81
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
82
|
-
}, 0);
|
83
|
-
}, [index, bffEventReport, data, isLoad]);
|
56
|
+
setIsLoadFinish(true);
|
57
|
+
}, []);
|
84
58
|
const handleClickVideo = (0, react_1.useCallback)((type) => () => {
|
85
|
-
var _a, _b, _c, _d, _e
|
86
|
-
if (!
|
59
|
+
var _a, _b, _c, _d, _e;
|
60
|
+
if (!isLoadFinish)
|
87
61
|
return;
|
88
|
-
const
|
89
|
-
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
90
|
-
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
91
|
-
const isPause = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.paused;
|
62
|
+
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
92
63
|
switch (type) {
|
93
64
|
case 'start':
|
94
65
|
if (!isPause)
|
95
66
|
return;
|
96
|
-
(
|
67
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
|
97
68
|
setIsPauseVideo(false);
|
98
69
|
break;
|
99
70
|
case 'pause':
|
100
71
|
if (isPause)
|
101
72
|
return;
|
102
|
-
(
|
73
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
103
74
|
setIsPauseVideo(true);
|
104
75
|
break;
|
105
76
|
default:
|
106
77
|
if (isPause) {
|
107
|
-
(
|
78
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
108
79
|
}
|
109
80
|
else {
|
110
|
-
(
|
81
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
|
111
82
|
}
|
112
83
|
setIsPauseVideo(!isPause);
|
113
84
|
break;
|
114
85
|
}
|
115
|
-
}, [
|
86
|
+
}, [isLoadFinish]);
|
116
87
|
const onPause = (0, react_1.useCallback)(() => {
|
117
88
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
118
89
|
const item = data[index];
|
@@ -138,38 +109,40 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
138
109
|
}
|
139
110
|
}, [data, index, bffEventReport]);
|
140
111
|
(0, react_1.useEffect)(() => {
|
141
|
-
var _a, _b
|
142
|
-
if (data.length <= 0)
|
143
|
-
return;
|
112
|
+
var _a, _b;
|
144
113
|
if (!videoRef.current)
|
145
114
|
return;
|
146
115
|
setIsPauseVideo(false);
|
147
|
-
if (!isActive) {
|
148
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
149
|
-
return;
|
150
|
-
}
|
151
116
|
if (!videoRef.current.src) {
|
152
117
|
const videoSrc = rec.video.url;
|
153
118
|
videoRef.current.src = videoSrc;
|
154
119
|
videoRef.current.setAttribute('x5-playsinline', 'true');
|
155
120
|
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
156
121
|
}
|
157
|
-
|
158
|
-
|
159
|
-
}
|
160
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
|
161
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
|
122
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('canplay', handleLoadedMetadata);
|
123
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('playing', handlePlaying);
|
162
124
|
return () => {
|
163
125
|
var _a, _b;
|
164
126
|
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('canplay', handleLoadedMetadata);
|
165
127
|
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('playing', handlePlaying);
|
166
128
|
};
|
167
|
-
}, [
|
129
|
+
}, [handleLoadedMetadata, handlePlaying, rec.video]);
|
130
|
+
(0, react_1.useEffect)(() => {
|
131
|
+
var _a;
|
132
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
|
133
|
+
return;
|
134
|
+
if (isActive) {
|
135
|
+
videoRef.current.play();
|
136
|
+
}
|
137
|
+
else {
|
138
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
139
|
+
}
|
140
|
+
}, [isActive, isLoadFinish]);
|
168
141
|
(0, react_1.useEffect)(() => {
|
169
142
|
var _a, _b, _c;
|
170
|
-
|
171
|
-
if (!isActive)
|
143
|
+
if (!isActive || !(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
172
144
|
return;
|
145
|
+
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
173
146
|
if (!isPause && openHashtag) {
|
174
147
|
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.pause();
|
175
148
|
}
|
@@ -190,11 +163,11 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
190
163
|
};
|
191
164
|
}, [handleClickVideo, isActive]);
|
192
165
|
const renderPoster = (0, react_1.useMemo)(() => {
|
193
|
-
if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image)) {
|
166
|
+
if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
|
194
167
|
return null;
|
195
168
|
}
|
196
|
-
return (react_1.default.createElement("img", {
|
197
|
-
}, [
|
169
|
+
return (react_1.default.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image }));
|
170
|
+
}, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
|
198
171
|
(0, react_1.useEffect)(() => {
|
199
172
|
const handleBeforeUnload = () => {
|
200
173
|
var _a, _b;
|
@@ -207,16 +180,53 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
|
207
180
|
window.removeEventListener('beforeunload', handleBeforeUnload);
|
208
181
|
};
|
209
182
|
}, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
|
183
|
+
const blur = (0, react_1.useMemo)(() => {
|
184
|
+
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
185
|
+
}, [videoPostConfig]);
|
186
|
+
const translateY = (0, react_1.useMemo)(() => {
|
187
|
+
var _a;
|
188
|
+
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
|
189
|
+
? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%)`
|
190
|
+
: 'translateY(-50%)';
|
191
|
+
}, [videoPostConfig]);
|
210
192
|
if (!rec.video) {
|
211
193
|
return null;
|
212
194
|
}
|
213
|
-
return (react_1.default.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
195
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, blur ? (react_1.default.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
196
|
+
position: 'relative',
|
197
|
+
width: '100%',
|
198
|
+
height
|
199
|
+
} },
|
200
|
+
react_1.default.createElement(FormatImage_1.default, { src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, style: {
|
201
|
+
height: '100%',
|
202
|
+
width: '100%',
|
203
|
+
objectFit: 'cover',
|
204
|
+
filter: blur ? 'blur(10px)' : 'none',
|
205
|
+
transform: blur ? 'scale(1.2)' : 'none'
|
206
|
+
} }),
|
207
|
+
react_1.default.createElement("div", { style: {
|
208
|
+
position: 'absolute',
|
209
|
+
width: '100%',
|
210
|
+
height: 'auto',
|
211
|
+
top: '50%',
|
212
|
+
transform: translateY,
|
213
|
+
left: 0,
|
214
|
+
right: 0
|
215
|
+
} },
|
216
|
+
react_1.default.createElement("div", { style: { position: 'relative' } },
|
217
|
+
react_1.default.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, poster: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart, style: {
|
218
|
+
width: '100%',
|
219
|
+
height: 'auto',
|
220
|
+
objectFit: 'contain'
|
221
|
+
} }),
|
222
|
+
renderPoster,
|
223
|
+
react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))))) : (react_1.default.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
214
224
|
position: 'relative',
|
215
225
|
width: '100%',
|
216
226
|
height
|
217
227
|
} },
|
218
228
|
react_1.default.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, poster: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
|
219
229
|
renderPoster,
|
220
|
-
react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })));
|
230
|
+
react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
221
231
|
};
|
222
232
|
exports.default = (0, react_1.memo)(VideoWidget);
|
@@ -1,7 +1,12 @@
|
|
1
1
|
import { CSSProperties, FC } from 'react';
|
2
2
|
import { RecItemType } from './typing';
|
3
3
|
import './index.less';
|
4
|
-
|
4
|
+
export type postConfigType = {
|
5
|
+
mode?: '1' | '2';
|
6
|
+
offsetTop?: number;
|
7
|
+
delay?: number;
|
8
|
+
};
|
9
|
+
export interface ISxpPageRenderProps {
|
5
10
|
globalConfig?: {
|
6
11
|
isShowLogo?: boolean;
|
7
12
|
logoUrl?: string;
|
@@ -19,6 +24,8 @@ interface ISxpPageRenderProps {
|
|
19
24
|
swipeTipIcon?: string;
|
20
25
|
hashTag?: any[];
|
21
26
|
isOpenTextShadow?: boolean;
|
27
|
+
videoPost?: postConfigType;
|
28
|
+
imgUrlsPost?: postConfigType;
|
22
29
|
};
|
23
30
|
descStyle?: CSSProperties;
|
24
31
|
tipText?: {
|
@@ -156,10 +156,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
156
156
|
const renderContent = (0, react_1.useCallback)((rec, index) => {
|
157
157
|
var _a, _b, _c, _d;
|
158
158
|
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
159
|
-
return (react_1.default.createElement(VideoWidget_1.default, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex }));
|
159
|
+
return (react_1.default.createElement(VideoWidget_1.default, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost }));
|
160
160
|
}
|
161
161
|
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
162
|
-
return (react_1.default.createElement(PictureGroup_1.default, { key: rec.video.itemId, imgUrls: rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent }));
|
162
|
+
return (react_1.default.createElement(PictureGroup_1.default, { key: rec.video.itemId, imgUrls: rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
163
163
|
}
|
164
164
|
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
165
165
|
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|
@@ -196,7 +196,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
196
196
|
react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
|
197
197
|
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
|
198
198
|
react_1.default.createElement("div", null,
|
199
|
-
react_1.default.createElement(ExpandableText_1.default, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign({}, descStyle), onChange: onExpandableChange }),
|
199
|
+
react_1.default.createElement(ExpandableText_1.default, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
|
200
200
|
react_1.default.createElement(Hashtag_1.default, { index: activeIndex, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle })))));
|
201
201
|
}
|
202
202
|
return null;
|
@@ -18,7 +18,7 @@ const Img = ({ src, rec, item, index }) => {
|
|
18
18
|
}, rec, item, index);
|
19
19
|
}
|
20
20
|
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
21
|
-
return (react_1.default.createElement("div", { ref: ref, hidden: !src },
|
21
|
+
return (react_1.default.createElement("div", { ref: ref, hidden: !src, className: (0, css_1.css)({ width: '100%', height: '100%' }) },
|
22
22
|
react_1.default.createElement(FormatImage_1.default, { className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), src: src })));
|
23
23
|
};
|
24
24
|
exports.default = (0, react_1.memo)(Img);
|