pb-sxp-ui 1.2.6 → 1.2.7

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 (32) hide show
  1. package/dist/index.cjs +53 -37
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +1 -3
  4. package/dist/index.js +53 -37
  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 +53 -37
  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/FormatImage.js +7 -3
  15. package/es/core/components/SxpPageRender/Popup/index.js +5 -5
  16. package/es/core/components/SxpPageRender/index.js +5 -5
  17. package/es/core/context/SxpDataSourceProvider.js +25 -15
  18. package/es/core/hooks/useEventReport.js +4 -4
  19. package/es/materials/sxp/popup/CommodityList/index.d.ts +0 -1
  20. package/es/materials/sxp/popup/CommodityList/index.js +2 -1
  21. package/es/materials/sxp/template/components/CommodityGroup.d.ts +1 -1
  22. package/es/materials/sxp/template/components/CommodityGroup.js +2 -1
  23. package/lib/core/components/SxpPageRender/FormatImage.js +7 -3
  24. package/lib/core/components/SxpPageRender/Popup/index.js +5 -5
  25. package/lib/core/components/SxpPageRender/index.js +5 -5
  26. package/lib/core/context/SxpDataSourceProvider.js +25 -15
  27. package/lib/core/hooks/useEventReport.js +4 -4
  28. package/lib/materials/sxp/popup/CommodityList/index.d.ts +0 -1
  29. package/lib/materials/sxp/popup/CommodityList/index.js +2 -1
  30. package/lib/materials/sxp/template/components/CommodityGroup.d.ts +1 -1
  31. package/lib/materials/sxp/template/components/CommodityGroup.js +2 -1
  32. package/package.json +1 -1
package/dist/pb-ui.js CHANGED
@@ -573,6 +573,19 @@
573
573
  var _a, _b, _c, _d;
574
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;
575
575
  }, [isAgreePolicy, globalConfig, isOpenConsent, isEditor]);
576
+ const getFilterRecList = React.useCallback((data) => {
577
+ var _a;
578
+ const recList = data === null || data === void 0 ? void 0 : data.recList;
579
+ const nList = (_a = recList === null || recList === void 0 ? void 0 : recList.map((item) => {
580
+ var _a, _b, _c, _d, _e, _f;
581
+ if (((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) && ((_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.length) > 0) {
582
+ const bindProducts = (_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.filter((item) => !!(item === null || item === void 0 ? void 0 : item.bindCta))) !== null && _f !== void 0 ? _f : [];
583
+ return Object.assign(Object.assign({}, item), { video: Object.assign(Object.assign({}, item === null || item === void 0 ? void 0 : item.video), { bindProducts }) });
584
+ }
585
+ return item;
586
+ })) !== null && _a !== void 0 ? _a : [];
587
+ return nList;
588
+ }, []);
576
589
  React.useEffect(() => {
577
590
  const handleChangeThemeTag = (tag) => {
578
591
  themeTag.current = tag;
@@ -644,7 +657,6 @@
644
657
  return result === null || result === void 0 ? void 0 : result.data;
645
658
  }), [bffFetch, utmVal, maxSize, defaultSize]);
646
659
  const loadVideos = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
647
- var _j, _k;
648
660
  if (rtcList.length <= 0) {
649
661
  return;
650
662
  }
@@ -654,8 +666,8 @@
654
666
  'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
655
667
  themeTag: themeTag.current
656
668
  });
657
- setRtcList(rtcList.concat((_j = data === null || data === void 0 ? void 0 : data.recList) !== null && _j !== void 0 ? _j : []));
658
- setCacheRtcList(cacheRtcList.concat((_k = data === null || data === void 0 ? void 0 : data.recList) !== null && _k !== void 0 ? _k : []));
669
+ setRtcList(getFilterRecList(data));
670
+ setCacheRtcList(getFilterRecList(data));
659
671
  }), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
660
672
  const bffEventReport = React.useCallback(({ userInfo, eventInfo }) => {
661
673
  // 关闭 BFF 事件上报
@@ -719,24 +731,24 @@
719
731
  }), [bffFetch]);
720
732
  // 获取 Tag
721
733
  const bffGetTagList = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
