pb-sxp-ui 1.0.94 → 1.0.96
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 +13 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -5
- 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 +13 -5
- 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/VideoWidget/index.js +11 -3
- package/es/materials/sxp/template/MultiCommodity/index.js +2 -2
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +11 -3
- package/lib/materials/sxp/template/MultiCommodity/index.js +2 -2
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
@@ -10267,7 +10267,7 @@ Made in Italy` })));
|
|
10267
10267
|
}
|
10268
10268
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10269
10269
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
10270
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
10270
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
10271
10271
|
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: item.itemId, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
10272
10272
|
React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
10273
10273
|
React.createElement("div", { className: css.css({
|
@@ -10279,7 +10279,7 @@ Made in Italy` })));
|
|
10279
10279
|
overflow: 'hidden'
|
10280
10280
|
}) },
|
10281
10281
|
React.createElement("div", { className: styles$1['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name'),
|
10282
|
-
React.createElement("div", { className: css.css(Object.assign({ padding: '
|
10282
|
+
React.createElement("div", { className: css.css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', lineHeight: ((_f = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _f === void 0 ? void 0 : _f.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_h = (_g = item === null || item === void 0 ? void 0 : item.bindCta) === null || _g === void 0 ? void 0 : _g.enTitle) !== null && _h !== void 0 ? _h : 'Shop Now'))))));
|
10283
10283
|
})));
|
10284
10284
|
};
|
10285
10285
|
var MultiCommodityComponent = React.memo(MultiCommodity$1);
|
@@ -12910,11 +12910,15 @@ Made in Italy` })));
|
|
12910
12910
|
}, [videoRef]);
|
12911
12911
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
12912
12912
|
const handlePlaying = React.useCallback(() => {
|
12913
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
12914
12913
|
if (!videoRef)
|
12915
12914
|
return;
|
12916
12915
|
setWaiting(false);
|
12917
12916
|
setIsLoadFinish(true);
|
12917
|
+
}, []);
|
12918
|
+
const handleStartPlay = React.useCallback(() => {
|
12919
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
12920
|
+
if (!videoRef)
|
12921
|
+
return;
|
12918
12922
|
setIsPauseVideo(false);
|
12919
12923
|
const item = data[index];
|
12920
12924
|
if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration)) {
|
@@ -12965,8 +12969,9 @@ Made in Italy` })));
|
|
12965
12969
|
const handleLoadedmetadata = React.useCallback(() => {
|
12966
12970
|
if (!videoRef)
|
12967
12971
|
return;
|
12972
|
+
handleStartPlay();
|
12968
12973
|
handLoadeddata();
|
12969
|
-
}, [videoRef, handLoadeddata]);
|
12974
|
+
}, [videoRef, handLoadeddata, handleStartPlay]);
|
12970
12975
|
const handleClickVideo = React.useCallback((type) => () => {
|
12971
12976
|
if (!videoRef)
|
12972
12977
|
return;
|
@@ -13056,6 +13061,7 @@ Made in Italy` })));
|
|
13056
13061
|
videoRef.setAttribute('webkit-playsinline', 'true');
|
13057
13062
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadedmetadata', handleLoadedmetadata);
|
13058
13063
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadeddata', handLoadeddata);
|
13064
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('play', handleStartPlay);
|
13059
13065
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('playing', handlePlaying);
|
13060
13066
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('pause', handlePause);
|
13061
13067
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('ended', handlePlay);
|
@@ -13066,9 +13072,11 @@ Made in Italy` })));
|
|
13066
13072
|
dom2 === null || dom2 === void 0 ? void 0 : dom2.appendChild(dom);
|
13067
13073
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadedmetadata', handleLoadedmetadata);
|
13068
13074
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadeddata', handLoadeddata);
|
13075
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('play', handleStartPlay);
|
13069
13076
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('playing', handlePlaying);
|
13070
13077
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('pause', handlePause);
|
13071
13078
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('ended', handlePlay);
|
13079
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('canplay', handlePlay);
|
13072
13080
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('waiting', handleWaiting);
|
13073
13081
|
};
|
13074
13082
|
}, [isActive, videoId, rec, videoRef]);
|
@@ -13162,7 +13170,7 @@ Made in Italy` })));
|
|
13162
13170
|
return null;
|
13163
13171
|
}
|
13164
13172
|
return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, onClick: handleClickVideo(), style: Object.assign({ position: 'relative', width: '100%', height, overflow: 'hidden' }, bgStyle) },
|
13165
|
-
!isBgColor && isLoadFinish && (React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) })),
|
13173
|
+
!isBgColor && isLoadFinish && blurBgSrc && (React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) })),
|
13166
13174
|
React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
|
13167
13175
|
React.createElement("div", { style: {
|
13168
13176
|
position: 'absolute',
|