pb-sxp-ui 1.0.48 → 1.0.49

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.
@@ -84,12 +84,13 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
84
84
  }, [bffEventReport, data, index, isFirstPlay, videoRef]);
85
85
  const handLoadeddata = useCallback(() => {
86
86
  var _a;
87
- if (!videoRef || isBgColor || firstFrameSrc)
87
+ if (!videoRef || isBgColor || firstFrameSrc || !blur)
88
88
  return;
89
89
  const videoDomRef = document.getElementById('player-container-id_html5_api');
90
90
  if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
91
91
  return;
92
92
  const setFrameImg = () => {
93
+ videoDomRef.style.objectFit = 'contain';
93
94
  const video = videoDomRef;
94
95
  const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
95
96
  const ctx = canvas.getContext('2d');
@@ -104,7 +105,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
104
105
  setTimeout(() => {
105
106
  setFrameImg();
106
107
  }, 500);
107
- }, [videoRef, isBgColor, rec, firstFrameSrc]);
108
+ }, [videoRef, isBgColor, rec, firstFrameSrc, blur]);
108
109
  const handleLoadedmetadata = useCallback(() => {
109
110
  if (!videoRef)
110
111
  return;
@@ -148,7 +148,8 @@ export default function WaterfallList(_a) {
148
148
  hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
149
149
  'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
150
150
  'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
151
- defaultSize: hashTagSize
151
+ defaultSize: hashTagSize,
152
+ maxSize: hashTagSize
152
153
  }).then((res) => {
153
154
  var _a, _b;
154
155
  setData(res);
@@ -21,7 +21,6 @@ import './index.less';
21
21
  import { useEventReport } from '../../../core/hooks/useEventReport';
22
22
  import withBindDataSource from '../../../core/hoc/withBindDataSource';
23
23
  import { getFeUserId } from '../../../core/utils/localStore';
24
- import Tagbar from './Tagbar';
25
24
  const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
26
25
  var _a, _b, _c, _d, _e, _f, _g;
27
26
  const { schema } = useEditor();
@@ -389,7 +388,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
389
388
  setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
390
389
  } })),
391
390
  renderLogo,
392
- React.createElement(Tagbar, { tagList: tagList, setActiveIndex: setActiveIndex }),
393
391
  isShowFingerTip ? React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
394
392
  React.createElement(Swiper, { ref: swiperRef, onSlideChange: () => {
395
393
  swiperRef.current.swiper.allowTouchMove = false;
@@ -57,20 +57,20 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
57
57
  .catch((err) => Promise.reject(err));
58
58
  }, [bffDataSource]);
59
59
  const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
60
- var _a, _b, _c, _d;
60
+ var _a, _b, _c, _d, _e;
61
61
  query = {
62
- maxSize,
63
- defaultSize: (_a = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _a !== void 0 ? _a : defaultSize,
62
+ maxSize: (_a = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _a !== void 0 ? _a : maxSize,
63
+ defaultSize: (_b = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _b !== void 0 ? _b : defaultSize,
64
64
  'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
65
65
  'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
66
66
  hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
67
67
  traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo
68
68
  };
69
69
  if (utmVal) {
70
- const val = (_d = (_c = (_b = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _b === void 0 ? void 0 : _b.filter((val) => {
70
+ const val = (_e = (_d = (_c = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _c === void 0 ? void 0 : _c.filter((val) => {
71
71
  const key = val.split('=')[0];
72
72
  return UTM_KEYS.includes(key);
73
- })) === null || _c === void 0 ? void 0 : _c.join('&')) !== null && _d !== void 0 ? _d : '';
73
+ })) === null || _d === void 0 ? void 0 : _d.join('&')) !== null && _e !== void 0 ? _e : '';
74
74
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
75
75
  }
76
76
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
@@ -82,7 +82,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
82
82
  return result === null || result === void 0 ? void 0 : result.data;
83
83
  }), [bffFetch, utmVal, maxSize, defaultSize]);
84
84
  const loadVideos = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
85
- var _e, _f;
85
+ var _f, _g;
86
86
  if (rtcList.length <= 0) {
87
87
  return;
88
88
  }
@@ -91,8 +91,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
91
91
  'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
92
92
  'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
93
93
  });
94
- setRtcList(rtcList.concat((_e = data === null || data === void 0 ? void 0 : data.recList) !== null && _e !== void 0 ? _e : []));
95
- setCacheRtcList(cacheRtcList.concat((_f = data === null || data === void 0 ? void 0 : data.recList) !== null && _f !== void 0 ? _f : []));
94
+ setRtcList(rtcList.concat((_f = data === null || data === void 0 ? void 0 : data.recList) !== null && _f !== void 0 ? _f : []));
95
+ setCacheRtcList(cacheRtcList.concat((_g = data === null || data === void 0 ? void 0 : data.recList) !== null && _g !== void 0 ? _g : []));
96
96
  }), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
97
97
  const bffEventReport = useCallback(({ userInfo, eventInfo }) => {
98
98
  if (!enableReportEvent) {
@@ -130,12 +130,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
130
130
  return res === null || res === void 0 ? void 0 : res.success;
131
131
  }), [bffFetch]);
132
132
  const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
133
- var _g, _h;
133
+ var _h, _j;
134
134
  if (!utmVal)
135
135
  return;
136
136
  try {
137
137
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: utmVal } }));
138
- setTagList((_h = (_g = result === null || result === void 0 ? void 0 : result.data) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []);
138
+ 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 : []);
139
139
  }
140
140
  catch (e) {
141
141
  console.log('e', e);
@@ -87,12 +87,13 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
87
87
  }, [bffEventReport, data, index, isFirstPlay, videoRef]);
