pb-sxp-ui 1.0.24 → 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 +61 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +61 -23
- 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 +61 -23
- 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/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/VideoWidget/index.d.ts +2 -0
- package/es/core/components/SxpPageRender/VideoWidget/index.js +41 -3
- package/es/core/components/SxpPageRender/index.d.ts +8 -1
- package/es/core/components/SxpPageRender/index.js +2 -2
- 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/VideoWidget/index.d.ts +2 -0
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +41 -3
- package/lib/core/components/SxpPageRender/index.d.ts +8 -1
- package/lib/core/components/SxpPageRender/index.js +2 -2
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
@@ -11981,7 +11981,7 @@ Made in Italy` })));
|
|
11981
11981
|
SXP_EVENT_TYPE["PAGE_DID_HIDE"] = "pageDidHide";
|
11982
11982
|
})(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
|
11983
11983
|
|
11984
|
-
const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
11984
|
+
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig }) => {
|
11985
11985
|
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
11986
11986
|
const videoRef = React.useRef(null);
|
11987
11987
|
const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
|
@@ -12170,17 +12170,54 @@ Made in Italy` })));
|
|
12170
12170
|
window.removeEventListener('beforeunload', handleBeforeUnload);
|
12171
12171
|
};
|
12172
12172
|
}, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
|
12173
|
+
const blur = React.useMemo(() => {
|
12174
|
+
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
12175
|
+
}, [videoPostConfig]);
|
12176
|
+
const translateY = React.useMemo(() => {
|
12177
|
+
var _a;
|
12178
|
+
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
|
12179
|
+
? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%)`
|
12180
|
+
: 'translateY(-50%)';
|
12181
|
+
}, [videoPostConfig]);
|
12173
12182
|
if (!rec.video) {
|
12174
12183
|
return null;
|
12175
12184
|
}
|
12176
|
-
return (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
12185
|
+
return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
12186
|
+
position: 'relative',
|
12187
|
+
width: '100%',
|
12188
|
+
height
|
12189
|
+
} },
|
12190
|
+
React.createElement(FormatImage$1, { src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, style: {
|
12191
|
+
height: '100%',
|
12192
|
+
width: '100%',
|
12193
|
+
objectFit: 'cover',
|
12194
|
+
filter: blur ? 'blur(10px)' : 'none',
|
12195
|
+
transform: blur ? 'scale(1.2)' : 'none'
|
12196
|
+
} }),
|
12197
|
+
React.createElement("div", { style: {
|
12198
|
+
position: 'absolute',
|
12199
|
+
width: '100%',
|
12200
|
+
height: 'auto',
|
12201
|
+
top: '50%',
|
12202
|
+
transform: translateY,
|
12203
|
+
left: 0,
|
12204
|
+
right: 0
|
12205
|
+
} },
|
12206
|
+
React.createElement("div", { style: { position: 'relative' } },
|
12207
|
+
React.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: {
|
12208
|
+
width: '100%',
|
12209
|
+
height: 'auto',
|
12210
|
+
objectFit: 'contain'
|
12211
|
+
} }),
|
12212
|
+
renderPoster,
|
12213
|
+
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))))) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
12177
12214
|
position: 'relative',
|
12178
12215
|
width: '100%',
|
12179
12216
|
height
|
12180
12217
|
} },
|
12181
12218
|
React.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 }),
|
12182
12219
|
renderPoster,
|
12183
|
-
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })));
|
12220
|
+
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
12184
12221
|
};
|
12185
12222
|
var VideoWidget$1 = React.memo(VideoWidget);
|
12186
12223
|
|
@@ -12233,21 +12270,21 @@ Made in Italy` })));
|
|
12233
12270
|
* @Author: binruan@chatlabs.com
|
12234
12271
|
* @Date: 2024-03-20 10:27:31
|
12235
12272
|
* @LastEditors: binruan@chatlabs.com
|
12236
|
-
* @LastEditTime: 2024-04-18
|
12273
|
+
* @LastEditTime: 2024-04-18 19:27:35
|
12237
12274
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\Picture.tsx
|
12238
12275
|
*
|
12239
12276
|
*/
|
12240
12277
|
const Picture = (props) => {
|
12241
|
-
const { src, height,
|
12242
|
-
const
|
12243
|
-
|
12244
|
-
|
12245
|
-
|
12246
|
-
|
12247
|
-
|
12248
|
-
|
12249
|
-
|
12250
|
-
};
|
12278
|
+
const { src, height, imgUrlsPostConfig } = props;
|
12279
|
+
const blur = React.useMemo(() => {
|
12280
|
+
return (imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.mode) === '2';
|
12281
|
+
}, [imgUrlsPostConfig]);
|
12282
|
+
const translateY = React.useMemo(() => {
|
12283
|
+
var _a;
|
12284
|
+
return (imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.mode) === '2'
|
12285
|
+
? `translateY(-${50 + ((_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%)`
|
12286
|
+
: 'translateY(-50%)';
|
12287
|
+
}, [imgUrlsPostConfig]);
|
12251
12288
|
return (React.createElement("div", { style: {
|
12252
12289
|
overflow: 'hidden',
|
12253
12290
|
height,
|
@@ -12260,13 +12297,13 @@ Made in Italy` })));
|
|
12260
12297
|
objectFit: 'cover',
|
12261
12298
|
filter: blur ? 'blur(10px)' : 'none',
|
12262
12299
|
transform: blur ? 'scale(1.2)' : 'none'
|
12263
|
-
}
|
12300
|
+
} }),
|
12264
12301
|
blur && (React.createElement(FormatImage$1, { src: src, style: {
|
12265
12302
|
width: '100%',
|
12266
12303
|
objectFit: 'contain',
|
12267
12304
|
position: 'absolute',
|
12268
12305
|
top: '50%',
|
12269
|
-
transform:
|
12306
|
+
transform: translateY,
|
12270
12307
|
left: 0,
|
12271
12308
|
right: 0
|
12272
12309
|
} }))));
|
@@ -12276,10 +12313,11 @@ Made in Italy` })));
|
|
12276
12313
|
* @Author: lewinlu@chatlabs.com
|
12277
12314
|
* @Date: 2024-01-03 14:39:09
|
12278
12315
|
* @LastEditors: binruan@chatlabs.com
|
12279
|
-
* @LastEditTime: 2024-04-
|
12316
|
+
* @LastEditTime: 2024-04-18 19:56:22
|
12280
12317
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
|
12281
12318
|
*/
|
12282
|
-
const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent }) => {
|
12319
|
+
const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
12320
|
+
var _a;
|
12283
12321
|
const ref = React.useRef();
|
12284
12322
|
const { isActive } = useSwiperSlide();
|
12285
12323
|
const { sxpParameter, openHashtag } = useSxpDataSource();
|
@@ -12302,9 +12340,9 @@ Made in Italy` })));
|
|
12302
12340
|
// if (!isActive) {
|
12303
12341
|
// return <img src={sxpParameter?.placeholder_image} style={{ width, height, objectFit: 'cover' }} />;
|
12304
12342
|
// }
|
12305
|
-
return (React.createElement(Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, height: height, loop: true, autoplay: { delay:
|
12343
|
+
return (React.createElement(Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, height: height, loop: true, autoplay: { delay: ((_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.delay) !== null && _a !== void 0 ? _a : 3) * 1000 } }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url) => {
|
12306
12344
|
return (React.createElement(SwiperSlide, { key: url },
|
12307
|
-
React.createElement(Picture, { src: url,
|
12345
|
+
React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
|
12308
12346
|
})));
|
12309
12347
|
};
|
12310
12348
|
var PictureGroup$1 = React.memo(PictureGroup);
|
@@ -12486,7 +12524,7 @@ Made in Italy` })));
|
|
12486
12524
|
* @Author: binruan@chatlabs.com
|
12487
12525
|
* @Date: 2024-01-15 19:03:09
|
12488
12526
|
* @LastEditors: binruan@chatlabs.com
|
12489
|
-
* @LastEditTime: 2024-04-18
|
12527
|
+
* @LastEditTime: 2024-04-18 19:27:03
|
12490
12528
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
12491
12529
|
*
|
12492
12530
|
*/
|
@@ -12647,10 +12685,10 @@ Made in Italy` })));
|
|
12647
12685
|
const renderContent = React.useCallback((rec, index) => {
|
12648
12686
|
var _a, _b, _c, _d;
|
12649
12687
|
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
12650
|
-
return (React.createElement(VideoWidget$1, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex }));
|
12688
|
+
return (React.createElement(VideoWidget$1, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost }));
|
12651
12689
|
}
|
12652
12690
|
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
12653
|
-
return (React.createElement(PictureGroup$1, { key: rec.video.itemId, imgUrls: rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent }));
|
12691
|
+
return (React.createElement(PictureGroup$1, { 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 }));
|
12654
12692
|
}
|
12655
12693
|
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) {
|
12656
12694
|
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|