722
- var _l, _m, _o, _p, _q;
734
+ var _j, _k, _l, _m, _o;
723
735
  if (!utmVal || !isShowTag)
724
736
  return;
725
737
  try {
726
- const val = (_o = (_m = (_l = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _l === void 0 ? void 0 : _l.filter((val) => {
738
+ const val = (_l = (_k = (_j = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _j === void 0 ? void 0 : _j.filter((val) => {
727
739
  var _a, _b;
728
740
  const key = val.split('=')[0];
729
741
  return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
730
- })) === null || _m === void 0 ? void 0 : _m.join('&')) !== null && _o !== void 0 ? _o : '';
742
+ })) === null || _k === void 0 ? void 0 : _k.join('&')) !== null && _l !== void 0 ? _l : '';
731
743
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
732
- setTagList((_q = (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []);
744
+ setTagList((_o = (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.tags) !== null && _o !== void 0 ? _o : []);
733
745
  }
734
746
  catch (e) {
735
747
  console.log('e', e);
736
748
  }
737
749
  }), [bffFetch, utmVal, isShowTag]);
738
750
  const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
739
- 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;
751
+ 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;
740
752
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
741
753
  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);
742
754
  let fromKName = '';
@@ -750,7 +762,7 @@
750
762
  fromKName = 'imagePage';
751
763
  }
