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/pb-ui.js CHANGED
@@ -567,6 +567,8 @@
567
567
  const themeTag = React.useRef();
568
568
  const curTime = React.useRef();
569
569
  const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
570
+ const checkCommodityIndexRef = React.useRef();
571
+ const popupCurTimeRef = React.useRef(null);
570
572
  const isShowConsent = React.useMemo(() => {
571
573
  var _a, _b, _c, _d;
572
574
  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;
@@ -734,7 +736,7 @@
734
736
  }
735
737
  }), [bffFetch, utmVal, isShowTag]);
736
738
  const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
737
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
739
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
738
740
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
739
741
  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);
740
742
  let fromKName = '';
@@ -748,7 +750,7 @@
748
750
  fromKName = 'imagePage';
749
751
  }
750
752
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
751
- 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 })
753
+ 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 : '' })
752
754
  });
753
755
  }, [bffEventReport, isFromHashtag]);
754
756
  const h5EnterLink = React.useCallback(() => {
@@ -863,7 +865,9 @@
863
865
  isShowConsent,
864
866
  selectTag,
865
867
  setSelectTag,
866
- globalConfig
868
+ globalConfig,
869
+ popupCurTimeRef,
870
+ checkCommodityIndexRef
867
871
  } }, 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({
868
872
  rtcList,
869
873
  mutateLike: bffMutateLike,
@@ -8598,7 +8602,7 @@
8598
8602
  * @Author: binruan@chatlabs.com
8599
8603
  * @Date: 2023-11-02 18:34:34
8600
8604
  * @LastEditors: binruan@chatlabs.com
8601
- * @LastEditTime: 2024-07-25 17:05:20
8605
+ * @LastEditTime: 2024-07-29 16:20:40
8602
8606
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
8603
8607
  *
8604
8608
  */
@@ -8842,56 +8846,71 @@
8842
8846
  });
8843
8847
  var FormatImage$1 = React.memo(FormatImage);
8844
8848
 
8845
- const Scroll = ({ children, isPadding = true, style }) => {
8849
+ /*
8850
+ * @Author: binruan@chatlabs.com
8851
+ * @Date: 2024-03-20 10:27:32
8852
+ * @LastEditors: binruan@chatlabs.com
8853
+ * @LastEditTime: 2024-07-30 11:46:32
8854
+ * @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Scroll.tsx
8855
+ *
8856
+ */
8857
+ const Scroll = ({ children, isPadding = true, style, enableSlideActive = false }) => {
8846
8858
  const ref = React.useRef();
8847
8859
  const { popupDetailData } = useSxpDataSource();
8848
8860
  React.useEffect(() => {
8849
- var _a;
8850
- (_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);
8851
- }, [popupDetailData]);
8861
+ var _a, _b;
8862
+ if (enableSlideActive)
8863
+ (_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);
8864
+ }, [popupDetailData, enableSlideActive]);
8852
8865
  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));
8853
8866
  };
8854
8867
  var Scroll$1 = React.memo(Scroll);
8855
8868
 
8856
- const CommodityGroup = ({ products, data, defImg, style }) => {
8857
- var _a, _b;
8858
- const { setPopupDetailData, popupDetailData } = useSxpDataSource();
8859
- const [check, setCheck] = React.useState((_a = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _a !== void 0 ? _a : 0);
8860
- const handleClick = React.useCallback((index) => {
8861
- 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 })));
8862
- }, []);
8863
- 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) => {
8869
+ const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailData, check }) => {
8870
+ var _a;
8871
+ 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) => {
8864
8872
  var _a, _b, _c;
8865
- return (React.createElement(SwiperSlide, { className: css.css({
8873
+ return (React.createElement(React.Fragment, null, (item === null || item === void 0 ? void 0 : item.bindCta) ? (React.createElement(SwiperSlide, { className: css.css({
8866
8874
  width: '50px',
8867
8875
  height: '50px',
8868
8876
  marginRight: '10px'
8869
- }), onClick: () => handleClick(index), key: index },
8877
+ }), onClick: () => {
8878
+ onCLick === null || onCLick === void 0 ? void 0 : onCLick(index);
8879
+ }, key: index },
8870
8880
  React.createElement(FormatImage$1, { style: {
8871
8881
  height: '100%',
8872
8882
  width: '100%',
8873
8883
  objectFit: 'cover',
8874
8884
  display: 'block',
8875
- objectPosition: `50% ${(data === null || data === void 0 ? void 0 : data.translateY) ? -(data === null || data === void 0 ? void 0 : data.translateY) + 50 : 50}%`,
8876
- border: check === index ? '1px solid #000' : '1px solid #f2f2f2'
8877
- }, 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 })));
8885
+ objectPosition: `50% ${(data === null || data === void 0 ? void 0 : data.translateY) ? (data === null || data === void 0 ? void 0 : data.translateY) + 50 : 50}%`,
8886
+ border: check === index ? '1px solid #000' : '1px solid #f2f2f2',
8887
+ boxSizing: 'border-box'
8888
+ }, 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));
8878
8889
  })))));
