pb-sxp-ui 1.2.3 → 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 (68) hide show
  1. package/dist/index.cjs +276 -172
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +2 -2
  4. package/dist/index.js +276 -172
  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 +276 -172
  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/Hashtag/index.js +0 -1
  15. package/es/core/components/SxpPageRender/LikeButton/index.js +34 -15
  16. package/es/core/components/SxpPageRender/Modal/index.js +16 -8
  17. package/es/core/components/SxpPageRender/Popup/index.js +24 -13
  18. package/es/core/components/SxpPageRender/RenderCard.d.ts +1 -0
  19. package/es/core/components/SxpPageRender/RenderCard.js +17 -4
  20. package/es/core/components/SxpPageRender/index.js +3 -3
  21. package/es/core/components/SxpPageRender/typing.d.ts +1 -0
  22. package/es/core/context/SxpDataSourceProvider.d.ts +3 -3
  23. package/es/core/context/SxpDataSourceProvider.js +7 -3
  24. package/es/materials/sxp/cta/AniLink/index.js +5 -1
  25. package/es/materials/sxp/cta/AniLinkPopup/index.d.ts +1 -0
  26. package/es/materials/sxp/cta/AniLinkPopup/index.js +12 -18
  27. package/es/materials/sxp/cta/AniLinkPopup/settingRender.js +1 -1
  28. package/es/materials/sxp/popup/CommodityDetail/index.js +25 -13
  29. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +28 -17
  30. package/es/materials/sxp/popup/CommodityList/index.js +28 -10
  31. package/es/materials/sxp/popup/CommodityList/material.js +1 -0
  32. package/es/materials/sxp/popup/CommodityList/settingRender.js +5 -0
  33. package/es/materials/sxp/template/MultiCommodity/index.js +3 -3
  34. package/es/materials/sxp/template/MultiCommodityDiro/index.js +3 -3
  35. package/es/materials/sxp/template/components/CommodityGroup.d.ts +4 -0
  36. package/es/materials/sxp/template/components/CommodityGroup.js +12 -15
  37. package/es/materials/sxp/template/components/Img.d.ts +1 -0
  38. package/es/materials/sxp/template/components/Img.js +3 -3
  39. package/es/materials/sxp/template/components/Scroll.d.ts +1 -0
  40. package/es/materials/sxp/template/components/Scroll.js +5 -4
  41. package/lib/core/components/SxpPageRender/Hashtag/index.js +0 -1
  42. package/lib/core/components/SxpPageRender/LikeButton/index.js +34 -15
  43. package/lib/core/components/SxpPageRender/Modal/index.js +16 -8
  44. package/lib/core/components/SxpPageRender/Popup/index.js +23 -12
  45. package/lib/core/components/SxpPageRender/RenderCard.d.ts +1 -0
  46. package/lib/core/components/SxpPageRender/RenderCard.js +17 -4
  47. package/lib/core/components/SxpPageRender/index.js +3 -3
  48. package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
  49. package/lib/core/context/SxpDataSourceProvider.d.ts +3 -3
  50. package/lib/core/context/SxpDataSourceProvider.js +7 -3
  51. package/lib/materials/sxp/cta/AniLink/index.js +5 -1
  52. package/lib/materials/sxp/cta/AniLinkPopup/index.d.ts +1 -0
  53. package/lib/materials/sxp/cta/AniLinkPopup/index.js +11 -17
  54. package/lib/materials/sxp/cta/AniLinkPopup/settingRender.js +1 -1
  55. package/lib/materials/sxp/popup/CommodityDetail/index.js +24 -12
  56. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +28 -17
  57. package/lib/materials/sxp/popup/CommodityList/index.js +27 -9
  58. package/lib/materials/sxp/popup/CommodityList/material.js +1 -0
  59. package/lib/materials/sxp/popup/CommodityList/settingRender.js +5 -0
  60. package/lib/materials/sxp/template/MultiCommodity/index.js +3 -3
  61. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +3 -3
  62. package/lib/materials/sxp/template/components/CommodityGroup.d.ts +4 -0
  63. package/lib/materials/sxp/template/components/CommodityGroup.js +11 -14
  64. package/lib/materials/sxp/template/components/Img.d.ts +1 -0
  65. package/lib/materials/sxp/template/components/Img.js +3 -3
  66. package/lib/materials/sxp/template/components/Scroll.d.ts +1 -0
  67. package/lib/materials/sxp/template/components/Scroll.js +5 -4
  68. 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-19 18:39:54
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
  */
@@ -8654,19 +8658,25 @@
8654
8658
  onClose === null || onClose === void 0 ? void 0 : onClose();
8655
8659
  }, 300);
