pb-sxp-ui 1.16.11 → 1.16.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.
package/dist/index.js CHANGED
@@ -1296,7 +1296,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1296
1296
  refreshFeSession,
1297
1297
  getAccount,
1298
1298
  accountSonsent,
1299
- isDiyH5
1299
+ isDiyH5,
1300
+ firstRtcList
1300
1301
  } }, isShowConsent ? (React.createElement(Consent$4, Object.assign({}, (_e = (_d = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.props))) : (render({
1301
1302
  rtcList,
1302
1303
  mutateLike: bffMutateLike,
@@ -10374,7 +10375,7 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
10374
10375
  const CommodityDetail$1 = (_a) => {
10375
10376
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
10376
10377
  var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive"]);
10377
- const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
10378
+ const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig, ctaEvent } = useSxpDataSource();
10378
10379
  const { jumpToWeb, productView } = useEventReport();
10379
10380
  const curTimeRef = useRef(null);
10380
10381
  const [showModal, setShowModal] = useState(false);
@@ -10400,6 +10401,12 @@ const CommodityDetail$1 = (_a) => {
10400
10401
  if (!isPost) {
10401
10402
  productView(data, product, cta, viewTime || curTimeRef.current, position);
10402
10403
  }
10404
+ else {
10405
+ ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
10406
+ eventSubject: 'clickCta',
10407
+ eventDescription: 'User clicked the CTA'
10408
+ }, data, product, position);
10409
+ }
10403
10410
  window.location.href = window.getJointUtmLink(product.link);
10404
10411
  }
10405
10412
  };
@@ -11302,7 +11309,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
11302
11309
  var _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;
11303
11310
  var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive"]);
11304
11311
  useState(true);
11305
- const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
11312
+ const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig, ctaEvent } = useSxpDataSource();
11306
11313
  const { jumpToWeb, productView } = useEventReport();
11307
11314
  useState(false);
11308
11315
  useState(false);
@@ -11331,6 +11338,12 @@ const CommodityDetailDiroNew$1 = (_a) => {
11331
11338
  if (!isPost) {
11332
11339
  productView(data, product, cta, viewTime || curTimeRef.current, position);
11333
11340
  }
11341
+ else {
11342
+ ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
11343
+ eventSubject: 'clickCta',
11344
+ eventDescription: 'User clicked the CTA'
11345
+ }, data, product, position);
11346
+ }
11334
11347
  window.location.href = window.getJointUtmLink(product.link);
11335
11348
  }
11336
11349
  };
@@ -17862,7 +17875,7 @@ const mountVideoPlayerAtNode = (() => {
17862
17875
  const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef }, ref) => {
17863
17876
  var _a, _b;
17864
17877
  const [isPauseVideo, setIsPauseVideo] = useState(false);
17865
- const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
17878
+ const { bffEventReport, sxpParameter, firstRtcList, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
17866
17879
  const videoStartTime = useRef(0);
17867
17880
  const [isLoadFinish, setIsLoadFinish] = useState(false);
17868
17881
  const { isActive } = useSwiperSlide();
@@ -17936,8 +17949,7 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
17936
17949
  (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
17937
17950
  if (!loopPlayRef.current)
17938
17951
  return;
17939
- if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) ;
17940
- else {
17952
+ if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
17941
17953
  const i = (_c = (_b = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _b === void 0 ? void 0 : _b.swiper) === null || _c === void 0 ? void 0 : _c.activeIndex;
17942
17954
  (_e = (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper) === null || _e === void 0 ? void 0 : _e.slideTo(i + 1);
17943
17955
  }
@@ -18329,7 +18341,7 @@ const Picture = (props) => {
18329
18341
  const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig, swiperRef }, ref) => {
18330
18342
  var _a, _b;
18331
18343
  const { isActive } = useSwiperSlide();
18332
- const { sxpParameter, openHashtag, isDiyH5 } = useSxpDataSource();
18344
+ const { firstRtcList, openHashtag, isDiyH5 } = useSxpDataSource();
18333
18345
  const [isLoad, setIsLoad] = useState(false);
18334
18346
  const [imgInfo, setImgInfo] = useState();
18335
18347
  const [swiperActiveIndex, setSwiperActiveIndex] = useState(0);
@@ -18351,8 +18363,7 @@ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewIm
18351
18363
  var _a, _b, _c, _d;
18352
18364
  if (!loopPlayRef.current)
18353
18365
  return;
18354
- if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) ;
18355
- else {
18366
+ if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
18356
18367
  const i = (_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.activeIndex;
18357
18368
  (_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slideTo(i + 1);
18358
18369
  }
@@ -18362,7 +18373,7 @@ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewIm
18362
18373
  if (timerId)
18363
18374
  clearTimeout(timerId);
18364
18375
  };
18365
- }, [isLoad, isActive, isDiyH5, index, swiperRef]);
18376
+ }, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
18366
18377
  useEffect(() => {
18367
18378
  if (isLoad && isActive) {
18368
18379
  (imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.start();