8879
8890
  };
8880
8891
  var CommodityGroup$1 = React.memo(CommodityGroup);
8881
8892
 
8882
8893
  const CommodityDetail$1 = (_a) => {
8883
- var _b, _c, _d, _e, _f, _g, _h, _j, _k;
8894
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
8884
8895
  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"]);
8885
- const { sxpParameter } = useSxpDataSource();
8886
- const { popupDetailData, bffEventReport, isPreview, bffFbReport } = useSxpDataSource();
8896
+ const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef } = useSxpDataSource();
8897
+ useEditor();
8887
8898
  const { jumpToWeb, productView } = useEventReport();
8888
8899
  const curTimeRef = React.useRef(null);
8889
8900
  const [showModal, setShowModal] = React.useState(false);
8890
8901
  const [show3DModal, setShow3DModal] = React.useState(false);
8902
+ const [checkCommodityIndex, setCheckCommodityIndex] = React.useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
8891
8903
  const data = isPost ? rec : popupDetailData;
8892
- 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;
8893
- 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;
8904
+ 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];
8905
+ let cta = isPost
8906
+ ? (_g = data === null || data === void 0 ? void 0 : data.product) === null || _g === void 0 ? void 0 : _g.bindCta
8907
+ : (_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;
8894
8908
  const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
8909
+ 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) {
8910
+ const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
8911
+ product = p;
8912
+ cta = p === null || p === void 0 ? void 0 : p.bindCta;
8913
+ }
8895
8914
  const handleLink = () => {
8896
8915
  if (product === null || product === void 0 ? void 0 : product.link) {
8897
8916
  jumpToWeb(data, product, cta, position);
@@ -8929,7 +8948,7 @@
8929
8948
  return '$7,000';
8930
8949
  }
8931
8950
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
8932
- const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
8951
+ const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
8933
8952
  const renderContent = ({ isPost }) => {
8934
8953
  var _a, _b, _c;
8935
8954
  return (React.createElement("div", null,
@@ -8962,15 +8981,19 @@
8962
8981
  }
8963
8982
  return style;
8964
8983
  }, []);
8984
+ const handleClick = React.useCallback((index) => {
8985
+ popupCurTimeRef.current = new Date();
8986
+ setCheckCommodityIndex(index);
8987
+ }, []);
8965
8988
  const renderCommodityGroup = React.useCallback(() => {
8966
8989
  var _a, _b, _c;
8967
8990
  if (isPost)
8968
8991
  return;
8969
- 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' } }));
8970
- }, []);
8992
+ 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 }));
8993
+ }, [checkCommodityIndex]);
8971
8994
  return (React.createElement(React.Fragment, null,
8972
8995
  React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
8973
- 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' } },
8996
+ 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' } },
8974
8997
  React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
8975
8998
  clickable: true,
8976
8999
  bulletActiveClass: 'swipe-item-active-bullet',
@@ -8980,7 +9003,7 @@
8980
9003
  }, loop: true, autoplay: {
8981
9004
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
8982
9005
  } },
8983
- React.createElement(React.Fragment, null, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
9006
+ React.createElement(React.Fragment, null, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
8984
9007
  return (React.createElement(SwiperSlide, { key: src },
8985
9008
  React.createElement("div", { style: {
8986
9009
  overflow: 'hidden',
@@ -8995,7 +9018,7 @@
8995
9018
  objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
8996
9019
  }, src: src }))));
8997
9020
  }))))),
8998
- !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css.css({
9021
+ !((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css.css({
8999
9022
  position: 'relative',
9000
9023
  height: 0,
9001
9024
  width: '100%',
@@ -9008,7 +9031,7 @@
9008
9031
  top: 0,
9009
9032
  objectFit: 'cover',
9010
9033
  width: '100%'
9011
- }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: 'pdp image' }))),
9034
+ }), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
9012
9035
  renderCommodityGroup(),
9013
9036
  React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
9014
9037
  renderBtn(),
@@ -9577,21 +9600,28 @@
9577
9600
  ];
9578
9601
 