8656
8660
  const handleTouchStart = (event) => {
8657
- event.stopPropagation();
8658
- touchRef.current = event.touches[0].clientY;
8659
- fTouchRef.current = event.touches[0].clientY;
8661
+ // event.stopPropagation();
8662
+ touchRef.current = event.touches[0];
8663
+ fTouchRef.current = event.touches[0];
8660
8664
  touchMoveRef.current = true;
8661
8665
  };
8662
8666
  const handleTouchMove = (event) => {
8663
- event.stopPropagation();
8667
+ // event.stopPropagation();
8664
8668
  requestAnimationFrame(() => {
8665
8669
  var _a;
8666
8670
  if (touchMoveRef.current && ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.scrollTop) === 0) {
8667
8671
  const currentY = event.touches[0].clientY;
8668
- const diff = touchRef.current - currentY;
8669
- touchRef.current = currentY;
8672
+ const currentX = event.touches[0].clientX;
8673
+ const diff = touchRef.current.clientY - currentY;
8674
+ touchRef.current = event.touches[0];
8675
+ const diffY = currentY - fTouchRef.current.clientY;
8676
+ const diffX = currentX - fTouchRef.current.clientX;
8677
+ if (Math.abs(diffX) > Math.abs(diffY)) {
8678
+ return;
8679
+ }
8670
8680
  const ts = modalTrans - diff;
8671
8681
  if (ts > 0) {
8672
8682
  setModalTrans(ts);
@@ -8676,9 +8686,14 @@
8676
8686
  };
8677
8687
  const handleTouchEnd = (event) => {
8678
8688
  var _a;
8679
- event.stopPropagation();
8689
+ // event.stopPropagation();
8680
8690
  if (touchMoveRef.current && ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.scrollTop) === 0) {
8681
- const diff = fTouchRef.current - touchRef.current;
8691
+ const diffY = event.changedTouches[0].clientY - fTouchRef.current.clientY;
8692
+ const diffX = event.changedTouches[0].clientX - fTouchRef.current.clientX;
8693
+ if (Math.abs(diffX) > Math.abs(diffY)) {
8694
+ return;
8695
+ }
8696
+ const diff = fTouchRef.current.clientY - touchRef.current.clientY;
8682
8697
  if (diff > 0) {
8683
8698
  setModalTrans(0);
8684
8699
  }
@@ -8831,56 +8846,71 @@
8831
8846
  });
8832
8847
  var FormatImage$1 = React.memo(FormatImage);
8833
8848
 
8834
- 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 }) => {
8835
8858
  const ref = React.useRef();
8836
8859
  const { popupDetailData } = useSxpDataSource();
8837
8860
  React.useEffect(() => {
8838
- var _a;
8839
- (_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);
8840
- }, [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]);
8841
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));
8842
8866
  };
8843
8867
  var Scroll$1 = React.memo(Scroll);
8844
8868
 
8845
- const CommodityGroup = ({ products, data, defImg, style }) => {
8846
- var _a, _b;
8847
- const { setPopupDetailData, popupDetailData } = useSxpDataSource();
8848
- const [check, setCheck] = React.useState((_a = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _a !== void 0 ? _a : 0);
8849
- const handleClick = React.useCallback((index) => {
8850
- 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 })));
8851
- }, []);
8852
- 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) => {
8853
8872
  var _a, _b, _c;
8854
- 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({
8855
8874
  width: '50px',
8856
8875
  height: '50px',
8857
8876
  marginRight: '10px'
8858
- }), onClick: () => handleClick(index), key: index },
8877
+ }), onClick: () => {
8878
+ onCLick === null || onCLick === void 0 ? void 0 : onCLick(index);
8879
+ }, key: index },
8859
8880
  React.createElement(FormatImage$1, { style: {
8860
8881
  height: '100%',
8861
8882
  width: '100%',
8862
8883
  objectFit: 'cover',
8863
8884
  display: 'block',
8864
- objectPosition: `50% ${(data === null || data === void 0 ? void 0 : data.translateY) ? -(data === null || data === void 0 ? void 0 : data.translateY) + 50 : 50}%`,
8865
- border: check === index ? '1px solid #000' : '1px solid #f2f2f2'
8866
- }, 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));
8867
8889
  })))));
8868
8890
  };
8869
8891
  var CommodityGroup$1 = React.memo(CommodityGroup);
8870
8892
 
8871
8893
  const CommodityDetail$1 = (_a) => {
8872
- 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;
8873
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"]);
8874
- const { sxpParameter } = useSxpDataSource();
8875
- const { popupDetailData, bffEventReport, isPreview, bffFbReport } = useSxpDataSource();
8896
+ const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef } = useSxpDataSource();
8897
+ useEditor();
8876
8898
  const { jumpToWeb, productView } = useEventReport();
8877
8899
  const curTimeRef = React.useRef(null);
8878
8900
  const [showModal, setShowModal] = React.useState(false);
8879
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);
8880
8903
  const data = isPost ? rec : popupDetailData;
