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.js CHANGED
@@ -12675,11 +12675,47 @@ const Nudge = ({ nudge }) => {
12675
12675
  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 : '')))));
12676
12676
  };
12677
12677
 
12678
+ const DEFAULT_TAG = 'FOR U';
12679
+ const Tagbar = ({ tagList = [], setActiveIndex }) => {
12680
+ const [selectTag, setSelectTag] = useState(DEFAULT_TAG);
12681
+ const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = useSxpDataSource();
12682
+ const realTagList = useMemo(() => {
12683
+ return [DEFAULT_TAG, ...tagList];
12684
+ }, [tagList]);
12685
+ const handleSelectTag = (tag) => () => {
12686
+ if (tag === selectTag)
12687
+ return;
12688
+ let hashTag;
12689
+ if (tag !== DEFAULT_TAG) {
12690
+ hashTag = tag;
12691
+ }
12692
+ setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
12693
+ getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ hashTag }).then((res) => {
12694
+ var _a, _b, _c, _d;
12695
+ setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
12696
+ setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
12697
+ setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
12698
+ setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(0);
12699
+ (_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);
12700
+ }).finally(() => {
12701
+ setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
12702
+ });
12703
+ setSelectTag(tag);
12704
+ };
12705
+ if (tagList.length <= 0)
12706
+ return null;
12707
+ return (React.createElement("div", { className: 'clc-sxp-tagbar' },
12708
+ React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
12709
+ return (React.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
12710
+ }))));
12711
+ };
12712
+ var Tagbar$1 = memo(Tagbar);
12713
+
12678
12714
  /*
12679
12715
  * @Author: binruan@chatlabs.com
12680
12716
  * @Date: 2024-01-15 19:03:09
12681
12717
  * @LastEditors: binruan@chatlabs.com
12682
- * @LastEditTime: 2024-05-07 17:16:06
12718
+ * @LastEditTime: 2024-05-09 16:23:59
12683
12719
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12684
12720
  *
12685
12721
  */
@@ -12856,9 +12892,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12856
12892
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
12857
12893
  minusHeight += 45;
12858
12894
  }
12859
- // if (tagList.length > 0) {
12860
- // minusHeight += 45;
12861
- // }
12895
+ if (tagList.length > 0) {
12896
+ minusHeight += 45;
12897
+ }
12862
12898
  return containerHeight - minusHeight;
12863
12899
  }, [globalConfig, containerHeight, tagList]);
12864
12900
  const renderLogo = useMemo(() => {
@@ -13088,6 +13124,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
13088
13124
  setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
13089
13125
  } })),
13090
13126
  renderLogo,
13127
+ React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex }),
13091
13128
  isShowFingerTip ? React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
13092
13129
  React.createElement(Swiper, { ref: swiperRef, onSlideChange: () => {
13093
13130
  swiperRef.current.swiper.allowTouchMove = false;
@@ -13148,42 +13185,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
13148
13185
  React.createElement("div", { id: 'player-container-id-copy' }))));
13149
13186
  };
13150
13187
 
13151
- const DEFAULT_TAG = 'FOR U';
13152
- const Tagbar = ({ tagList = [], setActiveIndex }) => {
13153
- const [selectTag, setSelectTag] = useState(DEFAULT_TAG);
13154
- const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = useSxpDataSource();
13155
- const realTagList = useMemo(() => {
13156
- return [DEFAULT_TAG, ...tagList];
13157
- }, [tagList]);
13158
- const handleSelectTag = (tag) => () => {
13159
- if (tag === selectTag)
13160
- return;
13161
- let hashTag;
13162
- if (tag !== DEFAULT_TAG) {
13163
- hashTag = tag;
13164
- }
13165
- setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
13166
- getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ hashTag }).then((res) => {
13167
- var _a, _b, _c, _d;
13168
- setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
13169
- setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
13170
- setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
13171
- setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(0);
13172
- (_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);
13173
- }).finally(() => {
13174
- setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
13175
- });
13176
- setSelectTag(tag);
13177
- };
13178
- if (tagList.length <= 0)
13179
- return null;
13180
- return (React.createElement("div", { className: 'clc-sxp-tagbar' },
13181
- React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
13182
- return (React.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
13183
- }))));
13184
- };
13185
- var Tagbar$1 = memo(Tagbar);
13186
-
13187
13188
  const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
13188
13189
  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) => {
13189
13190
  return (React.createElement(SwiperSlide, { key: url },