9579
9602
  const CommodityDetailDiroNew$1 = (_a) => {
9580
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
9603
+ 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;
9581
9604
  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"]);
9582
9605
  React.useState(true);
9583
- const { sxpParameter } = useSxpDataSource();
9584
- const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
9606
+ const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport } = useSxpDataSource();
9585
9607
  const { jumpToWeb, productView } = useEventReport();
9586
9608
  React.useState(false);
9587
9609
  React.useState(false);
9588
9610
  React.useState(true);
9589
9611
  const [showModal, setShowModal] = React.useState(false);
9590
9612
  const curTimeRef = React.useRef(null);
9613
+ const [checkCommodityIndex, setCheckCommodityIndex] = React.useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
9591
9614
  const data = isPost ? rec : popupDetailData;
9592
- 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;
9593
- 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;
9615
+ 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];
9616
+ let cta = isPost
9617
+ ? (_g = data === null || data === void 0 ? void 0 : data.product) === null || _g === void 0 ? void 0 : _g.bindCta
9618
+ : (_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;
9594
9619
  const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
9620
+ 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) {
9621
+ const p = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts[checkCommodityIndex];
9622
+ product = p;
9623
+ cta = p === null || p === void 0 ? void 0 : p.bindCta;
9624
+ }
9595
9625
  const handleLink = () => {
9596
9626
  if (product === null || product === void 0 ? void 0 : product.link) {
9597
9627
  jumpToWeb(data, product, cta, position);
@@ -9629,7 +9659,7 @@
9629
9659
  return '£102,300.00';
9630
9660
  }
9631
9661
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
9632
- const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
9662
+ const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
9633
9663
  // useEffect(() => {
9634
9664
  // console.log(scrollRef?.current?.scrollHeight, window.innerHeight);
9635
9665
  // if (scrollRef?.current && scrollRef?.current?.scrollHeight > window.innerHeight) {
@@ -9692,15 +9722,19 @@ Made in Italy` })));
9692
9722
  }
9693
9723
  return style;
9694
9724
  }, []);
9725
+ const handleClick = React.useCallback((index) => {
9726
+ popupCurTimeRef.current = new Date();
9727
+ setCheckCommodityIndex(index);
9728
+ }, []);
9695
9729
  const renderCommodityGroup = React.useCallback(() => {
9696
9730
  var _a, _b, _c;
9697
9731
  if (isPost)
9698
9732
  return;
9699
- 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' } }));
9700
- }, []);
9733
+ 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 }));
9734
+ }, [checkCommodityIndex]);
9701
9735
  return (React.createElement("div", { className: 'pb-commondityDiroNew' },
9702
- React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
9703
- 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: {
9736
+ React.createElement("div", Object.assign({ className: css.css(Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' })) }, props),
9737
+ 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: {
9704
9738
  clickable: true,
9705
9739
  bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
9706
9740
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -9708,7 +9742,7 @@ Made in Italy` })));
9708
9742
  : 'commondityDiroNew-swiper-clickable-center'
9709
9743
  }, loop: true, autoplay: {
9710
9744
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
9711
- } }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
9745
+ } }, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
9712
9746
  return (React.createElement(SwiperSlide, { key: src },
9713
9747
  React.createElement("div", { style: {
9714
9748
  overflow: 'hidden',
@@ -9723,7 +9757,7 @@ Made in Italy` })));
9723
9757
  objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
9724
9758
  }, src: src }))));
9725
9759
  }))),
9726
- !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css.css({
9760
+ !((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css.css({
9727
9761
  position: 'relative',
9728
9762
  height: 0,
9729
9763
  width: '100%',
@@ -9736,13 +9770,13 @@ Made in Italy` })));
9736
9770
  top: 0,
9737
9771
  objectFit: 'cover',
9738
9772
  width: '100%'
9739
- }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: 'pdp image' }))),
9773
+ }), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
9740
9774
  renderCommodityGroup(),
9741
9775
  React.createElement("div", { className: 'pb-commondityDiroNew-content' },
9742
9776
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
9743
9777
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
9744
9778
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), dangerouslySetInnerHTML: {
9745
- __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)
9779
+ __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)
9746
9780
  } }),
9747
9781
  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: {
9748
9782
  __html: setFontForText((product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage CalfskinLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
@@ -9752,11 +9786,11 @@ Made in Italy` })));
9752
9786
  __html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
9753
9787
  } }),
9754
9788
  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: {
9755
- __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)
9789
+ __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)
9756
9790
  } }))),
9757
- (!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 },
9791
+ (!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 },
9758
9792
  React.createElement("span", { dangerouslySetInnerHTML: {
9759
- __html: setFontForText((_p = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _p !== void 0 ? _p : 'Shop now', buttonStyle)
9793
+ __html: setFontForText((_1 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _1 !== void 0 ? _1 : 'Shop now', buttonStyle)
9760
9794
  } }))),
9761
9795
  productInfoText({ isPost }))),
9762
9796
  React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
@@ -10002,6 +10036,11 @@ Made in Italy` })));
10002
10036
  type: 'Group',