8881
- 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;
8882
- 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;
8883
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
+ }
8884
8914
  const handleLink = () => {
8885
8915
  if (product === null || product === void 0 ? void 0 : product.link) {
8886
8916
  jumpToWeb(data, product, cta, position);
@@ -8918,7 +8948,7 @@
8918
8948
  return '$7,000';
8919
8949
  }
8920
8950
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
8921
- 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;
8922
8952
  const renderContent = ({ isPost }) => {
8923
8953
  var _a, _b, _c;
8924
8954
  return (React.createElement("div", null,
@@ -8951,15 +8981,19 @@
8951
8981
  }
8952
8982
  return style;
8953
8983
  }, []);
8984
+ const handleClick = React.useCallback((index) => {
8985
+ popupCurTimeRef.current = new Date();
8986
+ setCheckCommodityIndex(index);
8987
+ }, []);
8954
8988
  const renderCommodityGroup = React.useCallback(() => {
8955
8989
  var _a, _b, _c;
8956
8990
  if (isPost)
8957
8991
  return;
8958
- 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' } }));
8959
- }, []);
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]);
8960
8994
  return (React.createElement(React.Fragment, null,
8961
8995
  React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
8962
- 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' } },
8963
8997
  React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
8964
8998
  clickable: true,
8965
8999
  bulletActiveClass: 'swipe-item-active-bullet',
@@ -8969,7 +9003,7 @@
8969
9003
  }, loop: true, autoplay: {
8970
9004
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
8971
9005
  } },
8972
- 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) => {
8973
9007
  return (React.createElement(SwiperSlide, { key: src },
8974
9008
  React.createElement("div", { style: {
8975
9009
  overflow: 'hidden',
@@ -8984,7 +9018,7 @@
8984
9018
  objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
8985
9019
  }, src: src }))));
8986
9020
  }))))),
8987
- !((_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({
8988
9022
  position: 'relative',
8989
9023
  height: 0,
8990
9024
  width: '100%',
@@ -8997,7 +9031,7 @@
8997
9031
  top: 0,
8998
9032
  objectFit: 'cover',
8999
9033
  width: '100%'
9000
- }), 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' }))),
9001
9035
  renderCommodityGroup(),
9002
9036
  React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
9003
9037
  renderBtn(),
@@ -9566,21 +9600,28 @@
9566
9600
  ];
9567
9601
 
9568
9602
  const CommodityDetailDiroNew$1 = (_a) => {
9569
- 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;
9570
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"]);
9571
9605
  React.useState(true);
9572
- const { sxpParameter } = useSxpDataSource();
9573
- const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
9606
+ const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport } = useSxpDataSource();
9574
9607
  const { jumpToWeb, productView } = useEventReport();
9575
9608
  React.useState(false);
9576
9609
  React.useState(false);
9577
9610
  React.useState(true);
9578
9611
  const [showModal, setShowModal] = React.useState(false);
9579
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);
9580
9614
  const data = isPost ? rec : popupDetailData;
9581
- 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;
9582
- 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;
9583
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
+ }
9584
9625
  const handleLink = () => {
9585
9626
  if (product === null || product === void 0 ? void 0 : product.link) {
9586
9627
  jumpToWeb(data, product, cta, position);
@@ -9618,7 +9659,7 @@
9618
9659
  return '£102,300.00';
9619
9660
  }
9620
9661
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
9621
- 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;
9622
9663
  // useEffect(() => {
9623
9664
  // console.log(scrollRef?.current?.scrollHeight, window.innerHeight);
9624
9665
  // if (scrollRef?.current && scrollRef?.current?.scrollHeight > window.innerHeight) {
@@ -9681,15 +9722,19 @@ Made in Italy` })));
9681
9722
  }
9682
9723
  return style;
9683
9724
  }, []);
9725
+ const handleClick = React.useCallback((index) => {
9726
+ popupCurTimeRef.current = new Date();
9727
+ setCheckCommodityIndex(index);
9728
+ }, []);
9684
9729
  const renderCommodityGroup = React.useCallback(() => {
9685
9730
  var _a, _b, _c;
9686
9731
  if (isPost)
9687
9732
  return;
9688
- 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' } }));
9689
- }, []);
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]);
9690
9735
  return (React.createElement("div", { className: 'pb-commondityDiroNew' },
9691
- React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
9692
- 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: {
9693
9738
  clickable: true,
9694
9739
  bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
9695
9740
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -9697,7 +9742,7 @@ Made in Italy` })));
9697
9742
  : 'commondityDiroNew-swiper-clickable-center'
