pb-sxp-ui 1.2.4 → 1.2.5

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 (62) hide show
  1. package/dist/index.cjs +231 -151
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +2 -2
  4. package/dist/index.js +231 -151
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +3 -3
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +3 -3
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +231 -151
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +3 -3
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/SxpPageRender/LikeButton/index.js +34 -15
  15. package/es/core/components/SxpPageRender/Popup/index.js +23 -12
  16. package/es/core/components/SxpPageRender/RenderCard.d.ts +1 -0
  17. package/es/core/components/SxpPageRender/RenderCard.js +3 -3
  18. package/es/core/components/SxpPageRender/index.js +2 -2
  19. package/es/core/components/SxpPageRender/typing.d.ts +1 -0
  20. package/es/core/context/SxpDataSourceProvider.d.ts +3 -3
  21. package/es/core/context/SxpDataSourceProvider.js +7 -3
  22. package/es/materials/sxp/cta/AniLink/index.js +2 -1
  23. package/es/materials/sxp/cta/AniLinkPopup/index.d.ts +1 -0
  24. package/es/materials/sxp/cta/AniLinkPopup/index.js +11 -20
  25. package/es/materials/sxp/popup/CommodityDetail/index.js +25 -13
  26. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +28 -17
  27. package/es/materials/sxp/popup/CommodityList/index.js +28 -10
  28. package/es/materials/sxp/popup/CommodityList/material.js +1 -0
  29. package/es/materials/sxp/popup/CommodityList/settingRender.js +5 -0
  30. package/es/materials/sxp/template/MultiCommodity/index.js +3 -3
  31. package/es/materials/sxp/template/MultiCommodityDiro/index.js +3 -3
  32. package/es/materials/sxp/template/components/CommodityGroup.d.ts +4 -0
  33. package/es/materials/sxp/template/components/CommodityGroup.js +12 -15
  34. package/es/materials/sxp/template/components/Img.d.ts +1 -0
  35. package/es/materials/sxp/template/components/Img.js +3 -3
  36. package/es/materials/sxp/template/components/Scroll.d.ts +1 -0
  37. package/es/materials/sxp/template/components/Scroll.js +5 -4
  38. package/lib/core/components/SxpPageRender/LikeButton/index.js +34 -15
  39. package/lib/core/components/SxpPageRender/Popup/index.js +22 -11
  40. package/lib/core/components/SxpPageRender/RenderCard.d.ts +1 -0
  41. package/lib/core/components/SxpPageRender/RenderCard.js +3 -3
  42. package/lib/core/components/SxpPageRender/index.js +2 -2
  43. package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
  44. package/lib/core/context/SxpDataSourceProvider.d.ts +3 -3
  45. package/lib/core/context/SxpDataSourceProvider.js +7 -3
  46. package/lib/materials/sxp/cta/AniLink/index.js +2 -1
  47. package/lib/materials/sxp/cta/AniLinkPopup/index.d.ts +1 -0
  48. package/lib/materials/sxp/cta/AniLinkPopup/index.js +10 -19
  49. package/lib/materials/sxp/popup/CommodityDetail/index.js +24 -12
  50. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +28 -17
  51. package/lib/materials/sxp/popup/CommodityList/index.js +27 -9
  52. package/lib/materials/sxp/popup/CommodityList/material.js +1 -0
  53. package/lib/materials/sxp/popup/CommodityList/settingRender.js +5 -0
  54. package/lib/materials/sxp/template/MultiCommodity/index.js +3 -3
  55. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +3 -3
  56. package/lib/materials/sxp/template/components/CommodityGroup.d.ts +4 -0
  57. package/lib/materials/sxp/template/components/CommodityGroup.js +11 -14
  58. package/lib/materials/sxp/template/components/Img.d.ts +1 -0
  59. package/lib/materials/sxp/template/components/Img.js +3 -3
  60. package/lib/materials/sxp/template/components/Scroll.d.ts +1 -0
  61. package/lib/materials/sxp/template/components/Scroll.js +5 -4
  62. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -552,6 +552,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
552
552
  const themeTag = useRef();
553
553
  const curTime = useRef();
554
554
  const [selectTag, setSelectTag] = useState(DEFAULT_TAG);
555
+ const checkCommodityIndexRef = useRef();
556
+ const popupCurTimeRef = useRef(null);
555
557
  const isShowConsent = useMemo(() => {
556
558
  var _a, _b, _c, _d;
557
559
  return (((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent;
@@ -719,7 +721,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
719
721
  }
720
722
  }), [bffFetch, utmVal, isShowTag]);
721
723
  const ctaEvent = useCallback((eventInfo, rec, product, position) => {
722
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
724
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
723
725
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
724
726
  const isProd = ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) || (((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProducts) && ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProducts) === null || _d === void 0 ? void 0 : _d.length) > 0);
725
727
  let fromKName = '';
@@ -733,7 +735,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
733
735
  fromKName = 'imagePage';
734
736
  }
735
737
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
736
- eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : '', fromKName })
738
+ eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : '', fromKName, fromKPage: (_o = location === null || location === void 0 ? void 0 : location.href) !== null && _o !== void 0 ? _o : '' })
737
739
  });
738
740
  }, [bffEventReport, isFromHashtag]);
