pb-sxp-ui 1.2.7 → 1.2.8

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 (39) hide show
  1. package/dist/index.cjs +70 -74
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +70 -74
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.cjs +3 -3
  6. package/dist/index.min.cjs.map +1 -1
  7. package/dist/index.min.js +3 -3
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/pb-ui.js +70 -74
  10. package/dist/pb-ui.js.map +1 -1
  11. package/dist/pb-ui.min.js +3 -3
  12. package/dist/pb-ui.min.js.map +1 -1
  13. package/es/core/components/SxpPageRender/FormatImage.d.ts +1 -0
  14. package/es/core/components/SxpPageRender/FormatImage.js +17 -3
  15. package/es/core/components/SxpPageRender/VideoWidget/index.js +2 -2
  16. package/es/core/components/SxpPageRender/index.js +7 -1
  17. package/es/core/context/SxpDataSourceProvider.js +2 -2
  18. package/es/materials/sxp/cta/AniLink/index.js +1 -1
  19. package/es/materials/sxp/cta/AniLink/interactionRender.d.ts +0 -3
  20. package/es/materials/sxp/cta/AniLink/interactionRender.js +1 -2
  21. package/es/materials/sxp/cta/AniLink/material.js +9 -1
  22. package/es/materials/sxp/cta/AniLinkPopup/index.js +2 -2
  23. package/es/materials/sxp/cta/AniLinkPopup/interactionRender.d.ts +0 -10
  24. package/es/materials/sxp/cta/AniLinkPopup/interactionRender.js +1 -7
  25. package/es/materials/sxp/cta/AniLinkPopup/material.js +17 -10
  26. package/lib/core/components/SxpPageRender/FormatImage.d.ts +1 -0
  27. package/lib/core/components/SxpPageRender/FormatImage.js +17 -3
  28. package/lib/core/components/SxpPageRender/VideoWidget/index.js +2 -2
  29. package/lib/core/components/SxpPageRender/index.js +7 -1
  30. package/lib/core/context/SxpDataSourceProvider.js +2 -2
  31. package/lib/materials/sxp/cta/AniLink/index.js +1 -1
  32. package/lib/materials/sxp/cta/AniLink/interactionRender.d.ts +0 -3
  33. package/lib/materials/sxp/cta/AniLink/interactionRender.js +1 -2
  34. package/lib/materials/sxp/cta/AniLink/material.js +9 -1
  35. package/lib/materials/sxp/cta/AniLinkPopup/index.js +2 -2
  36. package/lib/materials/sxp/cta/AniLinkPopup/interactionRender.d.ts +0 -10
  37. package/lib/materials/sxp/cta/AniLinkPopup/interactionRender.js +1 -7
  38. package/lib/materials/sxp/cta/AniLinkPopup/material.js +17 -10
  39. package/package.json +1 -1
package/dist/pb-ui.js CHANGED
@@ -666,8 +666,8 @@
666
666
  'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
667
667
  themeTag: themeTag.current
668
668
  });
669
- setRtcList(getFilterRecList(data));
670
- setCacheRtcList(getFilterRecList(data));
669
+ setRtcList(rtcList.concat(getFilterRecList(data)));
670
+ setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
671
671
  }), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