9698
9743
  }, loop: true, autoplay: {
9699
9744
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
9700
- } }, (_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) => {
9701
9746
  return (React.createElement(SwiperSlide, { key: src },
9702
9747
  React.createElement("div", { style: {
9703
9748
  overflow: 'hidden',
@@ -9712,7 +9757,7 @@ Made in Italy` })));
9712
9757
  objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
9713
9758
  }, src: src }))));
9714
9759
  }))),
9715
- !((_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({
9716
9761
  position: 'relative',
9717
9762
  height: 0,
9718
9763
  width: '100%',
@@ -9725,13 +9770,13 @@ Made in Italy` })));
9725
9770
  top: 0,
9726
9771
  objectFit: 'cover',
9727
9772
  width: '100%'
9728
- }), 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' }))),
9729
9774
  renderCommodityGroup(),
9730
9775
  React.createElement("div", { className: 'pb-commondityDiroNew-content' },
9731
9776
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
9732
9777
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
9733
9778
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), dangerouslySetInnerHTML: {
9734
- __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)
9735
9780
  } }),
9736
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: {
9737
9782
  __html: setFontForText((product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage CalfskinLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
@@ -9741,11 +9786,11 @@ Made in Italy` })));
9741
9786
  __html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
9742
9787
  } }),
9743
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: {
9744
- __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)
9745
9790
  } }))),
9746
- (!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 },
9747
9792
  React.createElement("span", { dangerouslySetInnerHTML: {
9748
- __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)
9749
9794
  } }))),
9750
9795
  productInfoText({ isPost }))),
9751
9796
  React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
@@ -9991,6 +10036,11 @@ Made in Italy` })));
9991
10036
  type: 'Group',
9992
10037
  label: '尺寸',
9993
10038
  child: [
10039
+ {
10040
+ type: 'Number',
10041
+ name: ['props', 'buttonStyle', 'width'],
10042
+ addonAfter: 'W'
10043
+ },
9994
10044
  {
9995
10045
  type: 'Number',
9996
10046
  name: ['props', 'buttonStyle', 'height'],
@@ -10099,18 +10149,18 @@ Made in Italy` })));
10099
10149
  * @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
10100
10150
  *
10101
10151
  */
10102
- const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
10152
+ const Img = ({ src, rec, item, index, style, translateY, imgStyle, enableEventReport = true }) => {
10103
10153
  const ref = React.useRef(null);
10104
10154
  const isOnScreen = useOnScreen(ref);
10105
10155
  const { ctaEvent } = useSxpDataSource();
10106
10156
  React.useEffect(() => {
10107
- 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) {
10108
10158
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
10109
10159
  eventSubject: 'ctaExposure',
10110
10160
  eventDescription: 'The cta was shown to the user'
10111
10161
  }, rec, item, index);
10112
10162
  }
10113
- }, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
10163
+ }, [isOnScreen, src, ref, rec, ctaEvent, item, index, enableEventReport]);
10114
10164
  React.useMemo(() => {
10115
10165
  return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? src : `${src}?imrquality/rquality/20`;
10116
10166
  }, [src]);
@@ -10120,41 +10170,12 @@ Made in Italy` })));
10120
10170
  };
10121
10171
  var Img$1 = React.memo(Img);
10122
10172
 
10123
- const EventProvider = (_a) => {
10124
- var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
10125
- const ref = React.useRef(null);
10126
- const { popup } = useEditor();
10127
- const { setPopupDetailData, ctaEvent } = useSxpDataSource();
10128
- const { jumpToWeb } = useEventReport();
10129
- const handleClick = lodash.throttle(() => {
10130
- var _a, _b, _c, _d, _e, _f, _g, _h;
10131
- 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;
10132
- ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
10133
- eventSubject: 'clickCta',
10134
- eventDescription: 'User clicked the CTA'
10135
- }, rec, item, index);
10136
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
10137
- if (isExternalLink) {
10138
- 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) {
10139
- const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
10140
- const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
10141
- jumpToWeb(rec, product, cta, index);
10142
- 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);
10143
- }
10144
- }
10145
- else {
10146
- onClick === null || onClick === void 0 ? void 0 : onClick();
10147
- }
10148
- }, popup === null || popup === void 0 ? void 0 : popup.duration);
10149
- return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
10150
- };
10151
- var EventProvider$1 = React.memo(EventProvider);
10152
-
10153
10173
  const CommodityList$1 = (_a) => {
10154
10174
  var _b, _c;
10155
- 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"]);
10156
- const { sxpParameter } = useSxpDataSource();
10157
- 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();
10158
10179
  const recData = isPost ? rec : popupDetailData;
10159
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];
10160
10181
  const priceText = React.useCallback((product) => {
@@ -10168,12 +10189,28 @@ Made in Italy` })));
10168
10189
  return '$7,000';
10169
10190
  }
10170
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);
10171
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) => {
10172
10209
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
10173
- 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({
10174
10211
  display: 'flex'
10175
- }) }),
10176
- 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 }),
10177
10214
  React.createElement("div", { style: {
10178
10215
  flex: 1,
10179
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)`,
@@ -10198,9 +10235,9 @@ Made in Italy` })));
10198
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: {
10199
10236
  __html: setFontForText(priceText(item), commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
10200
10237
  } }),
10201
- 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: {
10202
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)
10203
- } })))));
10240
+ } })))))));
10204
10241
  })));
10205
10242
  };
10206
10243
  var CommodityListComponent = React.memo(CommodityList$1);
@@ -10237,7 +10274,7 @@ Made in Italy` })));
10237
10274
  * @Author: binruan@chatlabs.com