739
741
  const h5EnterLink = useCallback(() => {
@@ -848,7 +850,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
848
850
  isShowConsent,
849
851
  selectTag,
850
852
  setSelectTag,
851
- globalConfig
853
+ globalConfig,
854
+ popupCurTimeRef,
855
+ checkCommodityIndexRef
852
856
  } }, isShowConsent ? (React.createElement(Consent$3, Object.assign({}, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props))) : (render({
853
857
  rtcList,
854
858
  mutateLike: bffMutateLike,
@@ -8583,7 +8587,7 @@ SwiperSlide.displayName = 'SwiperSlide';
8583
8587
  * @Author: binruan@chatlabs.com
8584
8588
  * @Date: 2023-11-02 18:34:34
8585
8589
  * @LastEditors: binruan@chatlabs.com
8586
- * @LastEditTime: 2024-07-25 17:05:20
8590
+ * @LastEditTime: 2024-07-29 16:20:40
8587
8591
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
8588
8592
  *
8589
8593
  */
@@ -8827,56 +8831,71 @@ const FormatImage = forwardRef((props, ref) => {
8827
8831
  });
8828
8832
  var FormatImage$1 = memo(FormatImage);
8829
8833
 
8830
- const Scroll = ({ children, isPadding = true, style }) => {
8834
+ /*
8835
+ * @Author: binruan@chatlabs.com
8836
+ * @Date: 2024-03-20 10:27:32
8837
+ * @LastEditors: binruan@chatlabs.com
8838
+ * @LastEditTime: 2024-07-30 11:46:32
8839
+ * @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Scroll.tsx
8840
+ *
8841
+ */
8842
+ const Scroll = ({ children, isPadding = true, style, enableSlideActive = false }) => {
8831
8843
  const ref = useRef();
8832
8844
  const { popupDetailData } = useSxpDataSource();
8833
8845
  useEffect(() => {
8834
- var _a;
8835
- (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex);
8836
- }, [popupDetailData]);
8846
+ var _a, _b;
8847
+ if (enableSlideActive)
8848
+ (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
8849
+ }, [popupDetailData, enableSlideActive]);
8837
8850
  return (React.createElement(Swiper, { ref: ref, direction: 'horizontal', slidesPerView: 'auto', freeMode: true, mousewheel: true, modules: [freeMode, Scrollbar, Mousewheel], style: Object.assign({ padding: isPadding ? '0 12px 0 20px' : 0 }, style) }, children));
8838
8851
  };
8839
8852
  var Scroll$1 = memo(Scroll);
8840
8853
 
8841
- const CommodityGroup = ({ products, data, defImg, style }) => {
8842
- var _a, _b;
8843
- const { setPopupDetailData, popupDetailData } = useSxpDataSource();
8844
- const [check, setCheck] = useState((_a = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _a !== void 0 ? _a : 0);
8845
- const handleClick = useCallback((index) => {
8846
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData((val) => (Object.assign(Object.assign({}, val), { video: Object.assign(Object.assign({}, val === null || val === void 0 ? void 0 : val.video), { bindProduct: products === null || products === void 0 ? void 0 : products[index] }), multiCheckIndex: index })));
8847
- }, []);
8848
- return (React.createElement(React.Fragment, null, (data === null || data === void 0 ? void 0 : data.open) && ((products && (products === null || products === void 0 ? void 0 : products.length) > 0) || !popupDetailData) && (React.createElement(Scroll$1, { isPadding: false, style: Object.assign(Object.assign({}, style), data === null || data === void 0 ? void 0 : data.style) }, (_b = (popupDetailData ? products : [0, 1, 2, 3])) === null || _b === void 0 ? void 0 : _b.map((item, index) => {
8854
+ const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailData, check }) => {
8855
+ var _a;
8856
+ return (React.createElement(React.Fragment, null, (data === null || data === void 0 ? void 0 : data.open) && ((products && (products === null || products === void 0 ? void 0 : products.length) > 1) || !popupDetailData) && (React.createElement(Scroll$1, { enableSlideActive: true, isPadding: false, style: Object.assign(Object.assign({}, style), data === null || data === void 0 ? void 0 : data.style) }, (_a = (popupDetailData ? products : [0, 1, 2, 3])) === null || _a === void 0 ? void 0 : _a.map((item, index) => {
8849
8857
  var _a, _b, _c;
8850
- return (React.createElement(SwiperSlide, { className: css({
8858
+ return (React.createElement(React.Fragment, null, (item === null || item === void 0 ? void 0 : item.bindCta) ? (React.createElement(SwiperSlide, { className: css({
8851
8859
  width: '50px',
8852
8860
  height: '50px',
8853
8861
  marginRight: '10px'
8854
- }), onClick: () => handleClick(index), key: index },
8862
+ }), onClick: () => {
8863
+ onCLick === null || onCLick === void 0 ? void 0 : onCLick(index);
8864
+ }, key: index },
8855
8865
  React.createElement(FormatImage$1, { style: {
8856
8866
  height: '100%',
8857
8867
  width: '100%',
8858
8868
  objectFit: 'cover',
8859
8869
  display: 'block',
8860
- objectPosition: `50% ${(data === null || data === void 0 ? void 0 : data.translateY) ? -(data === null || data === void 0 ? void 0 : data.translateY) + 50 : 50}%`,
8861
- border: check === index ? '1px solid #000' : '1px solid #f2f2f2'
8862
- }, src: (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : defImg })));
8870
+ objectPosition: `50% ${(data === null || data === void 0 ? void 0 : data.translateY) ? (data === null || data === void 0 ? void 0 : data.translateY) + 50 : 50}%`,
8871
+ border: check === index ? '1px solid #000' : '1px solid #f2f2f2',
8872
+ boxSizing: 'border-box'
8873
+ }, src: (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : defImg }))) : null));
8863
8874
  })))));
8864
8875
  };
8865
8876
  var CommodityGroup$1 = memo(CommodityGroup);
8866
8877
 
8867
8878
  const CommodityDetail$1 = (_a) => {
8868
- var _b, _c, _d, _e, _f, _g, _h, _j, _k;
8879
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
8869
8880
  var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup"]);
8870
- const { sxpParameter } = useSxpDataSource();
8871
- const { popupDetailData, bffEventReport, isPreview, bffFbReport } = useSxpDataSource();
8881
+ const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef } = useSxpDataSource();
8882
+ useEditor();
8872
8883
  const { jumpToWeb, productView } = useEventReport();
8873
8884
  const curTimeRef = useRef(null);
8874
8885
  const [showModal, setShowModal] = useState(false);
8875
8886
  const [show3DModal, setShow3DModal] = useState(false);
8887
+ const [checkCommodityIndex, setCheckCommodityIndex] = useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
8876
8888
  const data = isPost ? rec : popupDetailData;
8877
- const product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
8878
- const cta = isPost ? (_c = data === null || data === void 0 ? void 0 : data.product) === null || _c === void 0 ? void 0 : _c.bindCta : (_e = (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.bindProduct) === null || _e === void 0 ? void 0 : _e.bindCta;
8889
+ let product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_d = (_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct) !== null && _d !== void 0 ? _d : (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProducts) === null || _f === void 0 ? void 0 : _f[0];
8890
+ let cta = isPost
8891
+ ? (_g = data === null || data === void 0 ? void 0 : data.product) === null || _g === void 0 ? void 0 : _g.bindCta
8892
+ : (_k = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.bindProduct) === null || _j === void 0 ? void 0 : _j.bindCta) !== null && _k !== void 0 ? _k : (_o = (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.bindProducts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.bindCta;
8879
8893
  const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
8894
+ if (!isPost && (commodityGroup === null || commodityGroup === void 0 ? void 0 : commodityGroup.open) && ((_p = data === null || data === void 0 ? void 0 : data.video) === null || _p === void 0 ? void 0 : _p.bindProducts) && ((_r = (_q = data === null || data === void 0 ? void 0 : data.video) === null || _q === void 0 ? void 0 : _q.bindProducts) === null || _r === void 0 ? void 0 : _r.length) > 0) {
8895
+ const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
8896
+ product = p;
8897
+ cta = p === null || p === void 0 ? void 0 : p.bindCta;
8898
+ }
8880
8899
  const handleLink = () => {
8881
8900
  if (product === null || product === void 0 ? void 0 : product.link) {
8882
8901
  jumpToWeb(data, product, cta, position);
@@ -8914,7 +8933,7 @@ const CommodityDetail$1 = (_a) => {
8914
8933
  return '$7,000';
8915
8934
  }
8916
8935
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
8917
- const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
8936
+ const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
8918
8937
  const renderContent = ({ isPost }) => {
8919
8938
  var _a, _b, _c;
8920
8939
  return (React.createElement("div", null,
@@ -8947,15 +8966,19 @@ const CommodityDetail$1 = (_a) => {
8947
8966
  }
8948
8967
  return style;
8949
8968
  }, []);
8969
+ const handleClick = useCallback((index) => {
8970
+ popupCurTimeRef.current = new Date();
8971
+ setCheckCommodityIndex(index);
8972
+ }, []);
8950
8973
  const renderCommodityGroup = useCallback(() => {
8951
8974
  var _a, _b, _c;
8952
8975
  if (isPost)
8953
8976
  return;
8954
- return (React.createElement(CommodityGroup$1, { products: (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts, data: commodityGroup, defImg: (_c = (_b = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _b !== void 0 ? _b : bottom_image) !== null && _c !== void 0 ? _c : '', style: { padding: '0 19px' } }));
8955
- }, []);
8977
+ return (React.createElement(CommodityGroup$1, { products: (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts, data: commodityGroup, defImg: (_c = (_b = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _b !== void 0 ? _b : bottom_image) !== null && _c !== void 0 ? _c : '', style: { padding: '0 19px' }, onCLick: handleClick, popupDetailData: popupDetailData, check: checkCommodityIndex }));
8978
+ }, [checkCommodityIndex]);
8956
8979
  return (React.createElement(React.Fragment, null,
8957
8980
  React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
8958
- product && ((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) > 0 && (React.createElement("div", { style: { position: 'relative' } },
8981
+ product && ((_u = product === null || product === void 0 ? void 0 : product.homePage) === null || _u === void 0 ? void 0 : _u.length) > 0 && (React.createElement("div", { style: { position: 'relative' } },
8959
8982
  React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
8960
8983
  clickable: true,
8961
8984
  bulletActiveClass: 'swipe-item-active-bullet',
@@ -8965,7 +8988,7 @@ const CommodityDetail$1 = (_a) => {
8965
8988
  }, loop: true, autoplay: {
8966
8989
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
8967
8990
  } },
8968
- React.createElement(React.Fragment, null, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
8991
+ React.createElement(React.Fragment, null, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
8969
8992
  return (React.createElement(SwiperSlide, { key: src },
8970
8993
  React.createElement("div", { style: {
8971
8994
  overflow: 'hidden',
@@ -8980,7 +9003,7 @@ const CommodityDetail$1 = (_a) => {
8980
9003
  objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
8981
9004
  }, src: src }))));
8982
9005
  }))))),
8983
- !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css({
9006
+ !((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css({
8984
9007
  position: 'relative',
8985
9008
  height: 0,
8986
9009
  width: '100%',
@@ -8993,7 +9016,7 @@ const CommodityDetail$1 = (_a) => {
8993
9016
  top: 0,
8994
9017
  objectFit: 'cover',
8995
9018
  width: '100%'
8996
- }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: 'pdp image' }))),
9019
+ }), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
8997
9020
  renderCommodityGroup(),
8998
9021
  React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
8999
9022
  renderBtn(),
@@ -9562,21 +9585,28 @@ var settingRender$6 = [
9562
9585
  ];
9563
9586
 
9564
9587
  const CommodityDetailDiroNew$1 = (_a) => {
9565
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
9588
+ 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;
9566
9589
  var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup"]);
9567
9590
  useState(true);
9568
- const { sxpParameter } = useSxpDataSource();
9569
- const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
9591
+ const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport } = useSxpDataSource();
9570
9592
  const { jumpToWeb, productView } = useEventReport();
9571
9593
  useState(false);
9572
9594
  useState(false);
9573
9595
  useState(true);
9574
9596
  const [showModal, setShowModal] = useState(false);
9575
9597
  const curTimeRef = useRef(null);
9598
+ const [checkCommodityIndex, setCheckCommodityIndex] = useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
9576
9599
  const data = isPost ? rec : popupDetailData;
9577
- const product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
9578
- const cta = isPost ? (_c = data === null || data === void 0 ? void 0 : data.product) === null || _c === void 0 ? void 0 : _c.bindCta : (_e = (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.bindProduct) === null || _e === void 0 ? void 0 : _e.bindCta;
9600
+ let product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_d = (_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct) !== null && _d !== void 0 ? _d : (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProducts) === null || _f === void 0 ? void 0 : _f[0];
9601
+ let cta = isPost
9602
+ ? (_g = data === null || data === void 0 ? void 0 : data.product) === null || _g === void 0 ? void 0 : _g.bindCta
9603
+ : (_k = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.bindProduct) === null || _j === void 0 ? void 0 : _j.bindCta) !== null && _k !== void 0 ? _k : (_o = (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.bindProducts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.bindCta;
9579
9604
  const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
9605
+ if (!isPost && (commodityGroup === null || commodityGroup === void 0 ? void 0 : commodityGroup.open) && ((_p = data === null || data === void 0 ? void 0 : data.video) === null || _p === void 0 ? void 0 : _p.bindProducts) && ((_r = (_q = data === null || data === void 0 ? void 0 : data.video) === null || _q === void 0 ? void 0 : _q.bindProducts) === null || _r === void 0 ? void 0 : _r.length) > 0) {
9606
+ const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
9607
+ product = p;
9608
+ cta = p === null || p === void 0 ? void 0 : p.bindCta;
9609
+ }
9580
9610
  const handleLink = () => {
9581
9611
  if (product === null || product === void 0 ? void 0 : product.link) {
9582
9612
  jumpToWeb(data, product, cta, position);
@@ -9614,7 +9644,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
9614
9644
  return '£102,300.00';
9615
9645
  }
9616
9646
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
9617
- const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
9647
+ const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
9618
9648
  // useEffect(() => {
9619
9649
  // console.log(scrollRef?.current?.scrollHeight, window.innerHeight);
9620
9650
  // if (scrollRef?.current && scrollRef?.current?.scrollHeight > window.innerHeight) {
@@ -9677,15 +9707,19 @@ Made in Italy` })));
9677
9707
  }
9678
9708
  return style;
9679
9709
  }, []);
9710
+ const handleClick = useCallback((index) => {
9711
+ popupCurTimeRef.current = new Date();
9712
+ setCheckCommodityIndex(index);
9713
+ }, []);
9680
9714
  const renderCommodityGroup = useCallback(() => {
9681
9715
  var _a, _b, _c;
9682
9716
  if (isPost)
9683
9717
  return;
9684
- return (React.createElement(CommodityGroup$1, { products: (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts, data: commodityGroup, defImg: (_c = (_b = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _b !== void 0 ? _b : bottom_image) !== null && _c !== void 0 ? _c : '', style: { padding: '0 19px' } }));
9685
- }, []);
9718
+ return (React.createElement(CommodityGroup$1, { products: (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts, data: commodityGroup, defImg: (_c = (_b = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _b !== void 0 ? _b : bottom_image) !== null && _c !== void 0 ? _c : '', style: { padding: '0 19px' }, onCLick: handleClick, popupDetailData: popupDetailData, check: checkCommodityIndex }));
9719
+ }, [checkCommodityIndex]);
9686
9720
  return (React.createElement("div", { className: 'pb-commondityDiroNew' },
9687
- React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
9688
- product && ((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
9721
+ React.createElement("div", Object.assign({ className: css(Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' })) }, props),
9722
+ product && ((_u = product === null || product === void 0 ? void 0 : product.homePage) === null || _u === void 0 ? void 0 : _u.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
9689
9723
  clickable: true,
9690
9724
  bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
9691
9725
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -9693,7 +9727,7 @@ Made in Italy` })));
9693
9727
  : 'commondityDiroNew-swiper-clickable-center'
9694
9728
  }, loop: true, autoplay: {
9695
9729
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
9696
- } }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
9730
+ } }, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
9697
9731
  return (React.createElement(SwiperSlide, { key: src },
9698
9732
  React.createElement("div", { style: {
9699
9733
  overflow: 'hidden',
@@ -9708,7 +9742,7 @@ Made in Italy` })));
9708
9742
  objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
9709
9743
  }, src: src }))));
9710
9744
  }))),
9711
- !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css({
9745
+ !((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css({
9712
9746
  position: 'relative',
9713
9747
  height: 0,
9714
9748
  width: '100%',
@@ -9721,13 +9755,13 @@ Made in Italy` })));
9721
9755
  top: 0,
9722
9756
  objectFit: 'cover',
9723
9757
  width: '100%'
9724
- }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: 'pdp image' }))),
9758
+ }), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
9725
9759
  renderCommodityGroup(),
9726
9760
  React.createElement("div", { className: 'pb-commondityDiroNew-content' },
9727
9761
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
9728
9762
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
9729
9763
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), dangerouslySetInnerHTML: {
9730
- __html: setFontForText((_l = product === null || product === void 0 ? void 0 : product.title) !== null && _l !== void 0 ? _l : 'Large Dior Toujours BagLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
9764
+ __html: setFontForText((_y = product === null || product === void 0 ? void 0 : product.title) !== null && _y !== void 0 ? _y : 'Large Dior Toujours BagLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
9731
9765
  } }),
9732
9766
  React.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection), dangerouslySetInnerHTML: {
9733
9767
  __html: setFontForText((product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage CalfskinLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
@@ -9737,11 +9771,11 @@ Made in Italy` })));
9737
9771
  __html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
9738
9772
  } }),
9739
9773
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
9740
- __html: setFontForText((_m = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _m !== void 0 ? _m : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
9774
+ __html: setFontForText((_z = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _z !== void 0 ? _z : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
9741
9775
  } }))),
9742
- (!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_o = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _o !== void 0 ? _o : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
9776
+ (!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_0 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _0 !== void 0 ? _0 : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
9743
9777
  React.createElement("span", { dangerouslySetInnerHTML: {
9744
- __html: setFontForText((_p = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _p !== void 0 ? _p : 'Shop now', buttonStyle)
9778
+ __html: setFontForText((_1 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _1 !== void 0 ? _1 : 'Shop now', buttonStyle)
9745
9779
  } }))),
9746
9780
  productInfoText({ isPost }))),
9747
9781
  React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
@@ -9987,6 +10021,11 @@ var settingRender$5 = [
9987
10021
  type: 'Group',
9988
10022
  label: '尺寸',
9989
10023
  child: [
10024
+ {
10025
+ type: 'Number',
10026
+ name: ['props', 'buttonStyle', 'width'],
10027
+ addonAfter: 'W'
10028
+ },
9990
10029
  {
9991
10030
  type: 'Number',
9992
10031
  name: ['props', 'buttonStyle', 'height'],
@@ -10095,18 +10134,18 @@ function useOnScreen(ref) {
10095
10134
  * @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
10096
10135
  *
10097
10136
  */
10098
- const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
10137
+ const Img = ({ src, rec, item, index, style, translateY, imgStyle, enableEventReport = true }) => {
10099
10138
  const ref = useRef(null);
10100
10139
  const isOnScreen = useOnScreen(ref);
10101
10140
  const { ctaEvent } = useSxpDataSource();
10102
10141
  useEffect(() => {
10103
- if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current)) {
10142
+ if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current) && enableEventReport) {
10104
10143
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
10105
10144
  eventSubject: 'ctaExposure',
10106
10145
  eventDescription: 'The cta was shown to the user'
10107
10146
  }, rec, item, index);
10108
10147
  }
10109
- }, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
10148
+ }, [isOnScreen, src, ref, rec, ctaEvent, item, index, enableEventReport]);
10110
10149
  useMemo(() => {
10111
10150
  return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? src : `${src}?imrquality/rquality/20`;
10112
10151
  }, [src]);
@@ -10116,41 +10155,12 @@ const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
10116
10155
  };
10117
10156
  var Img$1 = memo(Img);
10118
10157
 
10119
- const EventProvider = (_a) => {
10120
- var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
10121
- const ref = useRef(null);
10122
- const { popup } = useEditor();
10123
- const { setPopupDetailData, ctaEvent } = useSxpDataSource();
10124
- const { jumpToWeb } = useEventReport();
10125
- const handleClick = throttle(() => {
10126
- var _a, _b, _c, _d, _e, _f, _g, _h;
10127
- const item = (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
10128
- ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
10129
- eventSubject: 'clickCta',
10130
- eventDescription: 'User clicked the CTA'
10131
- }, rec, item, index);
10132
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
10133
- if (isExternalLink) {
10134
- if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) {
10135
- const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
10136
- const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
10137
- jumpToWeb(rec, product, cta, index);
10138
- window.location.href = window.getJointUtmLink((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link);
10139
- }
10140
- }
10141
- else {
10142
- onClick === null || onClick === void 0 ? void 0 : onClick();
10143
- }
10144
- }, popup === null || popup === void 0 ? void 0 : popup.duration);
10145
- return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
10146
- };
10147
- var EventProvider$1 = memo(EventProvider);
10148
-
10149
10158
  const CommodityList$1 = (_a) => {
10150
10159
  var _b, _c;
10151
- var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, index, translateY = 0, commodityPicture, isExternalLink } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "index", "translateY", "commodityPicture", "isExternalLink"]);
10152
- const { sxpParameter } = useSxpDataSource();
10153
- const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
10160
+ var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, index, translateY = 0, commodityPicture, isExternalLink, onClick } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "index", "translateY", "commodityPicture", "isExternalLink", "onClick"]);
10161
+ const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent } = useSxpDataSource();
10162
+ const { jumpToWeb } = useEventReport();
10163
+ const { popup } = useEditor();
10154
10164
  const recData = isPost ? rec : popupDetailData;
10155
10165
  const product = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [null, null, null, null];
10156
10166
  const priceText = useCallback((product) => {
@@ -10164,12 +10174,28 @@ const CommodityList$1 = (_a) => {
10164
10174
  return '$7,000';
10165
10175
  }
10166
10176
  }, []);
10177
+ const handleClick = throttle((item, multiCheckIndex) => {
10178
+ ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
10179
+ eventSubject: 'clickCta',
10180
+ eventDescription: 'User clicked the CTA'
10181
+ }, recData, item, index);
10182
+ setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
10183
+ if (isExternalLink) {
10184
+ if (item === null || item === void 0 ? void 0 : item.link) {
10185
+ jumpToWeb(recData, item, item.bindCta, index);
10186
+ window.location.href = window.getJointUtmLink(item.link);
10187
+ }
10188
+ }
10189
+ else {
10190
+ onClick === null || onClick === void 0 ? void 0 : onClick();
10191
+ }
10192
+ }, popup === null || popup === void 0 ? void 0 : popup.duration);
10167
10193
  return (React.createElement("div", { className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
10168
10194
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
10169
- return (React.createElement(EventProvider$1, Object.assign({ key: index, isExternalLink: isExternalLink, rec: recData, index: index }, props, { className: css({
10195
+ return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("div", Object.assign({ key: index }, props, { className: css({
10170
10196
  display: 'flex'
10171
- }) }),
10172
- React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: commodityPicture }),
10197
+ }), onClick: () => handleClick(item, index) }),
10198
+ React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: commodityPicture, enableEventReport: false }),
10173
10199
  React.createElement("div", { style: {
10174
10200
  flex: 1,
10175
10201
  width: `calc(100% - ${(_e = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.width) !== null && _e !== void 0 ? _e : 0}px - ${(_f = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.marginRight) !== null && _f !== void 0 ? _f : 0}px - ${(_g = style === null || style === void 0 ? void 0 : style.padding) !== null && _g !== void 0 ? _g : 0}px)`,
@@ -10194,9 +10220,9 @@ const CommodityList$1 = (_a) => {
10194
10220
  React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.price), dangerouslySetInnerHTML: {
10195
10221
  __html: setFontForText(priceText(item), commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
10196
10222
  } }),
10197
- React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px', maxWidth: '100px' }), dangerouslySetInnerHTML: {
10223
+ React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
10198
10224
  __html: setFontForText((_l = (_k = item === null || item === void 0 ? void 0 : item.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', buttonStyle)
10199
- } })))));
10225
+ } })))))));
10200
10226
  })));
10201
10227
  };
10202
10228
  var CommodityListComponent = memo(CommodityList$1);
@@ -10233,7 +10259,7 @@ var interactionRender$9 = [
10233
10259
  * @Author: binruan@chatlabs.com
10234
10260
  * @Date: 2024-03-20 10:27:31
10235
10261
  * @LastEditors: binruan@chatlabs.com
10236
- * @LastEditTime: 2024-07-09 16:04:28
10262
+ * @LastEditTime: 2024-07-26 17:33:03
10237
10263
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityList\material.tsx
10238
10264
  *
10239
10265
  */
@@ -10272,6 +10298,7 @@ const CommodityList = createMaterial(CommodityListComponent, {
10272
10298
  backgroundColor: '#000',
10273
10299
  fontSize: 12,
10274
10300
  height: 30,
10301
+ width: 100,
10275
10302
  textAlign: 'center',
10276
10303
  color: '#fff',
10277
10304
  lineHeight: 2.5
@@ -10555,6 +10582,36 @@ var interactionRender$8 = [
10555
10582
  }
10556
10583
  ];
10557
10584
 
10585
+ const EventProvider = (_a) => {
10586
+ var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
10587
+ const ref = useRef(null);
10588
+ const { popup } = useEditor();
10589
+ const { setPopupDetailData, ctaEvent } = useSxpDataSource();
10590
+ const { jumpToWeb } = useEventReport();
10591
+ const handleClick = throttle(() => {
10592
+ var _a, _b, _c, _d, _e, _f, _g, _h;
10593
+ const item = (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
10594
+ ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
10595
+ eventSubject: 'clickCta',
10596
+ eventDescription: 'User clicked the CTA'
10597
+ }, rec, item, index);
10598
+ setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
10599
+ if (isExternalLink) {
10600
+ if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) {
10601
+ const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
10602
+ const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
10603
+ jumpToWeb(rec, product, cta, index);
10604
+ window.location.href = window.getJointUtmLink((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link);
10605
+ }
10606
+ }
10607
+ else {
10608
+ onClick === null || onClick === void 0 ? void 0 : onClick();
10609
+ }
10610
+ }, popup === null || popup === void 0 ? void 0 : popup.duration);
10611
+ return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
10612
+ };
10613
+ var EventProvider$1 = memo(EventProvider);
10614
+
10558
10615
  var styles$8 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
10559
10616
 
10560
10617
  const Commodity$1 = (_a) => {
@@ -11125,12 +11182,12 @@ const MultiCommodityDiro$1 = (_a) => {
11125
11182
  const { popup } = useEditor();
11126
11183
  const { jumpToWeb } = useEventReport();
11127
11184
  const [products, setProducts] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
11128
- const handleClick = throttle((item) => {
11185
+ const handleClick = throttle((item, multiCheckIndex) => {
11129
11186
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
11130
11187
  eventSubject: 'clickCta',
11131
11188
  eventDescription: 'User clicked the CTA'
11132
11189
  }, recData, item, index);
11133
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index }));
11190
+ setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
11134
11191
  if (isExternalLink) {
11135
11192
  if (item === null || item === void 0 ? void 0 : item.link) {
11136
11193
  jumpToWeb(recData, item, item.bindCta, index);
@@ -11143,7 +11200,7 @@ const MultiCommodityDiro$1 = (_a) => {
11143
11200
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
11144
11201
  return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
11145
11202
  var _a, _b, _c, _d, _e, _f, _g, _h;
11146
- return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
11203
+ return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
11147
11204
  React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
11148
11205
  React.createElement("div", { className: css({
11149
11206
  color: '#000',
@@ -11241,12 +11298,12 @@ const MultiCommodity$1 = (_a) => {
11241
11298
  const { popup } = useEditor();
11242
11299
  const [products, setProducts] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
11243
11300
  const { jumpToWeb } = useEventReport();
11244
- const handleClick = throttle((item) => {
11301
+ const handleClick = throttle((item, multiCheckIndex) => {
11245
11302
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
11246
11303
  eventSubject: 'clickCta',
11247
11304
  eventDescription: 'User clicked the CTA'
11248
11305
  }, recData, item, index);
11249
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index }));
11306
+ setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
11250
11307
  if (isExternalLink) {
11251
11308
  if (item === null || item === void 0 ? void 0 : item.link) {
11252
11309
  jumpToWeb(recData, item, item.bindCta, index);
@@ -11259,7 +11316,7 @@ const MultiCommodity$1 = (_a) => {
11259
11316
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
11260
11317
  return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
11261
11318
  var _a, _b, _c, _d, _e, _f, _g, _h;
11262
- return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
11319
+ return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
11263
11320
  React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
11264
11321
  React.createElement("div", { className: css({
11265
11322
  color: '#fff',
@@ -13975,11 +14032,12 @@ const AniLink$1 = (_a) => {
13975
14032
  }
13976
14033
  }, [event === null || event === void 0 ? void 0 : event.animation]);
13977
14034
  useEffect(() => {
14035
+ var _a, _b, _c;
13978
14036
  if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
13979
14037
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
13980
14038
  eventSubject: 'ctaExposure',
13981
14039
  eventDescription: 'The cta was shown to the user'
13982
- }, recData, product, index);
14040
+ }, recData, ((_b = (_a = recData === null || recData === void 0 ? void 0 : recData.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) || (recData === null || recData === void 0 ? void 0 : recData.video), index);
13983
14041
  }
13984
14042
  }, [isOnScreen]);
13985
14043
  useEffect(() => {
@@ -14365,14 +14423,11 @@ var styles = {"aniLinkPopup":"index-module_aniLinkPopup__YT7kj","animated-fadeIn
14365
14423
  const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
14366
14424
  const AniLinkPopup$1 = (_a) => {
14367
14425
  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;
14368
- var { style, recData, ctaTempStyles, index, event, bottom_image, translateY, isTel, onClick, isExternalLink = false } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "bottom_image", "translateY", "isTel", "onClick", "isExternalLink"]);
14426
+ var { style, recData, ctaTempStyles, index, event, bottom_image, translateY, isTel, onClick, isExternalLink = false, isActive } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "bottom_image", "translateY", "isTel", "onClick", "isExternalLink", "isActive"]);
14369
14427
  style === null || style === void 0 ? true : delete style.transform;
14370
14428
  const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
14371
14429
  const { jumpToWeb } = useEventReport();
14372
- const ref = useRef(null);
14373
- const isOnScreen = useOnScreen(ref);
14374
- const [visible, setVisible] = useState(false);
14375
- const [startAni, setStartAni] = useState(true);
14430
+ const [visible, setVisible] = useState(true);
14376
14431
  const cta = ((_d = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.bindCta) || ((_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.bindCta) || ((_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindCta);
14377
14432
  const product = ((_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.bindProducts) === null || _j === void 0 ? void 0 : _j[0]) || ((_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.bindProduct);
14378
14433
  const handleTo = () => {
@@ -14408,26 +14463,21 @@ const AniLinkPopup$1 = (_a) => {
14408
14463
  const src = (_q = (_p = (_o = (_l = product === null || product === void 0 ? void 0 : product.cover) !== null && _l !== void 0 ? _l : (_m = product === null || product === void 0 ? void 0 : product.homePage) === null || _m === void 0 ? void 0 : _m[0]) !== null && _o !== void 0 ? _o : cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _p !== void 0 ? _p : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _q !== void 0 ? _q : bottom_image;
14409
14464
  const onClose = (event) => {
14410
14465
  event.stopPropagation();
14411
- setStartAni(false);
14466
+ setVisible(false);
14412
14467
  };
14413
14468
  useEffect(() => {
14414
- if (isOnScreen) {
14415
- setVisible(true);
14416
- }
14417
- else {
14418
- setVisible(false);
14419
- }
14420
- }, [isOnScreen]);
14469
+ setVisible(true);
14470
+ }, [isActive]);
14421
14471
  const aniNamStyle = useMemo(() => {
14422
- if (!visible)
14472
+ if (!isActive)
14423
14473
  return null;
14424
- return startAni ? styles['animated-fadeIn'] : null;
14425
- }, [visible, startAni]);
14474
+ return visible ? styles['animated-fadeIn'] : null;
14475
+ }, [isActive, visible]);
14426
14476
  return (React.createElement(React.Fragment, null, isTel ? (React.createElement("div", { style: {
14427
14477
  height: '40px',
14428
14478
  lineHeight: '40px',
14429
14479
  paddingLeft: '6px'
14430
- } }, "Cta Title")) : (React.createElement(React.Fragment, null, aniNamStyle ? (React.createElement("div", Object.assign({ ref: ref }, props, { className: `${css(Object.assign(Object.assign({}, style), { '--transY': `translateY(calc(100% + ${(_r = style === null || style === void 0 ? void 0 : style.margin) !== null && _r !== void 0 ? _r : 0}px))` }))} ${styles['aniLinkPopup']} ${aniNamStyle} ${css(aniTimStyle)}`, onClick: handleTo }),
14480
+ } }, "Cta Title")) : (React.createElement("div", Object.assign({}, props, { className: `${css(Object.assign(Object.assign({}, style), { '--transY': `translateY(calc(100% + ${(_r = style === null || style === void 0 ? void 0 : style.margin) !== null && _r !== void 0 ? _r : 0}px))` }))} ${styles['aniLinkPopup']} ${aniNamStyle} ${css(aniTimStyle)}`, onClick: handleTo }),
14431
14481
  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 } },
14432
14482
  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'] })),
14433
14483
  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 }),
@@ -14436,7 +14486,7 @@ const AniLinkPopup$1 = (_a) => {
14436
14486
  } })),
14437
14487
  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: {
14438
14488
  __html: setFontForText(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
14439
- } }))) : (React.createElement("div", { ref: ref, style: { position: 'absolute', height: '50px', width: '50px', bottom: 0, right: 0, zIndex: 1000 } }))))));
14489
+ } })))));
14440
14490
  };
14441
14491
  var AniLinkPopupComponent = memo(AniLinkPopup$1);
14442
14492
 
@@ -14588,52 +14638,71 @@ var _materials_ = /*#__PURE__*/Object.freeze({
14588
14638
  const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
14589
14639
  const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
14590
14640
  const LikeButton = (_a) => {
14641
+ var _b;
14591
14642
  var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
14592
- const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
14593
- const [state, setState] = useState(active);
14643
+ const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList } = useSxpDataSource();
14644
+ const [state, setState] = useState((_b = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList[position]) === null || _b === void 0 ? void 0 : _b.isCollected);
14594
14645
  const likeIcon = useIconLink(defaultLikeIconPath$1);
14595
14646
  const unlikeIcon = useIconLink(defaultUnLikeIconPath$1);
14596
14647
  const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
14597
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
14648
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
14598
14649
  if (state) {
14599
14650
  // 先设置状态
14600
14651
  setState(false);
14601
- const result = (_d = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ videoItemId: (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.itemId) !== null && _c !== void 0 ? _c : '' })))) !== null && _d !== void 0 ? _d : false;
14652
+ const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ videoItemId: (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '' })))) !== null && _e !== void 0 ? _e : false;
14602
14653
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
14603
14654
  eventInfo: {
14604
14655
  eventSubject: 'favoriteContentCanceled',
14605
14656
  eventDescription: 'This content was unfavorite by the user',
14606
- contentId: (_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
14607
- contentName: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.title) !== null && _h !== void 0 ? _h : '',
14608
- contentTags: JSON.stringify((_k = (_j = recData === null || recData === void 0 ? void 0 : recData.video) === null || _j === void 0 ? void 0 : _j.tags) !== null && _k !== void 0 ? _k : []),
14657
+ contentId: (_g = (_f = recData === null || recData === void 0 ? void 0 : recData.video) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
14658
+ contentName: (_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '',
14659
+ contentTags: JSON.stringify((_l = (_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.tags) !== null && _l !== void 0 ? _l : []),
14609
14660
  position: position + '',
14610
- contentFormat: ((_l = recData === null || recData === void 0 ? void 0 : recData.video) === null || _l === void 0 ? void 0 : _l.url) ? 'video' : 'image',
14611
- traceInfo: (_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.traceInfo
14661
+ contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
14662
+ traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
14612
14663
  }
14613
14664
  });
14614
14665
  // 如果接口调用失败,则回滚状态
14615
14666
  if (!result) {
14616
14667
  setState(true);
14617
14668
  }
14669
+ else {
14670
+ const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
14671
+ if (index === position) {
14672
+ item.isCollected = false;
14673
+ }
14674
+ return item;
14675
+ })) !== null && _p !== void 0 ? _p : [];
14676
+ setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
14677
+ }
14618
14678
  }
14619
14679
  else {
14620
14680
  setState(true);
14621
- const result = (_o = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _o !== void 0 ? _o : false;
14681
+ const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
14622
14682
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
14623
14683
  eventInfo: {
14624
14684
  eventSubject: 'favoriteContent',
14625
14685
  eventDescription: 'This content was favorite by the user',
14626
- contentId: (_q = (_p = recData === null || recData === void 0 ? void 0 : recData.video) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : '',
14627
- contentName: (_s = (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.title) !== null && _s !== void 0 ? _s : '',
14628
- contentTags: JSON.stringify((_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.tags) !== null && _u !== void 0 ? _u : []),
14686
+ contentId: (_s = (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.itemId) !== null && _s !== void 0 ? _s : '',
14687
+ contentName: (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.title) !== null && _u !== void 0 ? _u : '',
14688
+ contentTags: JSON.stringify((_w = (_v = recData === null || recData === void 0 ? void 0 : recData.video) === null || _v === void 0 ? void 0 : _v.tags) !== null && _w !== void 0 ? _w : []),
14629
14689
  position: position + '',
14630
- contentFormat: ((_v = recData === null || recData === void 0 ? void 0 : recData.video) === null || _v === void 0 ? void 0 : _v.url) ? 'video' : 'image',
14631
- traceInfo: (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.traceInfo
14690
+ contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
14691
+ traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
14632
14692
  }
14633
14693
  });
14634
14694
  if (!result) {
14635
14695
  setState(false);
14636
14696
  }
14697
+ else {
14698
+ const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
14699
+ if (index === position) {
14700
+ item.isCollected = true;
14701
+ }
14702
+ return item;
14703
+ })) !== null && _z !== void 0 ? _z : [];
14704
+ setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
14705
+ }
14637
14706
  }
14638
14707
  }), 200);
14639
14708
  return (React.createElement("button", Object.assign({}, props, { "aria-label": 'like', onClick: handleClick }),
@@ -15269,11 +15338,11 @@ function withBindDataSource(Component) {
15269
15338
  * @Author: binruan@chatlabs.com
15270
15339
  * @Date: 2023-12-26 16:11:34
15271
15340
  * @LastEditors: binruan@chatlabs.com
15272
- * @LastEditTime: 2024-07-25 18:47:37
15341
+ * @LastEditTime: 2024-07-29 10:07:08
15273
15342
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
15274
15343
  *
15275
15344
  */
15276
- const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
15345
+ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }) => {
15277
15346
  var _a, _b, _c, _d, _e;
15278
15347
  const { schema } = useEditor();
15279
15348
  if (!(rec === null || rec === void 0 ? void 0 : rec.video))
@@ -15318,12 +15387,12 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
15318
15387
  const Component = withBindDataSource(t);
15319
15388
  const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
15320
15389
  const isExternalLink = ((_2 = (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.event) === null || _1 === void 0 ? void 0 : _1.onClick) === null || _2 === void 0 ? void 0 : _2.linkType) === 'externalLink';
15321
- return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_4 = value === null || value === void 0 ? void 0 : value.item) === null || _4 === void 0 ? void 0 : _4.textStyle), bindDatas: (_6 = (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.bindDatas) !== null && _6 !== void 0 ? _6 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_7 = value === null || value === void 0 ? void 0 : value.item) === null || _7 === void 0 ? void 0 : _7.props, { event: ((_8 = value === null || value === void 0 ? void 0 : value.item) === null || _8 === void 0 ? void 0 : _8.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index })));
15390
+ return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_4 = value === null || value === void 0 ? void 0 : value.item) === null || _4 === void 0 ? void 0 : _4.textStyle), bindDatas: (_6 = (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.bindDatas) !== null && _6 !== void 0 ? _6 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_7 = value === null || value === void 0 ? void 0 : value.item) === null || _7 === void 0 ? void 0 : _7.props, { event: ((_8 = value === null || value === void 0 ? void 0 : value.item) === null || _8 === void 0 ? void 0 : _8.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index, isActive: isActive })));
15322
15391
  }
15323
15392
  else {
15324
15393
  return null;
15325
15394
  }
15326
- }, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id]);
15395
+ }, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id, isActive]);
15327
15396
  return React.createElement(React.Fragment, null, renderComp);
15328
15397
  };
15329
15398
  var RenderCard$1 = memo(RenderCard);
@@ -15411,7 +15480,7 @@ var Tagbar$1 = memo(Tagbar);
15411
15480
  * @Author: binruan@chatlabs.com
15412
15481
  * @Date: 2024-01-15 19:03:09
15413
15482
  * @LastEditors: binruan@chatlabs.com
15414
- * @LastEditTime: 2024-07-25 17:10:01
15483
+ * @LastEditTime: 2024-07-29 10:02:52
15415
15484
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
15416
15485
  *
15417
15486
  */
@@ -15629,7 +15698,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
15629
15698
  React.createElement(ExpandableText$1, { 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: (_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.title) !== null && _d !== void 0 ? _d : '', 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 }),
15630
15699
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'] }),
15631
15700
  React.createElement(Hashtag$1, { index: activeIndex, tags: (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.hashTags) !== null && _f !== void 0 ? _f : [], itemId: (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.itemId, itemType: ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))),
15632
- React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'] })));
15701
+ React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
15633
15702
  }
15634
15703
  return null;
15635
15704
  }, [
@@ -15684,7 +15753,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
15684
15753
  };
15685
15754
  const handleSlideSkip = (item, position) => {
15686
15755
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
15687
- if (isPreview)
15756
+ if (isPreview || waterFallData)
15688
15757
  return;
15689
15758
  const t = new Date() - curTime.current;
15690
15759
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.openSlideSkip) && t >= ((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.slideSkipStartTime) !== null && _a !== void 0 ? _a : 0) && getSlideSkipState() && item) {
@@ -16233,19 +16302,18 @@ var index$1 = memo(DiyPortalPreview);
16233
16302
  * @Author: binruan@chatlabs.com
16234
16303
  * @Date: 2023-10-31 10:56:01
16235
16304
  * @LastEditors: binruan@chatlabs.com
16236
- * @LastEditTime: 2024-07-25 17:15:36
16305
+ * @LastEditTime: 2024-07-29 18:06:11
16237
16306
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
16238
16307
  *
16239
16308
  */
16240
16309
  const Popup = () => {
16241
16310
  const { schema, resolver, popup } = useEditor();
16242
- const { setPopupDetailData, popupDetailData, bffEventReport } = useSxpDataSource();
16311
+ const { setPopupDetailData, popupDetailData, popupCurTimeRef, checkCommodityIndexRef } = useSxpDataSource();
16243
16312
  const { productView } = useEventReport();
16244
16313
  const [visible, setVisible] = useState();
16245
- const curTimeRef = useRef(null);
16246
16314
  useEffect(() => {
16247
16315
  const initTime = () => {
16248
- curTimeRef.current = new Date();
16316
+ popupCurTimeRef.current = new Date();
16249
16317
  };
16250
16318
  initTime();
16251
16319
  window.addEventListener('pageshow', initTime);
@@ -16255,25 +16323,37 @@ const Popup = () => {
16255
16323
  }, []);
16256
16324
  useEffect(() => {
16257
16325
  if (popup && (popup === null || popup === void 0 ? void 0 : popup.id) && (popup === null || popup === void 0 ? void 0 : popup.id) !== '') {
16258
- curTimeRef.current = new Date();
16326
+ popupCurTimeRef.current = new Date();
16259
16327
  setVisible(popup);
16260
16328
  }
16261
16329
  }, [popup]);
16262
16330
  const handleClose = () => {
16263
- var _a, _b, _c, _d;
16264
- if (!popup || (popup === null || popup === void 0 ? void 0 : popup.id) === '' || !visible || new Date() - curTimeRef.current < ((_a = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _a !== void 0 ? _a : 0)) {
16331
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
16332
+ if (!popup ||
16333
+ (popup === null || popup === void 0 ? void 0 : popup.id) === '' ||
16334
+ !visible ||
16335
+ new Date() - popupCurTimeRef.current < ((_a = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _a !== void 0 ? _a : 0)) {
16265
16336
  return;
16266
16337
  }
16267
16338
  setVisible(Object.assign(Object.assign({}, popup), { id: '' }));
16268
- const data = popupDetailData;
16269
- const product = (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
16270
- const cta = (_d = (_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.bindCta;
16271
- if (product && cta) {
16272
- productView(data, product, cta, curTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
16339
+ const value = (_d = (_c = (_b = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _b === void 0 ? void 0 : _b.globalConfig) === null || _c === void 0 ? void 0 : _c.popupList) === null || _d === void 0 ? void 0 : _d.find((item) => (item === null || item === void 0 ? void 0 : item.id) === (popup === null || popup === void 0 ? void 0 : popup.id));
16340
+ if (((_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.type) === 'CommodityDetail' || ((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.type) === 'CommodityDetailDiroNew') {
16341
+ const data = popupDetailData;
16342
+ let product = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct;
16343
+ let cta = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.bindProduct) === null || _j === void 0 ? void 0 : _j.bindCta;
16344
+ if ((checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current) >= 0) {
16345
+ const p = (_k = data === null || data === void 0 ? void 0 : data.video) === null || _k === void 0 ? void 0 : _k.bindProducts[checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current];
16346
+ product = p;
16347
+ cta = p === null || p === void 0 ? void 0 : p.bindCta;
16348
+ }
16349
+ if (product && cta) {
16350
+ productView(data, product, cta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
16351
+ }
16273
16352
  }
16274
16353
  setTimeout(() => {
16275
16354
  window === null || window === void 0 ? void 0 : window.sxpPopup('');
16276
16355
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(null);
16356
+ checkCommodityIndexRef.current = -1;
16277
16357
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
16278
16358
  };
16279
16359
  const renderPopupDetail = useMemo(() => {