88
88
  const handLoadeddata = (0, react_1.useCallback)(() => {
89
89
  var _a;
90
- if (!videoRef || isBgColor || firstFrameSrc)
90
+ if (!videoRef || isBgColor || firstFrameSrc || !blur)
91
91
  return;
92
92
  const videoDomRef = document.getElementById('player-container-id_html5_api');
93
93
  if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
94
94
  return;
95
95
  const setFrameImg = () => {
96
+ videoDomRef.style.objectFit = 'contain';
96
97
  const video = videoDomRef;
97
98
  const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
98
99
  const ctx = canvas.getContext('2d');
@@ -107,7 +108,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
107
108
  setTimeout(() => {
108
109
  setFrameImg();
109
110
  }, 500);
110
- }, [videoRef, isBgColor, rec, firstFrameSrc]);
111
+ }, [videoRef, isBgColor, rec, firstFrameSrc, blur]);
111
112
  const handleLoadedmetadata = (0, react_1.useCallback)(() => {
112
113
  if (!videoRef)
113
114
  return;
@@ -150,7 +150,8 @@ function WaterfallList(_a) {
150
150
  hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
151
151
  'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
152
152
  'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
153
- defaultSize: hashTagSize
153
+ defaultSize: hashTagSize,
154
+ maxSize: hashTagSize
154
155
  }).then((res) => {
155
156
  var _a, _b;
156
157
  setData(res);
@@ -24,7 +24,6 @@ require("./index.less");
24
24
  const useEventReport_1 = require("../../../core/hooks/useEventReport");
25
25
  const withBindDataSource_1 = tslib_1.__importDefault(require("../../../core/hoc/withBindDataSource"));
26
26
  const localStore_1 = require("../../../core/utils/localStore");
27
- const Tagbar_1 = tslib_1.__importDefault(require("./Tagbar"));
28
27
  const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
29
28
  var _a, _b, _c, _d, _e, _f, _g;
30
29
  const { schema } = (0, hooks_1.useEditor)();
@@ -392,7 +391,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
392
391
  setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
393
392
  } })),
394
393
  renderLogo,
395
- react_1.default.createElement(Tagbar_1.default, { tagList: tagList, setActiveIndex: setActiveIndex }),
396
394
  isShowFingerTip ? react_1.default.createElement(FingerSwipeTip_1.default, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
397
395
  react_1.default.createElement(react_2.Swiper, { ref: swiperRef, onSlideChange: () => {
398
396
  swiperRef.current.swiper.allowTouchMove = false;
@@ -60,20 +60,20 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
60
60
  .catch((err) => Promise.reject(err));
61
61
  }, [bffDataSource]);
62
62
  const getRecommendVideos = (0, react_1.useCallback)((query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
63
- var _a, _b, _c, _d;
63
+ var _a, _b, _c, _d, _e;
64
64
  query = {
65
- maxSize,
66
- defaultSize: (_a = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _a !== void 0 ? _a : defaultSize,
65
+ maxSize: (_a = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _a !== void 0 ? _a : maxSize,
66
+ defaultSize: (_b = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _b !== void 0 ? _b : defaultSize,
67
67
  'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
68
68
  'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
69
69
  hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
70
70
  traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo
71
71
  };
72
72
  if (utmVal) {
73
- const val = (_d = (_c = (_b = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _b === void 0 ? void 0 : _b.filter((val) => {
73
+ const val = (_e = (_d = (_c = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _c === void 0 ? void 0 : _c.filter((val) => {
74
74
  const key = val.split('=')[0];
75
75
  return UTM_KEYS.includes(key);
76
- })) === null || _c === void 0 ? void 0 : _c.join('&')) !== null && _d !== void 0 ? _d : '';
76
+ })) === null || _d === void 0 ? void 0 : _d.join('&')) !== null && _e !== void 0 ? _e : '';
77
77
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
78
78
  }
79
79
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
@@ -85,7 +85,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
85
85
  return result === null || result === void 0 ? void 0 : result.data;
86
86
  }), [bffFetch, utmVal, maxSize, defaultSize]);
87
87
  const loadVideos = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
88
- var _e, _f;
88
+ var _f, _g;
89
89
  if (rtcList.length <= 0) {
90
90
  return;
91
91
  }
@@ -94,8 +94,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
94
94
  'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
95
95
  'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
96
96
  });
97
- setRtcList(rtcList.concat((_e = data === null || data === void 0 ? void 0 : data.recList) !== null && _e !== void 0 ? _e : []));
98
- setCacheRtcList(cacheRtcList.concat((_f = data === null || data === void 0 ? void 0 : data.recList) !== null && _f !== void 0 ? _f : []));
97
+ setRtcList(rtcList.concat((_f = data === null || data === void 0 ? void 0 : data.recList) !== null && _f !== void 0 ? _f : []));
98
+ setCacheRtcList(cacheRtcList.concat((_g = data === null || data === void 0 ? void 0 : data.recList) !== null && _g !== void 0 ? _g : []));
99
99
  }), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
100
100
  const bffEventReport = (0, react_1.useCallback)(({ userInfo, eventInfo }) => {
101
101
  if (!enableReportEvent) {
@@ -133,12 +133,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
133
133
  return res === null || res === void 0 ? void 0 : res.success;
134
134
  }), [bffFetch]);
135
135
  const bffGetTagList = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
136
- var _g, _h;
136
+ var _h, _j;
137
137
  if (!utmVal)
138
138
  return;
139
139
  try {
140
140
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: utmVal } }));
141
- setTagList((_h = (_g = result === null || result === void 0 ? void 0 : result.data) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []);
141
+ 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 : []);
142
142
  }
143
143
  catch (e) {
144
144
  console.log('e', e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.0.48",
3
+ "version": "1.0.49",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",