10003
10037
  label: '尺寸',
10004
10038
  child: [
10039
+ {
10040
+ type: 'Number',
10041
+ name: ['props', 'buttonStyle', 'width'],
10042
+ addonAfter: 'W'
10043
+ },
10005
10044
  {
10006
10045
  type: 'Number',
10007
10046
  name: ['props', 'buttonStyle', 'height'],
@@ -10110,18 +10149,18 @@ Made in Italy` })));
10110
10149
  * @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
10111
10150
  *
10112
10151
  */
10113
- const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
10152
+ const Img = ({ src, rec, item, index, style, translateY, imgStyle, enableEventReport = true }) => {
10114
10153
  const ref = React.useRef(null);
10115
10154
  const isOnScreen = useOnScreen(ref);
10116
10155
  const { ctaEvent } = useSxpDataSource();
10117
10156
  React.useEffect(() => {
10118
- if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current)) {
10157
+ if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current) && enableEventReport) {
10119
10158
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
10120
10159
  eventSubject: 'ctaExposure',
10121
10160
  eventDescription: 'The cta was shown to the user'
10122
10161
  }, rec, item, index);
10123
10162
  }
10124
- }, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
10163
+ }, [isOnScreen, src, ref, rec, ctaEvent, item, index, enableEventReport]);
10125
10164
  React.useMemo(() => {
10126
10165
  return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? src : `${src}?imrquality/rquality/20`;
10127
10166
  }, [src]);
@@ -10131,41 +10170,12 @@ Made in Italy` })));
10131
10170
  };
10132
10171
  var Img$1 = React.memo(Img);
10133
10172
 
10134
- const EventProvider = (_a) => {
10135
- var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
10136
- const ref = React.useRef(null);
10137
- const { popup } = useEditor();
10138
- const { setPopupDetailData, ctaEvent } = useSxpDataSource();
10139
- const { jumpToWeb } = useEventReport();
10140
- const handleClick = lodash.throttle(() => {
10141
- var _a, _b, _c, _d, _e, _f, _g, _h;
10142
- 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;
10143
- ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
10144
- eventSubject: 'clickCta',
10145
- eventDescription: 'User clicked the CTA'
10146
- }, rec, item, index);
10147
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
10148
- if (isExternalLink) {
10149
- 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) {
10150
- const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
10151
- const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
10152
- jumpToWeb(rec, product, cta, index);
10153
- 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);
10154
- }
10155
- }
10156
- else {
10157
- onClick === null || onClick === void 0 ? void 0 : onClick();
10158
- }
10159
- }, popup === null || popup === void 0 ? void 0 : popup.duration);
10160
- return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
10161
- };
10162
- var EventProvider$1 = React.memo(EventProvider);
10163
-
10164
10173
  const CommodityList$1 = (_a) => {
10165
10174
  var _b, _c;
10166
- 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"]);
10167
- const { sxpParameter } = useSxpDataSource();
10168
- const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
10175
+ 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"]);
10176
+ const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent } = useSxpDataSource();
10177
+ const { jumpToWeb } = useEventReport();
10178
+ const { popup } = useEditor();
10169
10179
  const recData = isPost ? rec : popupDetailData;
10170
10180
  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];
