pb-sxp-ui 1.0.48 → 1.0.50
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 +58 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +58 -55
- 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 +58 -55
- 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 +6 -3
- package/es/core/components/SxpPageRender/WaterFall/List.js +2 -1
- package/es/core/components/SxpPageRender/index.js +0 -5
- package/es/core/context/SxpDataSourceProvider.js +10 -10
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +6 -3
- package/lib/core/components/SxpPageRender/WaterFall/List.js +2 -1
- package/lib/core/components/SxpPageRender/index.js +0 -5
- package/lib/core/context/SxpDataSourceProvider.js +10 -10
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -489,20 +489,20 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
489
489
|
}, [bffDataSource]);
|
490
490
|
// 获取推荐视频数据
|
491
491
|
const getRecommendVideos = React.useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
492
|
-
var _a, _b, _c, _d;
|
492
|
+
var _a, _b, _c, _d, _e;
|
493
493
|
query = {
|
494
|
-
maxSize,
|
495
|
-
defaultSize: (
|
494
|
+
maxSize: (_a = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _a !== void 0 ? _a : maxSize,
|
495
|
+
defaultSize: (_b = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _b !== void 0 ? _b : defaultSize,
|
496
496
|
'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
|
497
497
|
'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
|
498
498
|
hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
|
499
499
|
traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo
|
500
500
|
};
|
501
501
|
if (utmVal) {
|
502
|
-
const val = (
|
502
|
+
const val = (_e = (_d = (_c = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _c === void 0 ? void 0 : _c.filter((val) => {
|
503
503
|
const key = val.split('=')[0];
|
504
504
|
return UTM_KEYS.includes(key);
|
505
|
-
})) === null ||
|
505
|
+
})) === null || _d === void 0 ? void 0 : _d.join('&')) !== null && _e !== void 0 ? _e : '';
|
506
506
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
507
507
|
}
|
508
508
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
@@ -514,7 +514,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
514
514
|
return result === null || result === void 0 ? void 0 : result.data;
|
515
515
|
}), [bffFetch, utmVal, maxSize, defaultSize]);
|
516
516
|
const loadVideos = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
517
|
-
var
|
517
|
+
var _f, _g;
|
518
518
|
if (rtcList.length <= 0) {
|
519
519
|
return;
|
520
520
|
}
|
@@ -523,8 +523,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
523
523
|
'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
|
524
524
|
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
|
525
525
|
});
|
526
|
-
setRtcList(rtcList.concat((
|
527
|
-
setCacheRtcList(cacheRtcList.concat((
|
526
|
+
setRtcList(rtcList.concat((_f = data === null || data === void 0 ? void 0 : data.recList) !== null && _f !== void 0 ? _f : []));
|
527
|
+
setCacheRtcList(cacheRtcList.concat((_g = data === null || data === void 0 ? void 0 : data.recList) !== null && _g !== void 0 ? _g : []));
|
528
528
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
529
529
|
const bffEventReport = React.useCallback(({ userInfo, eventInfo }) => {
|
530
530
|
// 关闭 BFF 事件上报
|
@@ -568,12 +568,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
568
568
|
}), [bffFetch]);
|
569
569
|
// 获取 Tag
|
570
570
|
const bffGetTagList = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
571
|
-
var
|
571
|
+
var _h, _j;
|
572
572
|
if (!utmVal)
|
573
573
|
return;
|
574
574
|
try {
|
575
575
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: utmVal } }));
|
576
|
-
setTagList((
|
576
|
+
setTagList((_j = (_h = result === null || result === void 0 ? void 0 : result.data) === null || _h === void 0 ? void 0 : _h.tags) !== null && _j !== void 0 ? _j : []);
|
577
577
|
}
|
578
578
|
catch (e) {
|
579
579
|
console.log('e', e);
|
@@ -11730,7 +11730,8 @@ function WaterfallList(_a) {
|
|
11730
11730
|
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
|
11731
11731
|
'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
|
11732
11732
|
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
11733
|
-
defaultSize: hashTagSize
|
11733
|
+
defaultSize: hashTagSize,
|
11734
|
+
maxSize: hashTagSize
|
11734
11735
|
}).then((res) => {
|
11735
11736
|
var _a, _b;
|
11736
11737
|
setData(res);
|
@@ -12141,10 +12142,13 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12141
12142
|
}, [bffEventReport, data, index, isFirstPlay, videoRef]);
|
12142
12143
|
const handLoadeddata = React.useCallback(() => {
|
12143
12144
|
var _a;
|
12144
|
-
if (!videoRef ||
|
12145
|
+
if (!videoRef || firstFrameSrc || !blur)
|
12145
12146
|
return;
|
12146
12147
|
const videoDomRef = document.getElementById('player-container-id_html5_api');
|
12147
|
-
if (
|
12148
|
+
if (!videoDomRef)
|
12149
|
+
return;
|
12150
|
+
videoDomRef.style.objectFit = 'contain';
|
12151
|
+
if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !canvasRef.current || isBgColor)
|
12148
12152
|
return;
|
12149
12153
|
const setFrameImg = () => {
|
12150
12154
|
const video = videoDomRef;
|
@@ -12161,7 +12165,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12161
12165
|
setTimeout(() => {
|
12162
12166
|
setFrameImg();
|
12163
12167
|
}, 500);
|
12164
|
-
}, [videoRef, isBgColor, rec, firstFrameSrc]);
|
12168
|
+
}, [videoRef, isBgColor, rec, firstFrameSrc, blur]);
|
12165
12169
|
const handleLoadedmetadata = React.useCallback(() => {
|
12166
12170
|
if (!videoRef)
|
12167
12171
|
return;
|
@@ -12654,47 +12658,11 @@ const Nudge = ({ nudge }) => {
|
|
12654
12658
|
React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, (_g = nudge === null || nudge === void 0 ? void 0 : nudge.content) !== null && _g !== void 0 ? _g : '')))));
|
12655
12659
|
};
|
12656
12660
|
|
12657
|
-
const DEFAULT_TAG = 'FOR U';
|
12658
|
-
const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
12659
|
-
const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
|
12660
|
-
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = useSxpDataSource();
|
12661
|
-
const realTagList = React.useMemo(() => {
|
12662
|
-
return [DEFAULT_TAG, ...tagList];
|
12663
|
-
}, [tagList]);
|
12664
|
-
const handleSelectTag = (tag) => () => {
|
12665
|
-
if (tag === selectTag)
|
12666
|
-
return;
|
12667
|
-
let hashTag;
|
12668
|
-
if (tag !== DEFAULT_TAG) {
|
12669
|
-
hashTag = tag;
|
12670
|
-
}
|
12671
|
-
setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
|
12672
|
-
getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ hashTag }).then((res) => {
|
12673
|
-
var _a, _b, _c, _d;
|
12674
|
-
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
|
12675
|
-
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
|
12676
|
-
setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
|
12677
|
-
setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(0);
|
12678
|
-
(_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slideTo(0);
|
12679
|
-
}).finally(() => {
|
12680
|
-
setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
|
12681
|
-
});
|
12682
|
-
setSelectTag(tag);
|
12683
|
-
};
|
12684
|
-
if (tagList.length <= 0)
|
12685
|
-
return null;
|
12686
|
-
return (React.createElement("div", { className: 'clc-sxp-tagbar' },
|
12687
|
-
React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
|
12688
|
-
return (React.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
|
12689
|
-
}))));
|
12690
|
-
};
|
12691
|
-
var Tagbar$1 = React.memo(Tagbar);
|
12692
|
-
|
12693
12661
|
/*
|
12694
12662
|
* @Author: binruan@chatlabs.com
|
12695
12663
|
* @Date: 2024-01-15 19:03:09
|
12696
12664
|
* @LastEditors: binruan@chatlabs.com
|
12697
|
-
* @LastEditTime: 2024-04-
|
12665
|
+
* @LastEditTime: 2024-04-30 16:16:05
|
12698
12666
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
12699
12667
|
*
|
12700
12668
|
*/
|
@@ -12868,9 +12836,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12868
12836
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
12869
12837
|
minusHeight += 45;
|
12870
12838
|
}
|
12871
|
-
if (tagList.length > 0) {
|
12872
|
-
|
12873
|
-
}
|
12839
|
+
// if (tagList.length > 0) {
|
12840
|
+
// minusHeight += 45;
|
12841
|
+
// }
|
12874
12842
|
return containerHeight - minusHeight;
|
12875
12843
|
}, [globalConfig, containerHeight, tagList]);
|
12876
12844
|
const renderLogo = React.useMemo(() => {
|
@@ -13094,7 +13062,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13094
13062
|
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
13095
13063
|
} })),
|
13096
13064
|
renderLogo,
|
13097
|
-
React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex }),
|
13098
13065
|
isShowFingerTip ? React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
|
13099
13066
|
React.createElement(Swiper, { ref: swiperRef, onSlideChange: () => {
|
13100
13067
|
swiperRef.current.swiper.allowTouchMove = false;
|
@@ -13155,6 +13122,42 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13155
13122
|
React.createElement("div", { id: 'player-container-id-copy' }))));
|
13156
13123
|
};
|
13157
13124
|
|
13125
|
+
const DEFAULT_TAG = 'FOR U';
|
13126
|
+
const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
13127
|
+
const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
|
13128
|
+
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = useSxpDataSource();
|
13129
|
+
const realTagList = React.useMemo(() => {
|
13130
|
+
return [DEFAULT_TAG, ...tagList];
|
13131
|
+
}, [tagList]);
|
13132
|
+
const handleSelectTag = (tag) => () => {
|
13133
|
+
if (tag === selectTag)
|
13134
|
+
return;
|
13135
|
+
let hashTag;
|
13136
|
+
if (tag !== DEFAULT_TAG) {
|
13137
|
+
hashTag = tag;
|
13138
|
+
}
|
13139
|
+
setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
|
13140
|
+
getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ hashTag }).then((res) => {
|
13141
|
+
var _a, _b, _c, _d;
|
13142
|
+
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
|
13143
|
+
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
|
13144
|
+
setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
|
13145
|
+
setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(0);
|
13146
|
+
(_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slideTo(0);
|
13147
|
+
}).finally(() => {
|
13148
|
+
setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
|
13149
|
+
});
|
13150
|
+
setSelectTag(tag);
|
13151
|
+
};
|
13152
|
+
if (tagList.length <= 0)
|
13153
|
+
return null;
|
13154
|
+
return (React.createElement("div", { className: 'clc-sxp-tagbar' },
|
13155
|
+
React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
|
13156
|
+
return (React.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
|
13157
|
+
}))));
|
13158
|
+
};
|
13159
|
+
var Tagbar$1 = React.memo(Tagbar);
|
13160
|
+
|
13158
13161
|
const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
|
13159
13162
|
return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, height: height, style: { width }, loop: true, autoplay: false }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url) => {
|
13160
13163
|
return (React.createElement(SwiperSlide, { key: url },
|