pb-sxp-ui 1.20.11 → 1.20.13

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.
Files changed (33) hide show
  1. package/dist/index.cjs +177 -252
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +177 -252
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.cjs +7 -7
  6. package/dist/index.min.cjs.map +1 -1
  7. package/dist/index.min.js +7 -7
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/pb-ui.js +177 -252
  10. package/dist/pb-ui.js.map +1 -1
  11. package/dist/pb-ui.min.js +7 -7
  12. package/dist/pb-ui.min.js.map +1 -1
  13. package/es/core/components/DiyPortalPreview/VideoWidget.js +8 -10
  14. package/es/core/components/SxpPageRender/LikeButton/index.js +18 -20
  15. package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
  16. package/es/core/components/SxpPageRender/PictureGroup/index.js +13 -39
  17. package/es/core/components/SxpPageRender/VideoWidget/index.js +46 -33
  18. package/es/core/components/SxpPageRender/WaterFall/index.js +3 -4
  19. package/es/core/components/SxpPageRender/index.js +40 -56
  20. package/es/core/context/SxpDataSourceProvider.d.ts +12 -5
  21. package/es/core/context/SxpDataSourceProvider.js +43 -85
  22. package/es/core/hooks/useEventReport.js +5 -6
  23. package/lib/core/components/DiyPortalPreview/VideoWidget.js +8 -10
  24. package/lib/core/components/SxpPageRender/LikeButton/index.js +18 -20
  25. package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
  26. package/lib/core/components/SxpPageRender/PictureGroup/index.js +12 -38
  27. package/lib/core/components/SxpPageRender/VideoWidget/index.js +46 -33
  28. package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -4
  29. package/lib/core/components/SxpPageRender/index.js +40 -56
  30. package/lib/core/context/SxpDataSourceProvider.d.ts +12 -5
  31. package/lib/core/context/SxpDataSourceProvider.js +43 -85
  32. package/lib/core/hooks/useEventReport.js +5 -6
  33. 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, _4, _5, _6;
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
- 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,
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: (_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 : ''
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 = ((_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);
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 ? (_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] : [],
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 ? (_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 : '',
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, _b;
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, _l, _m;
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 (((_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)) {
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 ((_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 })));
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) && ((_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) => {
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, _r, _s, _t;
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 = (_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;
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
- ((_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));
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
- ((_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` } },
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: (_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 }),
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: (_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) }))),
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, _g, _h, _j;
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
- 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 : '',
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((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
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, _y, _z, _0;
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
- 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 : '',
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, _11, _12, _13, _14, _15, _16;
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
- 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 : '',
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: (_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 : '',
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: ((_4 = swiper.previousIndex) !== null && _4 !== void 0 ? _4 : 0) + ''
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: (_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 : '',
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: (_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 : '',
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: ((_16 = swiper.previousIndex) !== null && _16 !== void 0 ? _16 : 0) + ''
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, _j, _k, _l;
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
- 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 : '',
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((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
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: (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.bindProducts,
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: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.bindProducts,
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: Record<string, any>) => Promise<boolean>;
26
- mutateLike?: (body: Record<string, any>) => Promise<boolean>;
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: Record<string, any>) => Promise<boolean>;
115
- mutateLike: (body: Record<string, any>) => Promise<boolean>;
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;