10171
10181
  const priceText = React.useCallback((product) => {
@@ -10179,12 +10189,28 @@ Made in Italy` })));
10179
10189
  return '$7,000';
10180
10190
  }
10181
10191
  }, []);
10192
+ const handleClick = lodash.throttle((item, multiCheckIndex) => {
10193
+ ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
10194
+ eventSubject: 'clickCta',
10195
+ eventDescription: 'User clicked the CTA'
10196
+ }, recData, item, index);
10197
+ 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 }));
10198
+ if (isExternalLink) {
10199
+ if (item === null || item === void 0 ? void 0 : item.link) {
10200
+ jumpToWeb(recData, item, item.bindCta, index);
10201
+ window.location.href = window.getJointUtmLink(item.link);
10202
+ }
10203
+ }
10204
+ else {
10205
+ onClick === null || onClick === void 0 ? void 0 : onClick();
10206
+ }
10207
+ }, popup === null || popup === void 0 ? void 0 : popup.duration);
10182
10208
  return (React.createElement("div", { className: css.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) => {
10183
10209
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
10184
- return (React.createElement(EventProvider$1, Object.assign({ key: index, isExternalLink: isExternalLink, rec: recData, index: index }, props, { className: css.css({
10210
+ 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.css({
10185
10211
  display: 'flex'
10186
- }) }),
10187
- 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 }),
10212
+ }), onClick: () => handleClick(item, index) }),
10213
+ 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 }),
10188
10214
  React.createElement("div", { style: {
10189
10215
  flex: 1,
10190
10216
  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)`,
@@ -10209,9 +10235,9 @@ Made in Italy` })));
10209
10235
  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: {
10210
10236
  __html: setFontForText(priceText(item), commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
10211
10237
  } }),
10212
- React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px', maxWidth: '100px' }), dangerouslySetInnerHTML: {
10238
+ React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
10213
10239
  __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)
10214
- } })))));
10240
+ } })))))));
10215
10241
  })));
10216
10242
  };
10217
10243
  var CommodityListComponent = React.memo(CommodityList$1);
@@ -10248,7 +10274,7 @@ Made in Italy` })));
10248
10274
  * @Author: binruan@chatlabs.com
10249
10275
  * @Date: 2024-03-20 10:27:31
10250
10276
  * @LastEditors: binruan@chatlabs.com
10251
- * @LastEditTime: 2024-07-09 16:04:28
10277
+ * @LastEditTime: 2024-07-26 17:33:03
10252
10278
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityList\material.tsx
10253
10279
  *
10254
10280
  */
@@ -10287,6 +10313,7 @@ Made in Italy` })));
10287
10313
  backgroundColor: '#000',
10288
10314
  fontSize: 12,
10289
10315
  height: 30,
10316
+ width: 100,
10290
10317
  textAlign: 'center',
10291
10318
  color: '#fff',
10292
10319
  lineHeight: 2.5
@@ -10570,6 +10597,36 @@ Made in Italy` })));
10570
10597
  }
10571
10598
  ];
10572
10599
 
10600
+ const EventProvider = (_a) => {
10601
+ var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
10602
+ const ref = React.useRef(null);
10603
+ const { popup } = useEditor();
10604
+ const { setPopupDetailData, ctaEvent } = useSxpDataSource();
10605
+ const { jumpToWeb } = useEventReport();
10606
+ const handleClick = lodash.throttle(() => {
10607
+ var _a, _b, _c, _d, _e, _f, _g, _h;
10608
+ 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;
10609
+ ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
10610
+ eventSubject: 'clickCta',
10611
+ eventDescription: 'User clicked the CTA'
10612
+ }, rec, item, index);
10613
+ setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
10614
+ if (isExternalLink) {
10615
+ 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) {
10616
+ const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
10617
+ const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
10618
+ jumpToWeb(rec, product, cta, index);
10619
+ 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);
10620
+ }
10621
+ }
10622
+ else {
10623
+ onClick === null || onClick === void 0 ? void 0 : onClick();
10624
+ }
10625
+ }, popup === null || popup === void 0 ? void 0 : popup.duration);
10626
+ return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
10627
+ };
10628
+ var EventProvider$1 = React.memo(EventProvider);
10629
+
10573
10630
  var styles$8 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
10574
10631
 
10575
10632
  const Commodity$1 = (_a) => {
@@ -11140,12 +11197,12 @@ Made in Italy` })));
11140
11197
  const { popup } = useEditor();
11141
11198
  const { jumpToWeb } = useEventReport();
11142
11199
  const [products, setProducts] = React.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]);
11143
- const handleClick = lodash.throttle((item) => {
11200
+ const handleClick = lodash.throttle((item, multiCheckIndex) => {
11144
11201
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
11145
11202
  eventSubject: 'clickCta',
11146
11203
  eventDescription: 'User clicked the CTA'
11147
11204
  }, recData, item, index);
11148
- 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 }));
11205
+ 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 }));
11149
11206
  if (isExternalLink) {
11150
11207
  if (item === null || item === void 0 ? void 0 : item.link) {
11151
11208
  jumpToWeb(recData, item, item.bindCta, index);
@@ -11158,7 +11215,7 @@ Made in Italy` })));
11158
11215
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
11159
11216
  return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
11160
11217
  var _a, _b, _c, _d, _e, _f, _g, _h;
11161
- 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.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
11218
+ 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.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
11162
11219
  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 }),
