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