672
672
  const bffEventReport = React.useCallback(({ userInfo, eventInfo }) => {
673
673
  // 关闭 BFF 事件上报
@@ -8805,16 +8805,8 @@
8805
8805
  };
8806
8806
  var ExpandableText$1 = React.memo(ExpandableText);
8807
8807
 
8808
- /*
8809
- * @Author: binruan@chatlabs.com
8810
- * @Date: 2024-03-20 10:27:31
8811
- * @LastEditors: binruan@chatlabs.com
8812
- * @LastEditTime: 2024-07-31 17:54:50
8813
- * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\FormatImage.tsx
8814
- *
8815
- */
8816
8808
  const FormatImage = React.forwardRef((props, ref) => {
8817
- const { src, onLoad, style, className, loading } = props;
8809
+ const { src, onLoad, style, className, loading, alt = 'image' } = props;
8818
8810
  const [imgSrc, setImgSrc] = React.useState();
8819
8811
  const imgRef = React.useRef(null);
8820
8812
  React.useImperativeHandle(ref, () => ({
@@ -8825,29 +8817,19 @@
8825
8817
  React.useEffect(() => {
8826
8818
  setImgSrc(src);
8827
8819
  }, [src]);
8828
- // useEffect(() => {
8829
- // let observer: any = null;
8830
- // const { current } = imgRef;
8831
- // if (current) {
8832
- // observer = new IntersectionObserver(
8833
- // (entries) => {
8834
- // entries.forEach((entry) => {
8835
- // if (entry.isIntersecting) {
8836
- // setImgSrc(src);
8837
- // observer.unobserve(current);
8838
- // }
8839
- // });
8840
- // },
8841
- // { threshold: 0.1 } // 触发阈值,可根据需要调整
8842
- // );
8843
- // observer.observe(current);
8844
- // }
8845
- // return () => {
8846
- // if (observer && current) {
8847
- // observer.unobserve(current);
8848
- // }
8849
- // };
8850
- // }, [src]);
8820
+ React.useEffect(() => {
8821
+ const onShow = () => {
8822
+ var _a, _b;
8823
+ if (src && ((_b = (_a = imgRef === null || imgRef === void 0 ? void 0 : imgRef.current) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.display) === 'none') {
8824
+ imgRef.current.src = '';
8825
+ imgRef.current.src = src;
8826
+ }
8827
+ };
8828
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
8829
+ return () => {
8830
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
8831
+ };
8832
+ }, [src]);
8851
8833
  return (React.createElement(React.Fragment, null, (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
8852
8834
  React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
8853
8835
  React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
@@ -8856,11 +8838,11 @@
8856
8838
  if (imgRef.current)
8857
8839
  imgRef.current.style.display = 'block';
8858
8840
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
8859
- }, alt: 'image' }))) : (React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign(Object.assign({}, style), { display: 'none' }), loading: loading, onLoad: (e) => {
8841
+ }, alt: alt }))) : (React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign(Object.assign({}, style), { display: 'none' }), loading: loading, onLoad: (e) => {
8860
8842
  if (imgRef.current)
8861
8843
  imgRef.current.style.display = 'block';
8862
8844
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
8863
- }, alt: 'image' }))));
8845
+ }, alt: alt }))));
8864
8846
  });
8865
8847
  var FormatImage$1 = React.memo(FormatImage);
8866
8848
 
@@ -14073,7 +14055,7 @@ Made in Italy` })));
14073
14055
  onClick === null || onClick === void 0 ? void 0 : onClick();
14074
14056
  }
14075
14057
  };
14076
- const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || '查看详情 >';
14058
+ const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || '查看详情';
14077
14059
  const aniTimStyle = React.useMemo(() => {
14078
14060
  var _a, _b;
14079
14061
  const ani = event === null || event === void 0 ? void 0 : event.animation;
@@ -14120,7 +14102,7 @@ Made in Italy` })));
14120
14102
  * @Author: binruan@chatlabs.com
14121
14103
  * @Date: 2024-07-05 14:08:41
14122
14104
  * @LastEditors: binruan@chatlabs.com
14123
- * @LastEditTime: 2024-07-09 14:34:49
14105
+ * @LastEditTime: 2024-08-02 16:22:39
14124
14106
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\interactionRender.tsx
14125
14107
  *
14126
14108
  */
@@ -14148,11 +14130,10 @@ Made in Italy` })));
14148
14130
  label: '动画',
14149
14131
  options: [
14150
14132
  {
14151
- label: '由左向右/中间扩散',
14133
+ label: '默认',
14152
14134
  value: 1
14153
14135
  }
14154
14136
  ],
14155
- initialValue: 1,
14156
14137
  fieldProps: {
14157
14138
  style: {
14158
14139
  width: '100%'
@@ -14179,7 +14160,7 @@ Made in Italy` })));
14179
14160
  * @Author: binruan@chatlabs.com
14180
14161
  * @Date: 2023-07-28 18:29:57
14181
14162
  * @LastEditors: binruan@chatlabs.com
14182
- * @LastEditTime: 2024-07-05 19:27:54
14163
+ * @LastEditTime: 2024-08-02 17:03:34
14183
14164
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\material.tsx
14184
14165
  *
14185
14166
  */
@@ -14199,7 +14180,15 @@ Made in Italy` })));
14199
14180
  ctaTitle: {
14200
14181
  fontSize: 15,
14201
14182
  color: '#fff',
14202
- textAlign: 'left'
14183
+ textAlign: 'center'
14184
+ }
14185
+ },
14186
+ event: {
14187
+ animation: {
14188
+ backgroundColor: '#F40082',
14189
+ name: 1,
14190
+ delay: 1000,
14191
+ duration: 2000
14203
14192
  }
14204
14193
  }
14205
14194
  },
@@ -14506,7 +14495,7 @@ Made in Italy` })));
14506
14495
  onClick === null || onClick === void 0 ? void 0 : onClick();