11163
11220
  React.createElement("div", { className: css.css({
11164
11221
  color: '#000',
@@ -11256,12 +11313,12 @@ Made in Italy` })));
11256
11313
  const { popup } = useEditor();
11257
11314
  const [products, setProducts] = React.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]);
11258
11315
  const { jumpToWeb } = useEventReport();
11259
- const handleClick = lodash.throttle((item) => {
11316
+ const handleClick = lodash.throttle((item, multiCheckIndex) => {
11260
11317
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
11261
11318
  eventSubject: 'clickCta',
11262
11319
  eventDescription: 'User clicked the CTA'
11263
11320
  }, recData, item, index);
11264
- 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 }));
11321
+ 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 }));
11265
11322
  if (isExternalLink) {
11266
11323
  if (item === null || item === void 0 ? void 0 : item.link) {
11267
11324
  jumpToWeb(recData, item, item.bindCta, index);
@@ -11274,7 +11331,7 @@ Made in Italy` })));
11274
11331
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
11275
11332
  return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
11276
11333
  var _a, _b, _c, _d, _e, _f, _g, _h;
11277
- 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.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
11334
+ 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.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
11278
11335
  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 }),
11279
11336
  React.createElement("div", { className: css.css({
11280
11337
  color: '#fff',
@@ -13990,11 +14047,12 @@ Made in Italy` })));
13990
14047
  }
13991
14048
  }, [event === null || event === void 0 ? void 0 : event.animation]);
13992
14049
  React.useEffect(() => {
14050
+ var _a, _b, _c;
13993
14051
  if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
13994
14052
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
13995
14053
  eventSubject: 'ctaExposure',
13996
14054
  eventDescription: 'The cta was shown to the user'
13997
- }, recData, product, index);
14055
+ }, 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);
13998
14056
  }
13999
14057
  }, [isOnScreen]);
14000
14058
  React.useEffect(() => {
@@ -14380,14 +14438,11 @@ Made in Italy` })));
14380
14438
  const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
14381
14439
  const AniLinkPopup$1 = (_a) => {
14382
14440
  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;
14383
- 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"]);
14441
+ 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"]);
14384
14442
  style === null || style === void 0 ? true : delete style.transform;
14385
14443
  const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
14386
14444
  const { jumpToWeb } = useEventReport();
14387
- const ref = React.useRef(null);
14388
- const isOnScreen = useOnScreen(ref);
14389
- const [visible, setVisible] = React.useState(false);
14390
- const [startAni, setStartAni] = React.useState(true);
14445
+ const [visible, setVisible] = React.useState(true);
14391
14446
  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);
14392
14447
  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);
14393
14448
  const handleTo = () => {
@@ -14423,26 +14478,21 @@ Made in Italy` })));
14423
14478
  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;
14424
14479
  const onClose = (event) => {
14425
14480
  event.stopPropagation();
14426
- setStartAni(false);
14481
+ setVisible(false);
14427
14482
  };
14428
14483
  React.useEffect(() => {
14429
- if (isOnScreen) {
14430
- setVisible(true);
14431
- }
14432
- else {
14433
- setVisible(false);
14434
- }
14435
- }, [isOnScreen]);
14484
+ setVisible(true);
14485
+ }, [isActive]);
14436
14486
  const aniNamStyle = React.useMemo(() => {
14437
- if (!visible)
14487
+ if (!isActive)
14438
14488
  return null;
14439
- return startAni ? styles['animated-fadeIn'] : null;
14440
- }, [visible, startAni]);
14489
+ return visible ? styles['animated-fadeIn'] : null;
14490
+ }, [isActive, visible]);
14441
14491
  return (React.createElement(React.Fragment, null, isTel ? (React.createElement("div", { style: {
14442
14492
  height: '40px',
14443
14493
  lineHeight: '40px',
14444
14494
  paddingLeft: '6px'
14445
- } }, "Cta Title")) : (React.createElement(React.Fragment, null, aniNamStyle ? (React.createElement("div", Object.assign({ ref: ref }, props, { className: `${css.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.css(aniTimStyle)}`, onClick: handleTo }),
14495
+ } }, "Cta Title")) : (React.createElement("div", Object.assign({}, props, { className: `${css.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.css(aniTimStyle)}`, onClick: handleTo }),
14446
14496
  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 } },
14447
14497
  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'] })),
14448
14498
  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 }),
@@ -14451,7 +14501,7 @@ Made in Italy` })));
14451
14501
  } })),
14452
14502
  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: {
14453
14503
  __html: setFontForText(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
14454
- } }))) : (React.createElement("div", { ref: ref, style: { position: 'absolute', height: '50px', width: '50px', bottom: 0, right: 0, zIndex: 1000 } }))))));
14504
+ } })))));
14455
14505
  };