752
764
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
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: (_1 = (_y = (_t = (_p = (_o = (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.bindCta) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : (_s = (_r = (_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.bindProduct) === null || _r === void 0 ? void 0 : _r.bindCta) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_x = (_w = (_v = (_u = rec === null || rec === void 0 ? void 0 : rec.video) === null || _u === void 0 ? void 0 : _u.bindProducts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.product) === null || _z === void 0 ? void 0 : _z.bindCta) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : '', fromKName, fromKPage: (_2 = location === null || location === void 0 ? void 0 : location.href) !== null && _2 !== void 0 ? _2 : '' })
765
+ 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: (_2 = (_z = (_u = (_q = (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : (_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.bindCta) === null || _p === void 0 ? void 0 : _p.traceInfo) !== null && _q !== void 0 ? _q : (_t = (_s = (_r = rec === null || rec === void 0 ? void 0 : rec.video) === null || _r === void 0 ? void 0 : _r.bindProduct) === null || _s === void 0 ? void 0 : _s.bindCta) === null || _t === void 0 ? void 0 : _t.traceInfo) !== null && _u !== void 0 ? _u : (_y = (_x = (_w = (_v = rec === null || rec === void 0 ? void 0 : rec.video) === null || _v === void 0 ? void 0 : _v.bindProducts) === null || _w === void 0 ? void 0 : _w[0]) === null || _x === void 0 ? void 0 : _x.bindCta) === null || _y === void 0 ? void 0 : _y.traceInfo) !== null && _z !== void 0 ? _z : (_1 = (_0 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : '', fromKName, fromKPage: (_3 = location === null || location === void 0 ? void 0 : location.href) !== null && _3 !== void 0 ? _3 : '' })
754
766
  });
755
767
  }, [bffEventReport, isFromHashtag]);
756
768
  const h5EnterLink = React.useCallback(() => {
@@ -790,9 +802,8 @@
790
802
  bffGetTagList();
791
803
  getRecommendVideos()
792
804
  .then((data) => {
793
- var _a, _b;
794
- setRtcList((_a = data === null || data === void 0 ? void 0 : data.recList) !== null && _a !== void 0 ? _a : []);
795
- setCacheRtcList((_b = data === null || data === void 0 ? void 0 : data.recList) !== null && _b !== void 0 ? _b : []);
805
+ setRtcList(getFilterRecList(data));
806
+ setCacheRtcList(getFilterRecList(data));
796
807
  })
797
808
  .finally(() => {
798
809
  bffEventReport({
@@ -812,9 +823,8 @@
812
823
  bffGetTagList();
813
824
  getRecommendVideos()
814
825
  .then((data) => {
815
- var _a, _b;
816
- setRtcList((_a = data === null || data === void 0 ? void 0 : data.recList) !== null && _a !== void 0 ? _a : []);
817
- setCacheRtcList((_b = data === null || data === void 0 ? void 0 : data.recList) !== null && _b !== void 0 ? _b : []);
826
+ setRtcList(getFilterRecList(data));
827
+ setCacheRtcList(getFilterRecList(data));
818
828
  })
819
829
  .finally(() => {
820
830
  setLoading(false);
@@ -1282,14 +1292,14 @@
1282
1292
  * @Author: binruan@chatlabs.com
1283
1293
  * @Date: 2024-03-12 10:59:06
1284
1294
  * @LastEditors: binruan@chatlabs.com
1285
- * @LastEditTime: 2024-07-31 11:41:47
1295
+ * @LastEditTime: 2024-08-01 17:36:34
1286
1296
  * @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
1287
1297
  *
1288
1298
  */
1289
1299
  function useEventReport() {
1290
1300
  const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = useSxpDataSource();
1291
1301
  const jumpToWeb = React.useCallback((data, product, cta, position) => {
1292
- 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;
1302
+ 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;
1293
1303
  let fromKName = '';
1294
1304
  if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
1295
1305
  fromKName = 'pdpPage';
@@ -1320,12 +1330,12 @@
1320
1330
  position: position + '',
1321
1331
  contentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
1322
1332
  ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
1323
- traceInfo: (_0 = (_x = (_v = (_r = (_q = (_p = data === null || data === void 0 ? void 0 : data.video) === null || _p === void 0 ? void 0 : _p.bindProduct) === null || _q === void 0 ? void 0 : _q.traceInfo) !== null && _r !== void 0 ? _r : (_u = (_t = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts) === null || _t === void 0 ? void 0 : _t[0]) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : (_w = data === null || data === void 0 ? void 0 : data.product) === null || _w === void 0 ? void 0 : _w.traceInfo) !== null && _x !== void 0 ? _x : (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.bindCta) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : ''
1333
+ traceInfo: (_1 = (_y = (_w = (_s = (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : (_r = (_q = data === null || data === void 0 ? void 0 : data.video) === null || _q === void 0 ? void 0 : _q.bindProduct) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : (_v = (_u = (_t = data === null || data === void 0 ? void 0 : data.video) === null || _t === void 0 ? void 0 : _t.bindProducts) === null || _u === void 0 ? void 0 : _u[0]) === null || _v === void 0 ? void 0 : _v.traceInfo) !== null && _w !== void 0 ? _w : (_x = data === null || data === void 0 ? void 0 : data.product) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_0 = (_z = data === null || data === void 0 ? void 0 : data.video) === null || _z === void 0 ? void 0 : _z.bindCta) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : ''
1324
1334
  }
1325
1335
  });
1326
1336
  }, [bffEventReport, popupDetailData, isFromHashtag]);
1327
1337
  const productView = React.useCallback((data, product, cta, viewTime, position) => {
1328
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
1338
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1329
1339
  let fromKName = '';
1330
1340
  if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
1331
1341
  fromKName = 'pdpPage';
@@ -1345,7 +1355,7 @@
1345
1355
  position: position + '',
1346
1356
  contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
1347
1357
  ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
1348
- traceInfo: (_o = (_l = (_g = (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.traceInfo) !== null && _g !== void 0 ? _g : (_k = (_j = (_h = data === null || data === void 0 ? void 0 : data.video) === null || _h === void 0 ? void 0 : _h.bindProducts) === null || _j === void 0 ? void 0 : _j[0]) === null || _k === void 0 ? void 0 : _k.traceInfo) !== null && _l !== void 0 ? _l : (_m = data === null || data === void 0 ? void 0 : data.product) === null || _m === void 0 ? void 0 : _m.traceInfo) !== null && _o !== void 0 ? _o : '',
1358
+ traceInfo: (_p = (_m = (_h = (_e = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _e !== void 0 ? _e : (_g = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct) === null || _g === void 0 ? void 0 : _g.traceInfo) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.traceInfo) !== null && _m !== void 0 ? _m : (_o = data === null || data === void 0 ? void 0 : data.product) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : '',
1349
1359
  timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
1350
1360
  eventSubject: 'productView',
1351
1361
  eventDescription: 'User browsed the product'
@@ -8806,6 +8816,7 @@
8806
8816
  const FormatImage = React.forwardRef((props, ref) => {
8807
8817
  const { src, onLoad, style, className, loading } = props;
8808
8818
  const [imgSrc, setImgSrc] = React.useState();
8819
+ const imgRef = React.useRef(null);
8809
8820
  React.useImperativeHandle(ref, () => ({
8810
8821
  setSrc: (v) => {
8811
8822
  setImgSrc(v);
@@ -8814,7 +8825,6 @@
8814
8825
  React.useEffect(() => {
8815
8826
  setImgSrc(src);
8816
8827
  }, [src]);
8817
- React.useRef(null);
8818
8828
  // useEffect(() => {
8819
8829
  // let observer: any = null;
8820
8830
  // const { current } = imgRef;
@@ -8842,9 +8852,13 @@
8842
8852
  React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
8843
8853
  React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
8844
8854
  React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
8845
- React.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
8855
+ React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign(Object.assign({}, style), { display: 'none' }), loading: loading, onLoad: (e) => {
8856
+ if (imgRef.current)
8857
+ imgRef.current.style.display = 'block';
8846
8858
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
8847
- }, alt: 'image' }))) : (React.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
8859
+ }, alt: 'image' }))) : (React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign(Object.assign({}, style), { display: 'none' }), loading: loading, onLoad: (e) => {
8860
+ if (imgRef.current)
8861
+ imgRef.current.style.display = 'block';
8848
8862
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
8849
8863
  }, alt: 'image' }))));
8850
8864
  });
@@ -8877,7 +8891,8 @@
8877
8891
  const handleClick = (item, index) => {
8878
8892
  if (check === index)
8879
8893
  return;
8880
- productView(popupDetailData, item, item === null || item === void 0 ? void 0 : item.bindCta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
8894
+ const prevItem = products === null || products === void 0 ? void 0 : products[check];
8895
+ productView(popupDetailData, prevItem, prevItem === null || prevItem === void 0 ? void 0 : prevItem.bindCta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
8881
8896
  onCLick === null || onCLick === void 0 ? void 0 : onCLick(index);
8882
8897
  };
8883
8898
  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) => {
@@ -10198,12 +10213,13 @@ Made in Italy` })));
10198
10213
 
10199
10214
  const CommodityList$1 = (_a) => {
10200
10215
  var _b, _c;
10201
- 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"]);
10216
+ var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, translateY = 0, commodityPicture, isExternalLink, onClick } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "translateY", "commodityPicture", "isExternalLink", "onClick"]);
10202
10217
  const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent } = useSxpDataSource();
10203
10218
  const { jumpToWeb } = useEventReport();
10204
10219
  const { popup } = useEditor();
10205
10220
  const recData = isPost ? rec : popupDetailData;
10206
10221
  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];
10222
+ const index = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
10207
10223
  const priceText = React.useCallback((product) => {
10208
10224
  var _a, _b, _c, _d, _e;
10209
10225
  if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
@@ -15521,7 +15537,7 @@ Made in Italy` })));
15521
15537
  * @Author: binruan@chatlabs.com
15522
15538
  * @Date: 2024-01-15 19:03:09
15523
15539
  * @LastEditors: binruan@chatlabs.com
15524
- * @LastEditTime: 2024-07-31 11:33:42
15540
+ * @LastEditTime: 2024-08-01 17:42:09
15525
15541
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
15526
15542
  *
15527
15543
  */
@@ -15582,7 +15598,7 @@ Made in Italy` })));
15582
15598
  React.useEffect(() => {
15583
15599
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
15584
15600
  const visibleChange = () => {
15585
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
15601
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
15586
15602
  const repCond = !openHashtag && !isShowConsent;
15587
15603
  if (document.visibilityState === 'hidden') {
15588
15604
  // 当用户导航到新页面、切换标签页、关闭标签页、最小化或关闭浏览器、刷新原页面(即离开原页面时),或者在移动设备上从浏览器切换到不同的应用程序时
@@ -15622,7 +15638,7 @@ Made in Italy` })));
15622
15638
  fromKName,
15623
15639
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
15624
15640
  ctatId: (_r = (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.bindCta) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
15625
- traceInfo: (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : ''
15641
+ traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : ''
15626
15642
  }
15627
15643
  });
15628
15644
  }
@@ -15667,7 +15683,7 @@ Made in Italy` })));
15667
15683
  const minusHeight = React.useMemo(() => {
15668
15684
  let minusHeight = 0;
15669
15685
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
15670
- minusHeight += 45;
15686
+ minusHeight += 56;
15671
15687
  }
15672
15688
  return minusHeight;
15673
15689
  }, []);
@@ -15793,7 +15809,7 @@ Made in Italy` })));
15793
15809
  }
