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
@@ -84,10 +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 ||
|
87
|
+
if (!videoRef || firstFrameSrc || !blur)
|
88
88
|
return;
|
89
89
|
const videoDomRef = document.getElementById('player-container-id_html5_api');
|
90
|
-
if (
|
90
|
+
if (!videoDomRef)
|
91
|
+
return;
|
92
|
+
videoDomRef.style.objectFit = 'contain';
|
93
|
+
if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !canvasRef.current || isBgColor)
|
91
94
|
return;
|
92
95
|
const setFrameImg = () => {
|
93
96
|
const video = videoDomRef;
|
@@ -104,7 +107,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
104
107
|
setTimeout(() => {
|
105
108
|
setFrameImg();
|
106
109
|
}, 500);
|
107
|
-
}, [videoRef, isBgColor, rec, firstFrameSrc]);
|
110
|
+
}, [videoRef, isBgColor, rec, firstFrameSrc, blur]);
|
108
111
|
const handleLoadedmetadata = useCallback(() => {
|
109
112
|
if (!videoRef)
|
110
113
|
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();
|
@@ -167,9 +166,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
167
166
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
168
167
|
minusHeight += 45;
|
169
168
|
}
|
170
|
-
if (tagList.length > 0) {
|
171
|
-
minusHeight += 45;
|
172
|
-
}
|
173
169
|
return containerHeight - minusHeight;
|
174
170
|
}, [globalConfig, containerHeight, tagList]);
|
175
171
|
const renderLogo = useMemo(() => {
|
@@ -389,7 +385,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
389
385
|
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
390
386
|
} })),
|
391
387
|
renderLogo,
|
392
|
-
React.createElement(Tagbar, { tagList: tagList, setActiveIndex: setActiveIndex }),
|
393
388
|
isShowFingerTip ? React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
|
394
389
|
React.createElement(Swiper, { ref: swiperRef, onSlideChange: () => {
|
395
390
|
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: (
|
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 = (
|
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 ||
|
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
|
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((
|
95
|
-
setCacheRtcList(cacheRtcList.concat((
|
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
|
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((
|
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,10 +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 ||
|
90
|
+
if (!videoRef || firstFrameSrc || !blur)
|
91
91
|
return;
|
92
92
|
const videoDomRef = document.getElementById('player-container-id_html5_api');
|
93
|
-
if (
|
93
|
+
if (!videoDomRef)
|
94
|
+
return;
|
95
|
+
videoDomRef.style.objectFit = 'contain';
|
96
|
+
if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !canvasRef.current || isBgColor)
|
94
97
|
return;
|
95
98
|
const setFrameImg = () => {
|
96
99
|
const video = videoDomRef;
|
@@ -107,7 +110,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
107
110
|
setTimeout(() => {
|
108
111
|
setFrameImg();
|
109
112
|
}, 500);
|
110
|
-
}, [videoRef, isBgColor, rec, firstFrameSrc]);
|
113
|
+
}, [videoRef, isBgColor, rec, firstFrameSrc, blur]);
|
111
114
|
const handleLoadedmetadata = (0, react_1.useCallback)(() => {
|
112
115
|
if (!videoRef)
|
113
116
|
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)();
|
@@ -170,9 +169,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
170
169
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
171
170
|
minusHeight += 45;
|
172
171
|
}
|
173
|
-
if (tagList.length > 0) {
|
174
|
-
minusHeight += 45;
|
175
|
-
}
|
176
172
|
return containerHeight - minusHeight;
|
177
173
|
}, [globalConfig, containerHeight, tagList]);
|
178
174
|
const renderLogo = (0, react_1.useMemo)(() => {
|
@@ -392,7 +388,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
392
388
|
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
393
389
|
} })),
|
394
390
|
renderLogo,
|
395
|
-
react_1.default.createElement(Tagbar_1.default, { tagList: tagList, setActiveIndex: setActiveIndex }),
|
396
391
|
isShowFingerTip ? react_1.default.createElement(FingerSwipeTip_1.default, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
|
397
392
|
react_1.default.createElement(react_2.Swiper, { ref: swiperRef, onSlideChange: () => {
|
398
393
|
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: (
|
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 = (
|
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 ||
|
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
|
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((
|
98
|
-
setCacheRtcList(cacheRtcList.concat((
|
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
|
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((
|
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);
|