14456
14506
  var AniLinkPopupComponent = React.memo(AniLinkPopup$1);
14457
14507
 
@@ -14603,52 +14653,71 @@ Made in Italy` })));
14603
14653
  const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
14604
14654
  const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
14605
14655
  const LikeButton = (_a) => {
14656
+ var _b;
14606
14657
  var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
14607
- const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
14608
- const [state, setState] = React.useState(active);
14658
+ const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList } = useSxpDataSource();
14659
+ const [state, setState] = React.useState((_b = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList[position]) === null || _b === void 0 ? void 0 : _b.isCollected);
14609
14660
  const likeIcon = useIconLink(defaultLikeIconPath$1);
14610
14661
  const unlikeIcon = useIconLink(defaultUnLikeIconPath$1);
14611
14662
  const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
14612
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
14663
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
14613
14664
  if (state) {
14614
14665
  // 先设置状态
14615
14666
  setState(false);
14616
- 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;
14667
+ 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;
14617
14668
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
14618
14669
  eventInfo: {
14619
14670
  eventSubject: 'favoriteContentCanceled',
14620
14671
  eventDescription: 'This content was unfavorite by the user',
14621
- 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 : '',
14622
- 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 : '',
14623
- 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 : []),
14672
+ 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 : '',
14673
+ 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 : '',
14674
+ 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 : []),
14624
14675
  position: position + '',
14625
- contentFormat: ((_l = recData === null || recData === void 0 ? void 0 : recData.video) === null || _l === void 0 ? void 0 : _l.url) ? 'video' : 'image',
14626
- traceInfo: (_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.traceInfo
14676
+ contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
14677
+ traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
14627
14678
  }
14628
14679
  });
14629
14680
  // 如果接口调用失败,则回滚状态
14630
14681
  if (!result) {
14631
14682
  setState(true);
14632
14683
  }
14684
+ else {
14685
+ const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
14686
+ if (index === position) {
14687
+ item.isCollected = false;
14688
+ }
14689
+ return item;
14690
+ })) !== null && _p !== void 0 ? _p : [];
14691
+ setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
14692
+ }
14633
14693
  }
14634
14694
  else {
14635
14695
  setState(true);
14636
- const result = (_o = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _o !== void 0 ? _o : false;
14696
+ const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
14637
14697
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
14638
14698
  eventInfo: {
14639
14699
  eventSubject: 'favoriteContent',
14640
14700
  eventDescription: 'This content was favorite by the user',
14641
- 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 : '',
14642
- 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 : '',
14643
- 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 : []),
14701
+ 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 : '',
14702
+ 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 : '',
14703
+ 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 : []),
14644
14704
  position: position + '',
14645
- contentFormat: ((_v = recData === null || recData === void 0 ? void 0 : recData.video) === null || _v === void 0 ? void 0 : _v.url) ? 'video' : 'image',
14646
- traceInfo: (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.traceInfo
14705
+ contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
14706
+ traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
14647
14707
  }
14648
14708
  });
14649
14709
  if (!result) {
14650
14710
  setState(false);
14651
14711
  }
14712
+ else {
14713
+ const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
14714
+ if (index === position) {
14715
+ item.isCollected = true;
14716
+ }
14717
+ return item;
14718
+ })) !== null && _z !== void 0 ? _z : [];
14719
+ setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
14720
+ }
14652
14721
  }
14653
14722
  }), 200);
14654
14723
  return (React.createElement("button", Object.assign({}, props, { "aria-label": 'like', onClick: handleClick }),
@@ -15284,11 +15353,11 @@ Made in Italy` })));
15284
15353
  * @Author: binruan@chatlabs.com
15285
15354
  * @Date: 2023-12-26 16:11:34
15286
15355
  * @LastEditors: binruan@chatlabs.com
15287
- * @LastEditTime: 2024-07-25 18:47:37
15356
+ * @LastEditTime: 2024-07-29 10:07:08
15288
15357
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
15289
15358
  *
15290
15359
  */
15291
- const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
15360
+ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }) => {
15292
15361
  var _a, _b, _c, _d, _e;
15293
15362
  const { schema } = useEditor();
15294
15363
  if (!(rec === null || rec === void 0 ? void 0 : rec.video))
@@ -15333,12 +15402,12 @@ Made in Italy` })));
15333
15402
  const Component = withBindDataSource(t);
15334
15403
  const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
15335
15404
  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';
15336
- 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 })));
15405
+ 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 })));
15337
15406
  }
15338
15407
  else {
15339
15408
  return null;
15340
15409
  }
15341
- }, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id]);
15410
+ }, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id, isActive]);
15342
15411
  return React.createElement(React.Fragment, null, renderComp);
15343
15412
  };
15344
15413
  var RenderCard$1 = React.memo(RenderCard);
@@ -15426,7 +15495,7 @@ Made in Italy` })));
15426
15495
  * @Author: binruan@chatlabs.com