10238
10275
  * @Date: 2024-03-20 10:27:31
10239
10276
  * @LastEditors: binruan@chatlabs.com
10240
- * @LastEditTime: 2024-07-09 16:04:28
10277
+ * @LastEditTime: 2024-07-26 17:33:03
10241
10278
  * @FilePath: \pb-sxp-ui\src\materials\sxp\popup\CommodityList\material.tsx
10242
10279
  *
10243
10280
  */
@@ -10276,6 +10313,7 @@ Made in Italy` })));
10276
10313
  backgroundColor: '#000',
10277
10314
  fontSize: 12,
10278
10315
  height: 30,
10316
+ width: 100,
10279
10317
  textAlign: 'center',
10280
10318
  color: '#fff',
10281
10319
  lineHeight: 2.5
@@ -10559,6 +10597,36 @@ Made in Italy` })));
10559
10597
  }
10560
10598
  ];
10561
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
+
10562
10630
  var styles$8 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
10563
10631
 
10564
10632
  const Commodity$1 = (_a) => {
@@ -11129,12 +11197,12 @@ Made in Italy` })));
11129
11197
  const { popup } = useEditor();
11130
11198
  const { jumpToWeb } = useEventReport();
11131
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]);
11132
- const handleClick = lodash.throttle((item) => {
11200
+ const handleClick = lodash.throttle((item, multiCheckIndex) => {
11133
11201
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
11134
11202
  eventSubject: 'clickCta',
11135
11203
  eventDescription: 'User clicked the CTA'
11136
11204
  }, recData, item, index);
11137
- 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 }));
11138
11206
  if (isExternalLink) {
11139
11207
  if (item === null || item === void 0 ? void 0 : item.link) {
11140
11208
  jumpToWeb(recData, item, item.bindCta, index);
@@ -11147,7 +11215,7 @@ Made in Italy` })));
11147
11215
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
11148
11216
  return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
11149
11217
  var _a, _b, _c, _d, _e, _f, _g, _h;
11150
- 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) }),
11151
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 }),
11152
11220
  React.createElement("div", { className: css.css({
11153
11221
  color: '#000',
@@ -11245,12 +11313,12 @@ Made in Italy` })));
11245
11313
  const { popup } = useEditor();
11246
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]);
11247
11315
  const { jumpToWeb } = useEventReport();
11248
- const handleClick = lodash.throttle((item) => {
11316
+ const handleClick = lodash.throttle((item, multiCheckIndex) => {
11249
11317
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
11250
11318
  eventSubject: 'clickCta',
11251
11319
  eventDescription: 'User clicked the CTA'
11252
11320
  }, recData, item, index);
11253
- 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 }));
11254
11322
  if (isExternalLink) {
11255
11323
  if (item === null || item === void 0 ? void 0 : item.link) {
11256
11324
  jumpToWeb(recData, item, item.bindCta, index);
@@ -11263,7 +11331,7 @@ Made in Italy` })));
11263
11331
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
11264
11332
  return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
11265
11333
  var _a, _b, _c, _d, _e, _f, _g, _h;
11266
- 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) }),
11267
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 }),
11268
11336
  React.createElement("div", { className: css.css({
11269
11337
  color: '#fff',
@@ -13979,17 +14047,21 @@ Made in Italy` })));
13979
14047
  }
13980
14048
  }, [event === null || event === void 0 ? void 0 : event.animation]);
13981
14049
  React.useEffect(() => {
14050
+ var _a, _b, _c;
13982
14051
  if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
13983
14052
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
13984
14053
  eventSubject: 'ctaExposure',
13985
14054
  eventDescription: 'The cta was shown to the user'
13986
- }, 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);
13987
14056
  }
13988
14057
  }, [isOnScreen]);
13989
14058
  React.useEffect(() => {
13990
14059
  if (isOnScreen) {
13991
14060
  setVisible(true);
13992
14061
  }
14062
+ else {
14063
+ setVisible(false);
14064
+ }
13993
14065
  }, [isOnScreen]);
13994
14066
  const aniNamStyle = React.useMemo(() => {
13995
14067
  if (!visible)
@@ -14107,7 +14179,7 @@ Made in Italy` })));
14107
14179
  * @Author: binruan@chatlabs.com
14108
14180
  * @Date: 2024-03-26 16:50:25
14109
14181
  * @LastEditors: binruan@chatlabs.com
