pb-sxp-ui 1.20.11 → 1.20.12
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 +175 -251
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +175 -251
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +7 -7
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +7 -7
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +175 -251
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +7 -7
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/es/core/components/SxpPageRender/LikeButton/index.js +18 -20
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
- package/es/core/components/SxpPageRender/PictureGroup/index.js +13 -39
- package/es/core/components/SxpPageRender/VideoWidget/index.js +46 -33
- package/es/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/es/core/components/SxpPageRender/index.js +40 -56
- package/es/core/context/SxpDataSourceProvider.d.ts +12 -5
- package/es/core/context/SxpDataSourceProvider.js +41 -84
- package/es/core/hooks/useEventReport.js +5 -6
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/lib/core/components/SxpPageRender/LikeButton/index.js +18 -20
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +12 -38
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +46 -33
- package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/lib/core/components/SxpPageRender/index.js +40 -56
- package/lib/core/context/SxpDataSourceProvider.d.ts +12 -5
- package/lib/core/context/SxpDataSourceProvider.js +41 -84
- package/lib/core/hooks/useEventReport.js +5 -6
- package/package.json +1 -1
|
@@ -45,7 +45,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
45
45
|
const [pageNum, setPageNum] = useState(2);
|
|
46
46
|
const [isShowCookieSetting, setIsShowCookieSetting] = useState(false);
|
|
47
47
|
const videoWidgetRef = useRef(null);
|
|
48
|
-
const pictureGroupRef = useRef(null);
|
|
49
48
|
const fbcRef = useRef('');
|
|
50
49
|
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, isNoMoreData, channel, refreshFeSession, isDiyH5, pixelPvStatusRef } = useSxpDataSource();
|
|
51
50
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
|
@@ -95,7 +94,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
95
94
|
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
|
|
96
95
|
}, [data, ctaType, swiperRef]);
|
|
97
96
|
const handleSessionCompleted = useCallback((fk) => {
|
|
98
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3
|
|
97
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
|
99
98
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
|
100
99
|
let fromKName = '';
|
|
101
100
|
if (popupDetailData && (((_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
|
@@ -122,23 +121,22 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
122
121
|
eventSubject: 'sessionCompleted',
|
|
123
122
|
eventDescription: 'Session completed',
|
|
124
123
|
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
|
125
|
-
|
|
126
|
-
productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
|
|
124
|
+
productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
|
|
127
125
|
position: activeIndex + '',
|
|
128
126
|
fromKName: fk || fromKName,
|
|
129
127
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
|
130
|
-
ctatId: (
|
|
131
|
-
traceInfo: (
|
|
128
|
+
ctatId: (_r = (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.bindCta) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
|
129
|
+
traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : ''
|
|
132
130
|
}
|
|
133
131
|
});
|
|
134
|
-
const isPostType = ((
|
|
132
|
+
const isPostType = ((_w = item === null || item === void 0 ? void 0 : item.video) === null || _w === void 0 ? void 0 : _w.url) || ((_y = (_x = item === null || item === void 0 ? void 0 : item.video) === null || _x === void 0 ? void 0 : _x.imgUrls) === null || _y === void 0 ? void 0 : _y.length);
|
|
135
133
|
if (!popupDetailData) {
|
|
136
134
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
137
135
|
eventName: 'ExitFeed',
|
|
138
|
-
product: isPostType ? (
|
|
136
|
+
product: isPostType ? (_z = item === null || item === void 0 ? void 0 : item.video) === null || _z === void 0 ? void 0 : _z.bindProducts : (item === null || item === void 0 ? void 0 : item.product) ? [item === null || item === void 0 ? void 0 : item.product] : [],
|
|
139
137
|
rec: item,
|
|
140
138
|
position: activeIndex,
|
|
141
|
-
content_id: isPostType ? (
|
|
139
|
+
content_id: isPostType ? (_1 = (_0 = item === null || item === void 0 ? void 0 : item.video) === null || _0 === void 0 ? void 0 : _0.itemId) !== null && _1 !== void 0 ? _1 : '' : (_3 = (_2 = item === null || item === void 0 ? void 0 : item.product) === null || _2 === void 0 ? void 0 : _2.itemId) !== null && _3 !== void 0 ? _3 : '',
|
|
142
140
|
view_time: new Date() - viewTime.current
|
|
143
141
|
});
|
|
144
142
|
}
|
|
@@ -195,9 +193,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
195
193
|
refreshFeSession
|
|
196
194
|
]);
|
|
197
195
|
const handleSessionExpire = useCallback(debounce(() => {
|
|
198
|
-
var _a
|
|
196
|
+
var _a;
|
|
199
197
|
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
|
200
|
-
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
|
201
198
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
|
202
199
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
|
203
200
|
useEffect(() => {
|
|
@@ -268,18 +265,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
268
265
|
return null;
|
|
269
266
|
}, [globalConfig, activeIndex, visList]);
|
|
270
267
|
const renderContent = useCallback((rec, index) => {
|
|
271
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
268
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
272
269
|
if (rec === 'organic menu') {
|
|
273
270
|
return (React.createElement(MultiPosts, Object.assign({ recData: data === null || data === void 0 ? void 0 : data[1] }, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props, (_f = (_e = (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.item) === null || _f === void 0 ? void 0 : _f.event)));
|
|
274
271
|
}
|
|
275
|
-
if ((
|
|
272
|
+
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
|
|
276
273
|
return (React.createElement(VideoWidget, Object.assign({ key: isReload }, (activeIndex === index && { ref: videoWidgetRef }), { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon, loopPlay: true, swiperRef: swiperRef, visibleHeight: visibleHeight })));
|
|
277
274
|
}
|
|
278
|
-
if ((
|
|
279
|
-
return (React.createElement(PictureGroup,
|
|
275
|
+
if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
|
|
276
|
+
return (React.createElement(PictureGroup, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onViewImageEndEvent: handleViewImageStartEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
|
280
277
|
}
|
|
281
|
-
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((
|
|
282
|
-
return (
|
|
278
|
+
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _j === void 0 ? void 0 : _j.length) > 0) {
|
|
279
|
+
return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
|
|
283
280
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
284
281
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
|
285
282
|
const Component = withBindDataSource(t);
|
|
@@ -318,7 +315,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
318
315
|
};
|
|
319
316
|
}, [isShowMore]);
|
|
320
317
|
const renderBottom = useCallback((rec, index) => {
|
|
321
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
|
318
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
322
319
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
|
323
320
|
let cta = null;
|
|
324
321
|
if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
|
|
@@ -327,27 +324,24 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
327
324
|
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
|
328
325
|
cta = '商品CTA';
|
|
329
326
|
}
|
|
330
|
-
else if (tempMap && ((_d = Object.keys(tempMap)) === null || _d === void 0 ? void 0 : _d.includes('服务CTA')) && ((_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta) === null || _f === void 0 ? void 0 : _f.itemId)) {
|
|
331
|
-
cta = '服务CTA';
|
|
332
|
-
}
|
|
333
327
|
else {
|
|
334
|
-
cta = (
|
|
328
|
+
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
|
335
329
|
}
|
|
336
330
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
|
337
331
|
const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
|
|
338
332
|
index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 1 : 0) &&
|
|
339
|
-
((
|
|
333
|
+
((_f = ['MultiCommodity', 'MultiCommodityDiro', 'MultiCommodityDiroNew']) === null || _f === void 0 ? void 0 : _f.includes((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.type));
|
|
340
334
|
return (React.createElement(React.Fragment, null,
|
|
341
335
|
isNineProduct && (React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, isNineProduct: isNineProduct })),
|
|
342
|
-
((
|
|
343
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(
|
|
336
|
+
((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
|
337
|
+
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _j !== void 0 ? _j : 40}px` } },
|
|
344
338
|
React.createElement(Nudge, { nudge: nudge }),
|
|
345
339
|
((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) && !isNineProduct ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
|
346
340
|
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, includesCtaType: [] }))) : null,
|
|
347
341
|
React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
|
|
348
|
-
React.createElement(ExpandableText, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (
|
|
342
|
+
React.createElement(ExpandableText, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.title) !== null && _l !== void 0 ? _l : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
|
|
349
343
|
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
|
|
350
|
-
React.createElement(Hashtag, { index: activeIndex, tags: (
|
|
344
|
+
React.createElement(Hashtag, { index: activeIndex, tags: (_o = (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.hashTags) !== null && _o !== void 0 ? _o : [], itemId: (_p = rec === null || rec === void 0 ? void 0 : rec.video) === null || _p === void 0 ? void 0 : _p.itemId, itemType: ((_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
|
|
351
345
|
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
|
352
346
|
}
|
|
353
347
|
return null;
|
|
@@ -389,7 +383,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
389
383
|
return null;
|
|
390
384
|
}, [globalConfig, waterFallData, bottomHeight]);
|
|
391
385
|
const handleViewImageStartEnd = (item) => {
|
|
392
|
-
var _a, _b, _c, _d, _e, _f
|
|
386
|
+
var _a, _b, _c, _d, _e, _f;
|
|
393
387
|
if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls)) {
|
|
394
388
|
const endTime = Date.now();
|
|
395
389
|
const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
|
|
@@ -398,11 +392,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
398
392
|
eventSubject: 'viewImageCarouselEnd',
|
|
399
393
|
eventDescription: 'User end view the image carousel',
|
|
400
394
|
contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
|
401
|
-
|
|
402
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
|
395
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
|
403
396
|
imageEndTime: `${endTime}`,
|
|
404
397
|
playDuration: `${duration}`,
|
|
405
|
-
contentTags: JSON.stringify((
|
|
398
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
|
406
399
|
position: activeIndex + '',
|
|
407
400
|
contentFormat: 'image',
|
|
408
401
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
|
@@ -411,7 +404,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
411
404
|
}
|
|
412
405
|
};
|
|
413
406
|
const handleSlideSkip = (item, position) => {
|
|
414
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
|
407
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
415
408
|
if (isPreview || waterFallData)
|
|
416
409
|
return;
|
|
417
410
|
const t = new Date() - curTime.current;
|
|
@@ -437,8 +430,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
437
430
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
|
438
431
|
position: position + '',
|
|
439
432
|
contentId: (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.itemId) !== null && _t !== void 0 ? _t : '',
|
|
440
|
-
|
|
441
|
-
traceInfo: (_0 = (_y = (_x = item === null || item === void 0 ? void 0 : item.video) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_z = item === null || item === void 0 ? void 0 : item.product) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : '',
|
|
433
|
+
traceInfo: (_x = (_v = (_u = item === null || item === void 0 ? void 0 : item.video) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : (_w = item === null || item === void 0 ? void 0 : item.product) === null || _w === void 0 ? void 0 : _w.traceInfo) !== null && _x !== void 0 ? _x : '',
|
|
442
434
|
contentFormat
|
|
443
435
|
}
|
|
444
436
|
});
|
|
@@ -448,7 +440,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
448
440
|
}
|
|
449
441
|
};
|
|
450
442
|
const handleScrollEvent = (swiper) => {
|
|
451
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10
|
|
443
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
|
|
452
444
|
const item = data[swiper.previousIndex];
|
|
453
445
|
const activeItem = data[swiper.activeIndex];
|
|
454
446
|
if (!item)
|
|
@@ -481,12 +473,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
481
473
|
eventSubject: 'scrollDown',
|
|
482
474
|
eventDescription: 'User scroll down',
|
|
483
475
|
contentId: (_u = (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '',
|
|
484
|
-
|
|
485
|
-
productId: (_z = (_y = item === null || item === void 0 ? void 0 : item.product) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '',
|
|
476
|
+
productId: (_w = (_v = item === null || item === void 0 ? void 0 : item.product) === null || _v === void 0 ? void 0 : _v.itemId) !== null && _w !== void 0 ? _w : '',
|
|
486
477
|
requestId: null,
|
|
487
|
-
traceInfo: (
|
|
478
|
+
traceInfo: (_0 = (_y = (_x = item === null || item === void 0 ? void 0 : item.video) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_z = item === null || item === void 0 ? void 0 : item.product) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : '',
|
|
488
479
|
contentFormat,
|
|
489
|
-
position: ((
|
|
480
|
+
position: ((_1 = swiper.previousIndex) !== null && _1 !== void 0 ? _1 : 0) + ''
|
|
490
481
|
}
|
|
491
482
|
});
|
|
492
483
|
handleViewImageStartEnd(item);
|
|
@@ -498,13 +489,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
498
489
|
eventInfo: {
|
|
499
490
|
eventSubject: 'scrollUp',
|
|
500
491
|
eventDescription: 'User scroll up',
|
|
501
|
-
contentId: (
|
|
502
|
-
|
|
503
|
-
productId: (_11 = (_10 = item.product) === null || _10 === void 0 ? void 0 : _10.itemId) !== null && _11 !== void 0 ? _11 : '',
|
|
492
|
+
contentId: (_3 = (_2 = item === null || item === void 0 ? void 0 : item.video) === null || _2 === void 0 ? void 0 : _2.itemId) !== null && _3 !== void 0 ? _3 : '',
|
|
493
|
+
productId: (_5 = (_4 = item.product) === null || _4 === void 0 ? void 0 : _4.itemId) !== null && _5 !== void 0 ? _5 : '',
|
|
504
494
|
requestId: null,
|
|
505
|
-
traceInfo: (
|
|
495
|
+
traceInfo: (_9 = (_7 = (_6 = item === null || item === void 0 ? void 0 : item.video) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_8 = item === null || item === void 0 ? void 0 : item.product) === null || _8 === void 0 ? void 0 : _8.traceInfo) !== null && _9 !== void 0 ? _9 : '',
|
|
506
496
|
contentFormat,
|
|
507
|
-
position: ((
|
|
497
|
+
position: ((_10 = swiper.previousIndex) !== null && _10 !== void 0 ? _10 : 0) + ''
|
|
508
498
|
}
|
|
509
499
|
});
|
|
510
500
|
handleViewImageStartEnd(item);
|
|
@@ -601,7 +591,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
601
591
|
};
|
|
602
592
|
}, [globalConfig, bffEventReport, data, activeIndex]);
|
|
603
593
|
const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
|
|
604
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
594
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
605
595
|
const item = data[activeIndex];
|
|
606
596
|
if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls)) {
|
|
607
597
|
const startTime = Date.now();
|
|
@@ -611,10 +601,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
611
601
|
eventSubject: 'viewImageCarouselStart',
|
|
612
602
|
eventDescription: 'User start view the image carousel',
|
|
613
603
|
contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
|
614
|
-
|
|
615
|
-
contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
|
|
604
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
|
616
605
|
imageStartTime: `${startTime}`,
|
|
617
|
-
contentTags: JSON.stringify((
|
|
606
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
|
618
607
|
position: activeIndex + '',
|
|
619
608
|
contentFormat: 'image',
|
|
620
609
|
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
|
|
@@ -624,13 +613,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
624
613
|
if (enableCapi) {
|
|
625
614
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
626
615
|
eventName: 'ViewContent',
|
|
627
|
-
product: (
|
|
616
|
+
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProducts,
|
|
628
617
|
rec: item,
|
|
629
618
|
position: activeIndex
|
|
630
619
|
});
|
|
631
620
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
|
632
621
|
eventName: 'PageView',
|
|
633
|
-
product: (
|
|
622
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProducts,
|
|
634
623
|
rec: item,
|
|
635
624
|
position: activeIndex
|
|
636
625
|
});
|
|
@@ -728,19 +717,14 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
|
|
|
728
717
|
swiperRef.current.swiper.allowTouchMove = true;
|
|
729
718
|
}, 500);
|
|
730
719
|
}, onActiveIndexChange: (swiper) => {
|
|
731
|
-
var _a, _b;
|
|
732
720
|
setActiveIndex(swiper.activeIndex);
|
|
733
721
|
if (openHashtag)
|
|
734
722
|
return;
|
|
735
723
|
handleScrollEvent(swiper);
|
|
736
|
-
if (waterFallData || isEditor)
|
|
724
|
+
if (waterFallData || isEditor || isDiyH5)
|
|
737
725
|
return;
|
|
738
726
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
|
739
727
|
if (!isLoadMore) {
|
|
740
|
-
if (isDiyH5) {
|
|
741
|
-
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
|
742
|
-
(_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
|
|
743
|
-
}
|
|
744
728
|
setIsLoadMore(true);
|
|
745
729
|
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
|
|
746
730
|
var _a;
|
|
@@ -22,8 +22,12 @@ export interface ISxpDataSourceContext {
|
|
|
22
22
|
value: string;
|
|
23
23
|
}>;
|
|
24
24
|
}) => Promise<boolean | undefined>;
|
|
25
|
-
mutateUnlike?: (body:
|
|
26
|
-
|
|
25
|
+
mutateUnlike?: (body: {
|
|
26
|
+
videoItemId: string;
|
|
27
|
+
}) => Promise<boolean>;
|
|
28
|
+
mutateLike?: (body: {
|
|
29
|
+
content: string;
|
|
30
|
+
}) => Promise<boolean>;
|
|
27
31
|
popupDetailData?: RecItemType;
|
|
28
32
|
setPopupDetailData?: React.Dispatch<React.SetStateAction<any | null>>;
|
|
29
33
|
loadVideos?: (page: number) => Promise<RecommendVideoResultType | undefined>;
|
|
@@ -96,7 +100,6 @@ export interface ISxpDataSourceContext {
|
|
|
96
100
|
getAccount?: () => Promise<any>;
|
|
97
101
|
accountSonsent?: (v: boolean) => Promise<boolean>;
|
|
98
102
|
isDiyH5?: boolean;
|
|
99
|
-
firstRtcList?: RecItemType[];
|
|
100
103
|
pixelPvStatusRef?: any;
|
|
101
104
|
}
|
|
102
105
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
|
@@ -111,8 +114,12 @@ export interface SxpDataSourceProviderProps {
|
|
|
111
114
|
value: string;
|
|
112
115
|
}>;
|
|
113
116
|
}) => Promise<boolean | undefined>;
|
|
114
|
-
mutateUnlike: (body:
|
|
115
|
-
|
|
117
|
+
mutateUnlike: (body: {
|
|
118
|
+
videoItemId: string;
|
|
119
|
+
}) => Promise<boolean>;
|
|
120
|
+
mutateLike: (body: {
|
|
121
|
+
content: string;
|
|
122
|
+
}) => Promise<boolean>;
|
|
116
123
|
pageData?: PageData;
|
|
117
124
|
}) => ReactNode;
|
|
118
125
|
utmVal?: string;
|