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.cjs CHANGED
@@ -1318,7 +1318,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1318
1318
  refreshFeSession,
1319
1319
  getAccount,
1320
1320
  accountSonsent,
1321
- isDiyH5
1321
+ isDiyH5,
1322
+ firstRtcList
1322
1323
  } }, 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({
1323
1324
  rtcList,
1324
1325
  mutateLike: bffMutateLike,
@@ -10396,7 +10397,7 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
10396
10397
  const CommodityDetail$1 = (_a) => {
10397
10398
  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;
10398
10399
  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"]);
10399
- const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
10400
+ const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig, ctaEvent } = useSxpDataSource();
10400
10401
  const { jumpToWeb, productView } = useEventReport();
10401
10402
  const curTimeRef = React.useRef(null);
10402
10403
  const [showModal, setShowModal] = React.useState(false);
@@ -10422,6 +10423,12 @@ const CommodityDetail$1 = (_a) => {
10422
10423
  if (!isPost) {
10423
10424
  productView(data, product, cta, viewTime || curTimeRef.current, position);
10424
10425
  }
10426
+ else {
10427
+ ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
10428
+ eventSubject: 'clickCta',
10429
+ eventDescription: 'User clicked the CTA'
10430
+ }, data, product, position);
10431
+ }
10425
10432
  window.location.href = window.getJointUtmLink(product.link);
10426
10433
  }
10427
10434
  };
@@ -11324,7 +11331,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
11324
11331
  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;
11325
11332
  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"]);
11326
11333
  React.useState(true);
11327
- const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
11334
+ const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig, ctaEvent } = useSxpDataSource();
11328
11335
  const { jumpToWeb, productView } = useEventReport();
11329
11336
  React.useState(false);
11330
11337
  React.useState(false);
@@ -11353,6 +11360,12 @@ const CommodityDetailDiroNew$1 = (_a) => {
11353
11360
  if (!isPost) {
11354
11361
  productView(data, product, cta, viewTime || curTimeRef.current, position);
11355
11362
  }
11363
+ else {
11364
+ ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
11365
+ eventSubject: 'clickCta',
11366
+ eventDescription: 'User clicked the CTA'
11367
+ }, data, product, position);
11368
+ }
11356
11369
  window.location.href = window.getJointUtmLink(product.link);
11357
11370
  }
11358
11371
  };
@@ -17884,7 +17897,7 @@ const mountVideoPlayerAtNode = (() => {
17884
17897
  const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef }, ref) => {
17885
17898
  var _a, _b;
17886
17899
  const [isPauseVideo, setIsPauseVideo] = React.useState(false);
17887
- const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
17900
+ const { bffEventReport, sxpParameter, firstRtcList, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
17888
17901
  const videoStartTime = React.useRef(0);
17889
17902
  const [isLoadFinish, setIsLoadFinish] = React.useState(false);
17890
17903
  const { isActive } = useSwiperSlide();
@@ -17958,8 +17971,7 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
17958
17971
  (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
17959
17972
  if (!loopPlayRef.current)
17960
17973
  return;
17961
- if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) ;
17962
- else {
17974
+ if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
17963
17975
  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;
17964
17976
  (_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);
17965
17977
  }
@@ -18351,7 +18363,7 @@ const Picture = (props) => {
18351
18363
  const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig, swiperRef }, ref) => {
18352
18364
  var _a, _b;
18353
18365
  const { isActive } = useSwiperSlide();
18354
- const { sxpParameter, openHashtag, isDiyH5 } = useSxpDataSource();
18366
+ const { firstRtcList, openHashtag, isDiyH5 } = useSxpDataSource();
18355
18367
  const [isLoad, setIsLoad] = React.useState(false);
18356
18368
  const [imgInfo, setImgInfo] = React.useState();
18357
18369
  const [swiperActiveIndex, setSwiperActiveIndex] = React.useState(0);
@@ -18373,8 +18385,7 @@ const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, on
18373
18385
  var _a, _b, _c, _d;
18374
18386
  if (!loopPlayRef.current)
18375
18387
  return;
18376
- if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) ;
18377
- else {
18388
+ if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
18378
18389
  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;
18379
18390
  (_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);
18380
18391
  }
@@ -18384,7 +18395,7 @@ const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, on
18384
18395
  if (timerId)
18385
18396
  clearTimeout(timerId);
18386
18397
  };
18387
- }, [isLoad, isActive, isDiyH5, index, swiperRef]);
18398
+ }, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
18388
18399
  React.useEffect(() => {
18389
18400
  if (isLoad && isActive) {
18390
18401
  (imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.start();