14110
- * @LastEditTime: 2024-07-08 11:01:24
14182
+ * @LastEditTime: 2024-07-25 15:02:45
14111
14183
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLinkPopup\settingRender.tsx
14112
14184
  *
14113
14185
  */
@@ -14309,7 +14381,7 @@ Made in Italy` })));
14309
14381
  },
14310
14382
  {
14311
14383
  type: 'TextSpace',
14312
- name: ['props', 'ctaTempStyles', 'title']
14384
+ name: ['props', 'ctaTempStyles', 'ctaTitle']
14313
14385
  },
14314
14386
  {
14315
14387
  type: 'Color',
@@ -14366,14 +14438,11 @@ Made in Italy` })));
14366
14438
  const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
14367
14439
  const AniLinkPopup$1 = (_a) => {
14368
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;
14369
- 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"]);
14370
14442
  style === null || style === void 0 ? true : delete style.transform;
14371
14443
  const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
14372
14444
  const { jumpToWeb } = useEventReport();
14373
- const ref = React.useRef(null);
14374
- const isOnScreen = useOnScreen(ref);
14375
- const [visible, setVisible] = React.useState(false);
14376
- const [startAni, setStartAni] = React.useState(true);
14445
+ const [visible, setVisible] = React.useState(true);
14377
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);
14378
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);
14379
14448
  const handleTo = () => {
@@ -14409,29 +14478,27 @@ Made in Italy` })));
14409
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;
14410
14479
  const onClose = (event) => {
14411
14480
  event.stopPropagation();
14412
- setStartAni(false);
14481
+ setVisible(false);
14413
14482
  };
14414
14483
  React.useEffect(() => {
14415
- if (isOnScreen) {
14416
- setVisible(true);
14417
- }
14418
- }, [isOnScreen]);
14484
+ setVisible(true);
14485
+ }, [isActive]);
14419
14486
  const aniNamStyle = React.useMemo(() => {
14420
- if (!visible)
14487
+ if (!isActive)
14421
14488
  return null;
14422
- return startAni ? styles['animated-fadeIn'] : null;
14423
- }, [visible, startAni]);
14489
+ return visible ? styles['animated-fadeIn'] : null;
14490
+ }, [isActive, visible]);
14424
14491
  return (React.createElement(React.Fragment, null, isTel ? (React.createElement("div", { style: {
14425
14492
  height: '40px',
14426
14493
  lineHeight: '40px',
14427
14494
  paddingLeft: '6px'
14428
- } }, "Cta Title")) : (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 }),
14429
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 } },
14430
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'] })),
14431
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 }),
14432
- React.createElement("div", { hidden: !!recData && !(product === null || product === void 0 ? void 0 : product.title), className: styles['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
14499
+ (!recData || (product === null || product === void 0 ? void 0 : product.title)) && (React.createElement("div", { className: styles['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
14433
14500
  __html: setFontForText((_z = product === null || product === void 0 ? void 0 : product.title) !== null && _z !== void 0 ? _z : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
14434
- } }),
14501
+ } })),
14435
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: {
14436
14503
  __html: setFontForText(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
14437
14504
  } })))));
@@ -14586,52 +14653,71 @@ Made in Italy` })));
14586
14653
  const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
14587
14654
  const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
14588
14655
  const LikeButton = (_a) => {
14656
+ var _b;
14589
14657
  var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
14590
- const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
14591
- 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);
14592
14660
  const likeIcon = useIconLink(defaultLikeIconPath$1);
14593
14661
  const unlikeIcon = useIconLink(defaultUnLikeIconPath$1);
14594
14662
  const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
14595
- 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;
14596
14664
  if (state) {
14597
14665
  // 先设置状态
14598
14666
  setState(false);
14599
- 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;
14600
14668
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
14601
14669
  eventInfo: {
14602
14670
  eventSubject: 'favoriteContentCanceled',
14603
14671
  eventDescription: 'This content was unfavorite by the user',
14604
- 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 : '',
14605
- 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 : '',
14606
- 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 : []),
14607
14675
  position: position + '',
14608
- contentFormat: ((_l = recData === null || recData === void 0 ? void 0 : recData.video) === null || _l === void 0 ? void 0 : _l.url) ? 'video' : 'image',
14609
- 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
14610
14678
  }
14611
14679
  });
14612
14680
  // 如果接口调用失败,则回滚状态
14613
14681
  if (!result) {
14614
14682
  setState(true);
14615
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
+ }
14616
14693
  }
14617
14694
  else {
14618
14695
  setState(true);
14619
- 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;
14620
14697
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
14621
14698
  eventInfo: {
14622
14699
  eventSubject: 'favoriteContent',
14623
14700
  eventDescription: 'This content was favorite by the user',
14624
- 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 : '',
14625
- 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 : '',
14626
- 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 : []),
14627
14704
  position: position + '',
14628
- contentFormat: ((_v = recData === null || recData === void 0 ? void 0 : recData.video) === null || _v === void 0 ? void 0 : _v.url) ? 'video' : 'image',
14629
- 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
14630
14707
  }