15794
15810
  };
15795
15811
  const handleSlideSkip = (item, position) => {
15796
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
15812
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
15797
15813
  if (isPreview || waterFallData)
15798
15814
  return;
15799
15815
  const t = new Date() - curTime.current;
@@ -15812,7 +15828,7 @@ Made in Italy` })));
15812
15828
  contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
15813
15829
  position: position + '',
15814
15830
  contentId: (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : '',
15815
- traceInfo: (_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : ''
15831
+ traceInfo: (_u = (_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : (_t = item === null || item === void 0 ? void 0 : item.product) === null || _t === void 0 ? void 0 : _t.traceInfo) !== null && _u !== void 0 ? _u : ''
15816
15832
  }
15817
15833
  });
15818
15834
  setSlideSkipState();
@@ -16343,7 +16359,7 @@ Made in Italy` })));
16343
16359
  * @Author: binruan@chatlabs.com
16344
16360
  * @Date: 2023-10-31 10:56:01
16345
16361
  * @LastEditors: binruan@chatlabs.com
16346
- * @LastEditTime: 2024-07-31 18:54:49
16362
+ * @LastEditTime: 2024-08-01 15:23:51
16347
16363
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
16348
16364
  *
16349
16365
  */
@@ -16369,7 +16385,7 @@ Made in Italy` })));
16369
16385
  }
16370
16386
  }, [popup]);
16371
16387
  const handleClose = () => {
16372
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
16388
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
16373
16389
  if (!popup ||
16374
16390
  (popup === null || popup === void 0 ? void 0 : popup.id) === '' ||
16375
16391
  !visible ||
@@ -16380,10 +16396,10 @@ Made in Italy` })));
16380
16396
  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));