14507
14496
  }
14508
14497
  };
14509
- const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || '查看详情 >';
14498
+ const title = (cta === null || cta === void 0 ? void 0 : cta.enTitle) || '查看详情';
14510
14499
  const aniTimStyle = React.useMemo(() => {
14511
14500
  const ani = event === null || event === void 0 ? void 0 : event.animation;
14512
14501
  if (ani) {
@@ -14538,7 +14527,7 @@ Made in Italy` })));
14538
14527
  React.createElement("div", { onClick: onClose, className: styles['modal-icon-wrapper'], style: { padding: (_s = style === null || style === void 0 ? void 0 : style['padding']) !== null && _s !== void 0 ? _s : 0 } },
14539
14528
  React.createElement("img", { src: (_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _t !== void 0 ? _t : closeIcon, alt: 'close', className: styles['modal-icon-wrapper-img'] })),
14540
14529
  React.createElement(Img$1, { src: src, rec: recData, item: (_y = (_w = (_v = (_u = recData === null || recData === void 0 ? void 0 : recData.video) === null || _u === void 0 ? void 0 : _u.bindProducts) === null || _v === void 0 ? void 0 : _v[0]) !== null && _w !== void 0 ? _w : (_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.bindProduct) !== null && _y !== void 0 ? _y : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
14541
- (!recData || (product === null || product === void 0 ? void 0 : product.title)) && (React.createElement("div", { className: styles['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
14530
+ (!recData || (product === null || product === void 0 ? void 0 : product.title)) && (React.createElement("div", { className: styles['one-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
14542
14531
  __html: setFontForText((_z = product === null || product === void 0 ? void 0 : product.title) !== null && _z !== void 0 ? _z : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
14543
14532
  } })),
14544
14533
  React.createElement("div", { className: styles['one-line-ellipsis'], style: Object.assign(Object.assign({}, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle), { lineHeight: ((_0 = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _0 === void 0 ? void 0 : _0.height) + 'px' }), dangerouslySetInnerHTML: {
@@ -14547,14 +14536,6 @@ Made in Italy` })));
14547
14536
  };
14548
14537
  var AniLinkPopupComponent = React.memo(AniLinkPopup$1);
14549
14538
 
14550
- /*
14551
- * @Author: binruan@chatlabs.com
14552
- * @Date: 2024-07-04 15:28:39
14553
- * @LastEditors: binruan@chatlabs.com
14554
- * @LastEditTime: 2024-07-05 17:46:42
14555
- * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLinkPopup\interactionRender.tsx
14556
- *
14557
- */
14558
14539
  var interactionRender = [
14559
14540
  {
14560
14541
  title: '点击事件',
@@ -14568,22 +14549,16 @@ Made in Italy` })));
14568
14549
  {
14569
14550
  title: '动画效果',
14570
14551
  child: [
14571
- {
14572
- type: 'Color',
14573
- name: ['animation', 'backgroundColor'],
14574
- label: '动画颜色'
14575
- },
14576
14552
  {
14577
14553
  type: 'Select',
14578
14554
  name: ['animation', 'name'],
14579
14555
  label: '动画',
14580
14556
  options: [
14581
14557
  {
14582
- label: '由左向右/中间扩散',
14558
+ label: '默认',
14583
14559
  value: 1
14584
14560
  }
14585
14561
  ],
14586
- initialValue: 1,
14587
14562
  fieldProps: {
14588
14563
  style: {
14589
14564
  width: '100%'
@@ -14606,11 +14581,19 @@ Made in Italy` })));
14606
14581
  }
14607
14582
  ];
14608
14583
 
14584
+ /*
14585
+ * @Author: binruan@chatlabs.com
14586
+ * @Date: 2024-07-24 14:58:40
14587
+ * @LastEditors: binruan@chatlabs.com
14588
+ * @LastEditTime: 2024-08-02 17:09:37
14589
+ * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLinkPopup\material.tsx
14590
+ *
14591
+ */
14609
14592
  /*
14610
14593
  * @Author: binruan@chatlabs.com
14611
14594
  * @Date: 2023-07-28 18:29:57
14612
14595
  * @LastEditors: binruan@chatlabs.com
14613
- * @LastEditTime: 2024-07-08 14:36:05
14596
+ * @LastEditTime: 2024-08-02 17:09:14
14614
14597
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLinkPopup\material.tsx
14615
14598
  *
14616
14599
  */