14631
14708
  });
14632
14709
  if (!result) {
14633
14710
  setState(false);
14634
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
+ }
14635
14721
  }
14636
14722
  }), 200);
14637
14723
  return (React.createElement("button", Object.assign({}, props, { "aria-label": 'like', onClick: handleClick }),
@@ -15160,7 +15246,7 @@ Made in Italy` })));
15160
15246
  * @Author: binruan@chatlabs.com
15161
15247
  * @Date: 2024-01-15 19:03:09
15162
15248
  * @LastEditors: binruan@chatlabs.com
15163
- * @LastEditTime: 2024-07-09 18:47:05
15249
+ * @LastEditTime: 2024-07-25 18:14:29
15164
15250
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Hashtag\index.tsx
15165
15251
  *
15166
15252
  */
@@ -15197,7 +15283,6 @@ Made in Italy` })));
15197
15283
  }
15198
15284
  return (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer', color: '#fff' }, onClick: () => setIsShowMore(!isShowMore) }, isShowMore ? 'show less' : 'show more'));
15199
15285
  }, [isShowMore, tags]);
15200
- console.log(hashTagStyle, '111');
15201
15286
  return (React.createElement("div", { className: 'clc-sxp-bottom-hashtag', style: { marginTop: `${(_a = hashTagStyle === null || hashTagStyle === void 0 ? void 0 : hashTagStyle.marginTop) !== null && _a !== void 0 ? _a : 16}px` } },
15202
15287
  React.createElement(Scroll$1, null, tags === null || tags === void 0 ? void 0 : tags.map((item, index) => (React.createElement(SwiperSlide, { key: index, hidden: !isShowMore ? index >= 6 : false, className: 'clc-sxp-bottom-hashtag-item', style: hashTagStyle, onClick: () => handleClickTag(item) },
15203
15288
  React.createElement("div", { dangerouslySetInnerHTML: { __html: setFontForText(`#${item}`, hashTagStyle) } })))))));
@@ -15268,27 +15353,35 @@ Made in Italy` })));
15268
15353
  * @Author: binruan@chatlabs.com
15269
15354
  * @Date: 2023-12-26 16:11:34
15270
15355
  * @LastEditors: binruan@chatlabs.com
15271
- * @LastEditTime: 2024-07-17 18:54:33
15356
+ * @LastEditTime: 2024-07-29 10:07:08
15272
15357
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
15273
15358
  *
15274
15359
  */
15275
- const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
15360
+ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }) => {
15361
+ var _a, _b, _c, _d, _e;
15276
15362
  const { schema } = useEditor();
15363
+ if (!(rec === null || rec === void 0 ? void 0 : rec.video))
15364
+ return null;
15365
+ let cta = null;
15366
+ if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
15367
+ cta = '多商品CTA';
15368
+ }
15369
+ else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
15370
+ cta = '商品CTA';
15371
+ }
15372
+ else {
15373
+ cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
15374
+ }
15375
+ const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
15277
15376
  const renderComp = React.useMemo(() => {
15278
15377
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
15279
15378
  if (!(rec === null || rec === void 0 ? void 0 : rec.video))
15280
15379
  return null;
15281
- let cta = null;
15282
- if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
15283
- cta = '多商品CTA';
15284
- }
15285
- else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
15286
- cta = '商品CTA';
15287
- }
15380
+ if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) ;
15381
+ else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) ;
15288
15382
  else {
15289
- cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
15383
+ (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
15290
15384
  }
15291
- const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
15292
15385
  //如果includesCtaType有值,则只渲染includesCtaType包含的cta类型组件,用于在页面某处只显示某一组件
15293
15386
  if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.type)))
15294
15387
  return;
@@ -15309,12 +15402,12 @@ Made in Italy` })));
15309
15402
  const Component = withBindDataSource(t);
15310
15403
  const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
15311
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';
15312
- 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 })));
15313
15406
  }
15314
15407
  else {
15315
15408
  return null;
15316
15409
  }
15317
- }, [rec, resolver, tempMap, schema]);
15410
+ }, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id, isActive]);
15318
15411
  return React.createElement(React.Fragment, null, renderComp);
15319
15412
  };
15320
15413
  var RenderCard$1 = React.memo(RenderCard);
@@ -15402,7 +15495,7 @@ Made in Italy` })));
15402
15495
  * @Author: binruan@chatlabs.com
15403
15496
  * @Date: 2024-01-15 19:03:09
15404
15497
  * @LastEditors: binruan@chatlabs.com
15405
- * @LastEditTime: 2024-07-24 14:59:23
15498
+ * @LastEditTime: 2024-07-29 10:02:52
15406
15499
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
15407
15500
  *
15408
15501
  */
@@ -15620,7 +15713,7 @@ Made in Italy` })));
15620
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 }),
15621
15714
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'] }),
15622
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 }))),
15623
- 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 })));
15624
15717
  }
