pb-sxp-ui 1.0.54 → 1.0.55
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 +41 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +41 -40
- 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 +41 -40
- 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/index.js +5 -0
- package/lib/core/components/SxpPageRender/index.js +5 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -12698,11 +12698,47 @@ const Nudge = ({ nudge }) => {
|
|
12698
12698
|
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 : '')))));
|
12699
12699
|
};
|
12700
12700
|
|
12701
|
+
const DEFAULT_TAG = 'FOR U';
|
12702
|
+
const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
12703
|
+
const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
|
12704
|
+
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = useSxpDataSource();
|
12705
|
+
const realTagList = React.useMemo(() => {
|
12706
|
+
return [DEFAULT_TAG, ...tagList];
|
12707
|
+
}, [tagList]);
|
12708
|
+
const handleSelectTag = (tag) => () => {
|
12709
|
+
if (tag === selectTag)
|
12710
|
+
return;
|
12711
|
+
let hashTag;
|
12712
|
+
if (tag !== DEFAULT_TAG) {
|
12713
|
+
hashTag = tag;
|
12714
|
+
}
|
12715
|
+
setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
|
12716
|
+
getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ hashTag }).then((res) => {
|
12717
|
+
var _a, _b, _c, _d;
|
12718
|
+
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
|
12719
|
+
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
|
12720
|
+
setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
|
12721
|
+
setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(0);
|
12722
|
+
(_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);
|
12723
|
+
}).finally(() => {
|
12724
|
+
setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
|
12725
|
+
});
|
12726
|
+
setSelectTag(tag);
|
12727
|
+
};
|
12728
|
+
if (tagList.length <= 0)
|
12729
|
+
return null;
|
12730
|
+
return (React.createElement("div", { className: 'clc-sxp-tagbar' },
|
12731
|
+
React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
|
12732
|
+
return (React.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
|
12733
|
+
}))));
|
12734
|
+
};
|
12735
|
+
var Tagbar$1 = React.memo(Tagbar);
|
12736
|
+
|
12701
12737
|
/*
|
12702
12738
|
* @Author: binruan@chatlabs.com
|
12703
12739
|
* @Date: 2024-01-15 19:03:09
|
12704
12740
|
* @LastEditors: binruan@chatlabs.com
|
12705
|
-
* @LastEditTime: 2024-05-
|
12741
|
+
* @LastEditTime: 2024-05-09 16:23:59
|
12706
12742
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
12707
12743
|
*
|
12708
12744
|
*/
|
@@ -12879,9 +12915,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12879
12915
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
12880
12916
|
minusHeight += 45;
|
12881
12917
|
}
|
12882
|
-
|
12883
|
-
|
12884
|
-
|
12918
|
+
if (tagList.length > 0) {
|
12919
|
+
minusHeight += 45;
|
12920
|
+
}
|
12885
12921
|
return containerHeight - minusHeight;
|
12886
12922
|
}, [globalConfig, containerHeight, tagList]);
|
12887
12923
|
const renderLogo = React.useMemo(() => {
|
@@ -13111,6 +13147,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13111
13147
|
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
13112
13148
|
} })),
|
13113
13149
|
renderLogo,
|
13150
|
+
React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex }),
|
13114
13151
|
isShowFingerTip ? React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
|
13115
13152
|
React.createElement(Swiper, { ref: swiperRef, onSlideChange: () => {
|
13116
13153
|
swiperRef.current.swiper.allowTouchMove = false;
|
@@ -13171,42 +13208,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13171
13208
|
React.createElement("div", { id: 'player-container-id-copy' }))));
|
13172
13209
|
};
|
13173
13210
|
|
13174
|
-
const DEFAULT_TAG = 'FOR U';
|
13175
|
-
const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
13176
|
-
const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
|
13177
|
-
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = useSxpDataSource();
|
13178
|
-
const realTagList = React.useMemo(() => {
|
13179
|
-
return [DEFAULT_TAG, ...tagList];
|
13180
|
-
}, [tagList]);
|
13181
|
-
const handleSelectTag = (tag) => () => {
|
13182
|
-
if (tag === selectTag)
|
13183
|
-
return;
|
13184
|
-
let hashTag;
|
13185
|
-
if (tag !== DEFAULT_TAG) {
|
13186
|
-
hashTag = tag;
|
13187
|
-
}
|
13188
|
-
setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
|
13189
|
-
getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ hashTag }).then((res) => {
|
13190
|
-
var _a, _b, _c, _d;
|
13191
|
-
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
|
13192
|
-
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
|
13193
|
-
setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
|
13194
|
-
setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(0);
|
13195
|
-
(_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);
|
13196
|
-
}).finally(() => {
|
13197
|
-
setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
|
13198
|
-
});
|
13199
|
-
setSelectTag(tag);
|
13200
|
-
};
|
13201
|
-
if (tagList.length <= 0)
|
13202
|
-
return null;
|
13203
|
-
return (React.createElement("div", { className: 'clc-sxp-tagbar' },
|
13204
|
-
React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
|
13205
|
-
return (React.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
|
13206
|
-
}))));
|
13207
|
-
};
|
13208
|
-
var Tagbar$1 = React.memo(Tagbar);
|
13209
|
-
|
13210
13211
|
const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
|
13211
13212
|
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) => {
|
13212
13213
|
return (React.createElement(SwiperSlide, { key: url },
|