@@ -14629,32 +14612,39 @@ Made in Italy` })));
14629
14612
  ctaTempStyles: {
14630
14613
  img: {
14631
14614
  borderRadius: 3,
14632
- width: 76,
14633
- height: 76,
14634
- marginBottom: 10
14615
+ width: 108,
14616
+ height: 108,
14617
+ marginBottom: 0
14635
14618
  },
14636
14619
  title: {
14637
- fontSize: 12,
14620
+ fontSize: 14,
14638
14621
  color: '#000',
14639
14622
  textAlign: 'left'
14640
14623
  },
14641
14624
  ctaTitle: {
14642
- fontSize: 10,
14625
+ width: 108,
14626
+ height: 22,
14627
+ fontSize: 12,
14643
14628
  color: '#fff',
14644
14629
  textAlign: 'center',
14645
- width: 76,
14646
- height: 20,
14647
14630
  backgroundColor: 'rgba(0,0,0,1)'
14648
14631
  }
14632
+ },
14633
+ event: {
14634
+ animation: {
14635
+ name: 1,
14636
+ delay: 1000,
14637
+ duration: 2000
14638
+ }
14649
14639
  }
14650
14640
  },
14651
14641
  style: {
14652
- width: 90,
14653
- height: 160,
14642
+ width: 120,
14643
+ height: 185,
14654
14644
  borderRadius: 3,
14655
14645
  backgroundColor: 'rgba(255,255,255,1)',
14656
14646
  padding: 7,
14657
- margin: 10
14647
+ margin: 15
14658
14648
  }
14659
14649
  },
14660
14650
  w: 100,
@@ -15128,7 +15118,7 @@ Made in Italy` })));
15128
15118
  } },
15129
15119
  React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
15130
15120
  React.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
15131
- React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', alt: 'pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON }))),
15121
+ isPauseVideo && (React.createElement(FormatImage$1, { className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' })))),
15132
15122
  renderPoster,
15133
15123
  renderLoading)) : (React.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, style: {
15134
15124
  position: 'relative',
@@ -15139,7 +15129,7 @@ Made in Italy` })));
15139
15129
  React.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
15140
15130
  renderPoster,
15141
15131
  renderLoading,
15142
- React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' })))));
15132
+ isPauseVideo && React.createElement(FormatImage$1, { className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' })))));
15143
15133
  };
15144
15134
  var VideoWidget$3 = React.memo(VideoWidget$2);
15145
15135
 
@@ -15537,7 +15527,7 @@ Made in Italy` })));
15537
15527
  * @Author: binruan@chatlabs.com
15538
15528
  * @Date: 2024-01-15 19:03:09
15539
15529
  * @LastEditors: binruan@chatlabs.com
15540
- * @LastEditTime: 2024-08-01 17:42:09
15530
+ * @LastEditTime: 2024-08-02 10:50:56
15541
15531
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
15542
15532
  *
15543
15533
  */
@@ -15550,6 +15540,8 @@ Made in Italy` })));
15550
15540
  const viewTime = React.useRef();
15551
15541
  const [isLoadMore, setIsLoadMore] = React.useState(false);
15552
15542
  const [isShowMore, setIsShowMore] = React.useState(false);
15543
+ const [isReload, setIsReload] = React.useState(false);
15544
+ const skipLinkRef = React.useRef(false);
15553
15545
  const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview } = useSxpDataSource();
15554
15546
  const { backMainFeed } = useEventReport();
15555
15547
  const { productView } = useEventReport();
@@ -15643,6 +15635,9 @@ Made in Italy` })));
15643
15635
  });
15644
15636
  }
15645
15637
  else if (document.visibilityState === 'visible') {
15638
+ if (skipLinkRef.current === true) {
15639
+ setIsReload(true);
15640
+ }
15646
15641
  // 页面可见时触发,注意页面初始化时不会触发
15647
15642
  handleH5EnterLink();
15648
15643
  if (repCond) {
@@ -15832,6 +15827,7 @@ Made in Italy` })));
15832
15827
  }
15833
15828
  });
15834
15829
  setSlideSkipState();
15830
+ skipLinkRef.current = true;
15835
15831
  window.location.href = window.getJointUtmLink(link);
15836
15832
  }
15837
15833
  }
@@ -15948,7 +15944,7 @@ Made in Italy` })));
15948
15944
  renderBottom(rec, index),
15949
15945
  renderLikeButton(rec, index)))))));
15950
15946
  });
15951
- }, [containerWidth, data, height, loading, renderBottom, renderContent, visList, loadingImage]);
15947
+ }, [containerWidth, data, height, loading, renderBottom, renderContent, visList, loadingImage, isReload]);
15952
15948
  const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
15953
15949
  const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
15954
15950
  return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' },