15625
15718
  return null;
15626
15719
  }, [
@@ -15675,11 +15768,11 @@ Made in Italy` })));
15675
15768
  };
15676
15769
  const handleSlideSkip = (item, position) => {
15677
15770
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
15678
- if (isPreview)
15771
+ if (isPreview || waterFallData)
15679
15772
  return;
15680
15773
  const t = new Date() - curTime.current;
15681
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) {
15682
- const link = ((_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.bindProduct) === null || _c === void 0 ? void 0 : _c.link) || ((_f = (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.bindProducts) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.link) || ((_g = item === null || item === void 0 ? void 0 : item.product) === null || _g === void 0 ? void 0 : _g.link);
15775
+ const link = ((_d = (_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.link) || ((_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.link) || ((_g = item === null || item === void 0 ? void 0 : item.product) === null || _g === void 0 ? void 0 : _g.link);
15683
15776
  const product = (item === null || item === void 0 ? void 0 : item.product) || ((_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct) || ((_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]);
15684
15777
  if (link) {
15685
15778
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
@@ -16224,19 +16317,18 @@ Made in Italy` })));
16224
16317
  * @Author: binruan@chatlabs.com
16225
16318
  * @Date: 2023-10-31 10:56:01
16226
16319
  * @LastEditors: binruan@chatlabs.com
16227
- * @LastEditTime: 2024-07-19 18:06:14
16320
+ * @LastEditTime: 2024-07-29 18:06:11
16228
16321
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
16229
16322
  *
16230
16323
  */
16231
16324
  const Popup = () => {
16232
16325
  const { schema, resolver, popup } = useEditor();
16233
- const { setPopupDetailData, popupDetailData, bffEventReport } = useSxpDataSource();
16326
+ const { setPopupDetailData, popupDetailData, popupCurTimeRef, checkCommodityIndexRef } = useSxpDataSource();
16234
16327
  const { productView } = useEventReport();
16235
16328
  const [visible, setVisible] = React.useState();
16236
- const curTimeRef = React.useRef(null);
16237
16329
  React.useEffect(() => {
16238
16330
  const initTime = () => {
16239
- curTimeRef.current = new Date();
16331
+ popupCurTimeRef.current = new Date();
16240
16332
  };
16241
16333
  initTime();
16242
16334
  window.addEventListener('pageshow', initTime);
@@ -16246,25 +16338,37 @@ Made in Italy` })));
16246
16338
  }, []);
16247
16339
  React.useEffect(() => {
16248
16340
  if (popup && (popup === null || popup === void 0 ? void 0 : popup.id) && (popup === null || popup === void 0 ? void 0 : popup.id) !== '') {
16249
- curTimeRef.current = new Date();
16341
+ popupCurTimeRef.current = new Date();
16250
16342
  setVisible(popup);
16251
16343
  }
16252
16344
  }, [popup]);
16253
16345
  const handleClose = () => {
16254
- var _a, _b, _c, _d;
16255
- 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)) {
16256
16351
  return;
16257
16352
  }
16258
16353
  setVisible(Object.assign(Object.assign({}, popup), { id: '' }));
16259
- const data = popupDetailData;
16260
- const product = (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
16261
- 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;
16262
- if (product && cta) {
16263
- 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
+ }
16264
16367
  }
16265
16368
  setTimeout(() => {
16266
16369
  window === null || window === void 0 ? void 0 : window.sxpPopup('');
16267
16370
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(null);
16371
+ checkCommodityIndexRef.current = -1;
16268
16372
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
16269
16373
  };
16270
16374
  const renderPopupDetail = React.useMemo(() => {
@@ -16277,7 +16381,7 @@ Made in Italy` })));
16277
16381
  const isExternalLink = ((_d = (_c = (_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.event) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.linkType) === 'externalLink';
16278
16382
  const isPopup = ((_g = (_f = (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.event) === null || _f === void 0 ? void 0 : _f.onClick) === null || _g === void 0 ? void 0 : _g.linkType) === 'popup';
16279
16383
  const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
16280
- return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: (_k = window.innerWidth) !== null && _k !== void 0 ? _k : '100vw' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.textStyle), bindDatas: (_o = (_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.bindDatas) !== null && _o !== void 0 ? _o : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.props, { event: ((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose })));
16384
+ return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: (_k = window.innerWidth) !== null && _k !== void 0 ? _k : '100vw', height: '100%' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.textStyle), bindDatas: (_o = (_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.bindDatas) !== null && _o !== void 0 ? _o : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.props, { event: ((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose })));
16281
16385
  }
16282
16386
  else {
16283
16387
  return React.createElement(React.Fragment, null);