16381
16397
  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') {
16382
16398
  const data = popupDetailData;
16383
- let product = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct;
16384
- 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;
16399
+ let product = (_h = (_g = data === null || data === void 0 ? void 0 : data.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0];
16400
+ let cta = (_o = (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.bindProduct) === null || _m === void 0 ? void 0 : _m.bindCta) !== null && _o !== void 0 ? _o : (_r = (_q = (_p = data === null || data === void 0 ? void 0 : data.video) === null || _p === void 0 ? void 0 : _p.bindProducts) === null || _q === void 0 ? void 0 : _q[0]) === null || _r === void 0 ? void 0 : _r.bindCta;
16385
16401
  if ((checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current) >= 0) {
16386
- const p = (_l = (_k = data === null || data === void 0 ? void 0 : data.video) === null || _k === void 0 ? void 0 : _k.bindProducts) === null || _l === void 0 ? void 0 : _l[checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current];
16402
+ const p = (_t = (_s = data === null || data === void 0 ? void 0 : data.video) === null || _s === void 0 ? void 0 : _s.bindProducts) === null || _t === void 0 ? void 0 : _t[checkCommodityIndexRef === null || checkCommodityIndexRef === void 0 ? void 0 : checkCommodityIndexRef.current];
16387
16403
  if (p) {
16388
16404
  product = p;
16389
16405
  cta = p === null || p === void 0 ? void 0 : p.bindCta;
@@ -16409,7 +16425,7 @@ Made in Italy` })));
16409
16425
  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';
16410
16426
  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';
16411
16427
  const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
16412
- 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, index: index })));
16428
+ 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 })));
16413
16429
  }
16414
16430
  else {
16415
16431
  return React.createElement(React.Fragment, null);