15427
15496
  * @Date: 2024-01-15 19:03:09
15428
15497
  * @LastEditors: binruan@chatlabs.com
15429
- * @LastEditTime: 2024-07-25 17:10:01
15498
+ * @LastEditTime: 2024-07-29 10:02:52
15430
15499
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
15431
15500
  *
15432
15501
  */
@@ -15644,7 +15713,7 @@ Made in Italy` })));
15644
15713
  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 }),
15645
15714
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'] }),
15646
15715
  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 }))),
15647
- React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'] })));
15716
+ React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
15648
15717
  }
15649
15718
  return null;
15650
15719
  }, [
@@ -15699,7 +15768,7 @@ Made in Italy` })));
15699
15768
  };
15700
15769
  const handleSlideSkip = (item, position) => {
15701
15770
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
15702
- if (isPreview)
15771
+ if (isPreview || waterFallData)
15703
15772
  return;
15704
15773
  const t = new Date() - curTime.current;
15705
15774
  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) {
@@ -16248,19 +16317,18 @@ Made in Italy` })));
16248
16317
  * @Author: binruan@chatlabs.com
16249
16318
  * @Date: 2023-10-31 10:56:01
16250
16319
  * @LastEditors: binruan@chatlabs.com
16251
- * @LastEditTime: 2024-07-25 17:15:36
16320
+ * @LastEditTime: 2024-07-29 18:06:11
16252
16321
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
16253
16322
  *
16254
16323
  */
16255
16324
  const Popup = () => {
16256
16325
  const { schema, resolver, popup } = useEditor();
16257
- const { setPopupDetailData, popupDetailData, bffEventReport } = useSxpDataSource();
16326
+ const { setPopupDetailData, popupDetailData, popupCurTimeRef, checkCommodityIndexRef } = useSxpDataSource();
16258
16327
  const { productView } = useEventReport();
16259
16328
  const [visible, setVisible] = React.useState();
16260
- const curTimeRef = React.useRef(null);
16261
16329
  React.useEffect(() => {
16262
16330
  const initTime = () => {
16263
- curTimeRef.current = new Date();
16331
+ popupCurTimeRef.current = new Date();
16264
16332
  };
16265
16333
  initTime();
16266
16334
  window.addEventListener('pageshow', initTime);
@@ -16270,25 +16338,37 @@ Made in Italy` })));
16270
16338
  }, []);
16271
16339
  React.useEffect(() => {
16272
16340
  if (popup && (popup === null || popup === void 0 ? void 0 : popup.id) && (popup === null || popup === void 0 ? void 0 : popup.id) !== '') {
16273
- curTimeRef.current = new Date();
16341
+ popupCurTimeRef.current = new Date();
16274
16342
  setVisible(popup);
16275
16343
  }
16276
16344
  }, [popup]);
16277
16345
  const handleClose = () => {
16278
- var _a, _b, _c, _d;
16279
- 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)) {
16346
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
16347
+ if (!popup ||
16348
+ (popup === null || popup === void 0 ? void 0 : popup.id) === '' ||
16349
+ !visible ||
16350
+ new Date() - popupCurTimeRef.current < ((_a = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _a !== void 0 ? _a : 0)) {
16280
16351
  return;
16281
16352
  }
16282
16353
  setVisible(Object.assign(Object.assign({}, popup), { id: '' }));
16283
- const data = popupDetailData;
16284
- const product = (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
16285
- 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;
16286
- if (product && cta) {
16287
- productView(data, product, cta, curTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
16354
+ 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));
16355
+ 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') {
16356
+ const data = popupDetailData;
16357
+ let product = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct;
16358
+ 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;
16359
+ if ((checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current) >= 0) {
16360
+ 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];
16361
+ product = p;
16362
+ cta = p === null || p === void 0 ? void 0 : p.bindCta;
16363
+ }
16364
+ if (product && cta) {
16365
+ productView(data, product, cta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
16366
+ }
16288
16367
  }
16289
16368
  setTimeout(() => {
16290
16369
  window === null || window === void 0 ? void 0 : window.sxpPopup('');
16291
16370
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(null);
16371
+ checkCommodityIndexRef.current = -1;
16292
16372
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
16293
16373
  };
16294
16374
  const renderPopupDetail = React.useMemo(() => {