pb-sxp-ui 1.0.8 → 1.0.9

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 (81) hide show
  1. package/dist/index.cjs +67 -65
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +67 -65
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.cjs +3 -3
  6. package/dist/index.min.cjs.map +1 -1
  7. package/dist/index.min.js +3 -3
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/pb-ui.js +67 -65
  10. package/dist/pb-ui.js.map +1 -1
  11. package/dist/pb-ui.min.js +3 -3
  12. package/dist/pb-ui.min.js.map +1 -1
  13. package/es/core/components/SxpPageRender/LikeButton/index.d.ts +1 -0
  14. package/es/core/components/SxpPageRender/LikeButton/index.js +3 -3
  15. package/es/core/components/SxpPageRender/Popup/index.js +1 -1
  16. package/es/core/components/SxpPageRender/RenderCard.js +1 -1
  17. package/es/core/components/SxpPageRender/VideoWidget/index.js +3 -3
  18. package/es/core/components/SxpPageRender/WaterFall/List.js +1 -1
  19. package/es/core/components/SxpPageRender/WaterFall/index.js +3 -3
  20. package/es/core/components/SxpPageRender/index.js +8 -8
  21. package/es/core/context/SxpDataSourceProvider.d.ts +4 -2
  22. package/es/core/context/SxpDataSourceProvider.js +2 -2
  23. package/es/core/hooks/useEventReport.d.ts +2 -2
  24. package/es/core/hooks/useEventReport.js +4 -4
  25. package/es/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
  26. package/es/materials/sxp/popup/CommodityDetail/index.js +4 -3
  27. package/es/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
  28. package/es/materials/sxp/popup/CommodityDetailDiro/index.js +4 -3
  29. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
  30. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +4 -3
  31. package/es/materials/sxp/template/Appoint/index.d.ts +1 -0
  32. package/es/materials/sxp/template/Commodity/index.d.ts +1 -0
  33. package/es/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
  34. package/es/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
  35. package/es/materials/sxp/template/Link/index.d.ts +1 -0
  36. package/es/materials/sxp/template/Link/index.js +3 -3
  37. package/es/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
  38. package/es/materials/sxp/template/MultiCommodity/index.js +5 -5
  39. package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
  40. package/es/materials/sxp/template/MultiCommodityDiro/index.js +5 -5
  41. package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
  42. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +5 -5
  43. package/es/materials/sxp/template/components/EventProvider.d.ts +1 -0
  44. package/es/materials/sxp/template/components/EventProvider.js +6 -6
  45. package/es/materials/sxp/template/components/Img.d.ts +1 -0
  46. package/es/materials/sxp/template/components/Img.js +3 -3
  47. package/lib/core/components/SxpPageRender/LikeButton/index.d.ts +1 -0
  48. package/lib/core/components/SxpPageRender/LikeButton/index.js +3 -3
  49. package/lib/core/components/SxpPageRender/Popup/index.js +1 -1
  50. package/lib/core/components/SxpPageRender/RenderCard.js +1 -1
  51. package/lib/core/components/SxpPageRender/VideoWidget/index.js +3 -3
  52. package/lib/core/components/SxpPageRender/WaterFall/List.js +1 -1
  53. package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -3
  54. package/lib/core/components/SxpPageRender/index.js +8 -8
  55. package/lib/core/context/SxpDataSourceProvider.d.ts +4 -2
  56. package/lib/core/context/SxpDataSourceProvider.js +2 -2
  57. package/lib/core/hooks/useEventReport.d.ts +2 -2
  58. package/lib/core/hooks/useEventReport.js +4 -4
  59. package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
  60. package/lib/materials/sxp/popup/CommodityDetail/index.js +4 -3
  61. package/lib/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
  62. package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +4 -3
  63. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
  64. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +4 -3
  65. package/lib/materials/sxp/template/Appoint/index.d.ts +1 -0
  66. package/lib/materials/sxp/template/Commodity/index.d.ts +1 -0
  67. package/lib/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
  68. package/lib/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
  69. package/lib/materials/sxp/template/Link/index.d.ts +1 -0
  70. package/lib/materials/sxp/template/Link/index.js +3 -3
  71. package/lib/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
  72. package/lib/materials/sxp/template/MultiCommodity/index.js +5 -5
  73. package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
  74. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +5 -5
  75. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
  76. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +5 -5
  77. package/lib/materials/sxp/template/components/EventProvider.d.ts +1 -0
  78. package/lib/materials/sxp/template/components/EventProvider.js +6 -6
  79. package/lib/materials/sxp/template/components/Img.d.ts +1 -0
  80. package/lib/materials/sxp/template/components/Img.js +3 -3
  81. package/package.json +1 -1
package/dist/pb-ui.js CHANGED
@@ -546,7 +546,7 @@
546
546
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
547
547
  return res === null || res === void 0 ? void 0 : res.success;
548
548
  }), [bffFetch]);
549
- const ctaEvent = React.useCallback((eventInfo, rec, product) => {
549
+ const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
550
550
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
551
551
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
552
552
  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);
@@ -561,7 +561,7 @@
561
561
  fromKName = 'imagePage';
562
562
  }
563
563
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
564
- 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: rec === null || rec === void 0 ? void 0 : rec.position, relatedContentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', relatedProductId: 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 })
564
+ 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 + '', relatedContentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', relatedProductId: 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 })
565
565
  });
566
566
  }, [bffEventReport, isFromHashtag]);
567
567
  React.useEffect(() => {
@@ -8098,13 +8098,13 @@
8098
8098
  * @Author: binruan@chatlabs.com
8099
8099
  * @Date: 2024-03-12 10:59:06
8100
8100
  * @LastEditors: binruan@chatlabs.com
8101
- * @LastEditTime: 2024-04-12 15:10:39
8101
+ * @LastEditTime: 2024-04-15 09:47:08
8102
8102
  * @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
8103
8103
  *
8104
8104
  */
8105
8105
  function useEventReport() {
8106
8106
  const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = useSxpDataSource();
8107
- const jumpToWeb = React.useCallback((data, product, cta) => {
8107
+ const jumpToWeb = React.useCallback((data, product, cta, position) => {
8108
8108
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
8109
8109
  let fromKName = '';
8110
8110
  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))) {
@@ -8133,14 +8133,14 @@
8133
8133
  fromKName,
8134
8134
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
8135
8135
  contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
8136
- position: (data === null || data === void 0 ? void 0 : data.position) + '',
8136
+ position: position + '',
8137
8137
  relatedContentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
8138
8138
  relatedCtatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
8139
8139
  traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
8140
8140
  }
8141
8141
  });
8142
8142
  }, [bffEventReport, popupDetailData, isFromHashtag]);
8143
- const productView = React.useCallback((data, product, cta, viewTime) => {
8143
+ const productView = React.useCallback((data, product, cta, viewTime, position) => {
8144
8144
  var _a, _b, _c, _d;
8145
8145
  let fromKName = '';
8146
8146
  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))) {
@@ -8158,7 +8158,7 @@
8158
8158
  fromKName,
8159
8159
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
8160
8160
  contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
8161
- position: (data === null || data === void 0 ? void 0 : data.position) + '',
8161
+ position: position + '',
8162
8162
  relatedContentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
8163
8163
  relatedCtatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
8164
8164
  traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
@@ -8301,7 +8301,7 @@
8301
8301
 
8302
8302
  const CommodityDetail$1 = (_a) => {
8303
8303
  var _b, _c, _d, _e, _f, _g, _h, _j;
8304
- var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle"]);
8304
+ var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index"]);
8305
8305
  const { sxpParameter } = useSxpDataSource();
8306
8306
  const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
8307
8307
  const { jumpToWeb, productView } = useEventReport();
@@ -8310,11 +8310,12 @@
8310
8310
  const data = isPost ? rec : popupDetailData;
8311
8311
  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;
8312
8312
  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;
8313
+ const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
8313
8314
  const handleLink = () => {
8314
8315
  if (product === null || product === void 0 ? void 0 : product.link) {
8315
- jumpToWeb(popupDetailData, product, cta);
8316
+ jumpToWeb(popupDetailData, product, cta, position);
8316
8317
  if (!isPost) {
8317
- productView(data, product, cta, viewTime || curTimeRef.current);
8318
+ productView(data, product, cta, viewTime || curTimeRef.current, position);
8318
8319
  }
8319
8320
  window.location.href = window.getJointUtmLink(product.link);
8320
8321
  }
@@ -8751,7 +8752,7 @@
8751
8752
 
8752
8753
  const CommodityDetailDiroNew$1 = (_a) => {
8753
8754
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
8754
- var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle"]);
8755
+ var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index"]);
8755
8756
  React.useState(true);
8756
8757
  const { sxpParameter } = useSxpDataSource();
8757
8758
  const { popupDetailData, bffEventReport, isPreview, swiperRef, waterFallData } = useSxpDataSource();
@@ -8767,11 +8768,12 @@
8767
8768
  const data = isPost ? rec : popupDetailData;
8768
8769
  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;
8769
8770
  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;
8771
+ const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
8770
8772
  const handleLink = () => {
8771
8773
  if (product === null || product === void 0 ? void 0 : product.link) {
8772
- jumpToWeb(data, product, cta);
8774
+ jumpToWeb(data, product, cta, position);
8773
8775
  if (!isPost) {
8774
- productView(data, product, cta, viewTime || curTimeRef.current);
8776
+ productView(data, product, cta, viewTime || curTimeRef.current, position);
8775
8777
  }
8776
8778
  window.location.href = window.getJointUtmLink(product.link);
8777
8779
  }
@@ -9184,7 +9186,7 @@ Made in Italy` })));
9184
9186
  }
9185
9187
 
9186
9188
  const EventProvider = (_a) => {
9187
- var { rec, children, className, onClick, style, isExternalLink = false } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink"]);
9189
+ var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
9188
9190
  const ref = React.useRef(null);
9189
9191
  const isOnScreen = useOnScreen(ref);
9190
9192
  const { popup } = useEditor();
@@ -9197,22 +9199,22 @@ Made in Italy` })));
9197
9199
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
9198
9200
  eventSubject: 'ctaExposure',
9199
9201
  eventDescription: 'The cta was shown to the user'
9200
- }, rec, item);
9202
+ }, rec, item, index);
9201
9203
  }
9202
- }, [isOnScreen, ref, rec, ctaEvent]);
9204
+ }, [isOnScreen, ref, rec, ctaEvent, index]);
9203
9205
  const handleClick = lodash.throttle(() => {
9204
9206
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
9205
9207
  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;
9206
9208
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
9207
9209
  eventSubject: 'clickCta',
9208
9210
  eventDescription: 'User clicked the CTA'
9209
- }, rec, item);
9210
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(rec);
9211
+ }, rec, item, index);
9212
+ setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
9211
9213
  if (isExternalLink) {
9212
9214
  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) {
9213
9215
  const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
9214
9216
  const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
9215
- jumpToWeb(rec, product, cta);
9217
+ jumpToWeb(rec, product, cta, index);
9216
9218
  window.location.href = (_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;
9217
9219
  window.location.href = window.getJointUtmLink((_k = (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProduct) === null || _k === void 0 ? void 0 : _k.link);
9218
9220
  }
@@ -9383,18 +9385,18 @@ Made in Italy` })));
9383
9385
 
9384
9386
  const Link$1 = (_a) => {
9385
9387
  var _b, _c, _d, _e, _f;
9386
- var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
9388
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index"]);
9387
9389
  const { sxpParameter, bffEventReport } = useSxpDataSource();
9388
9390
  const { jumpToWeb } = useEventReport();
9389
9391
  const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
9390
9392
  const product = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
9391
9393
  const handleTo = () => {
9392
9394
  if (cta === null || cta === void 0 ? void 0 : cta.link) {
9393
- jumpToWeb(recData, product, cta);
9395
+ jumpToWeb(recData, product, cta, index);
9394
9396
  window.location.href = window.getJointUtmLink(cta.link);
9395
9397
  }
9396
9398
  };
9397
- return (React.createElement(EventProvider$1, Object.assign({ rec: recData, className: css.css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
9399
+ return (React.createElement(EventProvider$1, Object.assign({ index: index, rec: recData, className: css.css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
9398
9400
  React.createElement("div", { className: css.css(Object.assign({ backgroundColor: '#f2f2f2', overflow: 'hidden', flexShrink: 0 }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
9399
9401
  React.createElement("img", { className: css.css({ width: '100%', objectFit: 'cover', height: '100%' }), src: (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image, alt: '' })),
9400
9402
  React.createElement("div", { className: css.css({
@@ -9662,11 +9664,11 @@ Made in Italy` })));
9662
9664
  * @Author: binruan@chatlabs.com
9663
9665
  * @Date: 2024-01-16 14:50:13
9664
9666
  * @LastEditors: binruan@chatlabs.com
9665
- * @LastEditTime: 2024-03-11 15:46:24
9667
+ * @LastEditTime: 2024-04-11 18:24:15
9666
9668
  * @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
9667
9669
  *
9668
9670
  */
9669
- const Img = ({ src, rec, item }) => {
9671
+ const Img = ({ src, rec, item, index }) => {
9670
9672
  const ref = React.useRef(null);
9671
9673
  const isOnScreen = useOnScreen(ref);
9672
9674
  const { ctaEvent } = useSxpDataSource();
@@ -9675,9 +9677,9 @@ Made in Italy` })));
9675
9677
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
9676
9678
  eventSubject: 'ctaExposure',
9677
9679
  eventDescription: 'The cta was shown to the user'
9678
- }, rec, item);
9680
+ }, rec, item, index);
9679
9681
  }
9680
- }, [isOnScreen, src, ref, rec, ctaEvent, item]);
9682
+ }, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
9681
9683
  return (React.createElement("img", { ref: ref, hidden: !src, className: css.css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, alt: '' }));
9682
9684
  };
9683
9685
  var Img$1 = React.memo(Img);
@@ -9686,7 +9688,7 @@ Made in Italy` })));
9686
9688
 
9687
9689
  const MultiCommodityDiro$1 = (_a) => {
9688
9690
  var _b, _c;
9689
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
9691
+ var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
9690
9692
  const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
9691
9693
  const { popup } = useEditor();
9692
9694
  const { jumpToWeb } = useEventReport();
@@ -9695,11 +9697,11 @@ Made in Italy` })));
9695
9697
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
9696
9698
  eventSubject: 'clickCta',
9697
9699
  eventDescription: 'User clicked the CTA'
9698
- }, recData, item);
9699
- 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 }) }));
9700
+ }, recData, item, index);
9701
+ 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 }));
9700
9702
  if (isExternalLink) {
9701
9703
  if (item === null || item === void 0 ? void 0 : item.link) {
9702
- jumpToWeb(recData, item, item.bindCta);
9704
+ jumpToWeb(recData, item, item.bindCta, index);
9703
9705
  window.location.href = window.getJointUtmLink(item.link);
9704
9706
  }
9705
9707
  }
@@ -9711,7 +9713,7 @@ Made in Italy` })));
9711
9713
  var _a, _b, _c, _d, _e, _f;
9712
9714
  return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
9713
9715
  React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
9714
- React.createElement(Img$1, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item })),
9716
+ React.createElement(Img$1, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item, index: index })),
9715
9717
  React.createElement("div", { className: css.css({
9716
9718
  color: '#000',
9717
9719
  display: 'flex',
@@ -9798,7 +9800,7 @@ Made in Italy` })));
9798
9800
 
9799
9801
  const MultiCommodity$1 = (_a) => {
9800
9802
  var _b, _c;
9801
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
9803
+ var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
9802
9804
  const { sxpParameter } = useSxpDataSource();
9803
9805
  const { ctaEvent, setPopupDetailData } = useSxpDataSource();
9804
9806
  const { popup } = useEditor();
@@ -9808,11 +9810,11 @@ Made in Italy` })));
9808
9810
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
9809
9811
  eventSubject: 'clickCta',
9810
9812
  eventDescription: 'User clicked the CTA'
9811
- }, recData, item);
9812
- 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 }) }));
9813
+ }, recData, item, index);
9814
+ 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 }));
9813
9815
  if (isExternalLink) {
9814
9816
  if (item === null || item === void 0 ? void 0 : item.link) {
9815
- jumpToWeb(recData, item, item.bindCta);
9817
+ jumpToWeb(recData, item, item.bindCta, index);
9816
9818
  window.location.href = window.getJointUtmLink(item.link);
9817
9819
  }
9818
9820
  }
@@ -9824,7 +9826,7 @@ Made in Italy` })));
9824
9826
  var _a, _b, _c, _d, _e, _f;
9825
9827
  return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
9826
9828
  React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
9827
- React.createElement(Img$1, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item })),
9829
+ React.createElement(Img$1, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item, index: index })),
9828
9830
  React.createElement("div", { className: css.css({
9829
9831
  color: '#fff',
9830
9832
  display: 'flex',
@@ -9911,7 +9913,7 @@ Made in Italy` })));
9911
9913
 
9912
9914
  const MultiCommodityDiroNew$1 = (_a) => {
9913
9915
  var _b, _c;
9914
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
9916
+ var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
9915
9917
  const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
9916
9918
  const { popup } = useEditor();
9917
9919
  const { jumpToWeb } = useEventReport();
@@ -9920,11 +9922,11 @@ Made in Italy` })));
9920
9922
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
9921
9923
  eventSubject: 'clickCta',
9922
9924
  eventDescription: 'User clicked the CTA'
9923
- }, recData, item);
9924
- 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 }) }));
9925
+ }, recData, item, index);
9926
+ 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 }));
9925
9927
  if (isExternalLink) {
9926
9928
  if (item === null || item === void 0 ? void 0 : item.link) {
9927
- jumpToWeb(recData, item, item.bindCta);
9929
+ jumpToWeb(recData, item, item.bindCta, index);
9928
9930
  window.location.href = window.getJointUtmLink(item.link);
9929
9931
  }
9930
9932
  }
@@ -9936,7 +9938,7 @@ Made in Italy` })));
9936
9938
  var _a, _b, _c, _d, _e, _f;
9937
9939
  return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
9938
9940
  React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
9939
- React.createElement(Img$1, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item })),
9941
+ React.createElement(Img$1, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item, index: index })),
9940
9942
  React.createElement("div", { className: css.css({
9941
9943
  color: '#fff',
9942
9944
  display: 'flex',
@@ -11582,7 +11584,7 @@ Made in Italy` })));
11582
11584
  };
11583
11585
  }, [src, showVideo]);
11584
11586
  const handleClickToDetail = () => {
11585
- reportTagsView();
11587
+ reportTagsView(index);
11586
11588
  setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(list);
11587
11589
  setTimeout(() => {
11588
11590
  var _a;
@@ -11690,7 +11692,7 @@ Made in Italy` })));
11690
11692
  * @Author: binruan@chatlabs.com
11691
11693
  * @Date: 2024-01-10 10:58:24
11692
11694
  * @LastEditors: binruan@chatlabs.com
11693
- * @LastEditTime: 2024-04-12 11:29:01
11695
+ * @LastEditTime: 2024-04-15 09:58:50
11694
11696
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
11695
11697
  *
11696
11698
  */
@@ -11717,7 +11719,7 @@ Made in Italy` })));
11717
11719
  if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
11718
11720
  setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
11719
11721
  }
11720
- reportTagsView();
11722
+ reportTagsView(0);
11721
11723
  setWaterFallData === null || setWaterFallData === void 0 ? void 0 : setWaterFallData(undefined);
11722
11724
  setIsFromHashtag === null || setIsFromHashtag === void 0 ? void 0 : setIsFromHashtag(false);
11723
11725
  setTimeout(() => {
@@ -11734,7 +11736,7 @@ Made in Italy` })));
11734
11736
  setRecData(waterFallData);
11735
11737
  }
11736
11738
  }, [waterFallData]);
11737
- const reportTagsView = React.useCallback(() => {
11739
+ const reportTagsView = React.useCallback((index) => {
11738
11740
  var _a, _b, _c, _d, _e, _f;
11739
11741
  const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
11740
11742
  if (!rec)
@@ -11752,7 +11754,7 @@ Made in Italy` })));
11752
11754
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
11753
11755
  eventInfo: {
11754
11756
  relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
11755
- position: rec === null || rec === void 0 ? void 0 : rec.position,
11757
+ position: index + '',
11756
11758
  contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
11757
11759
  traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
11758
11760
  hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
@@ -11887,7 +11889,7 @@ Made in Italy` })));
11887
11889
  const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
11888
11890
  const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
11889
11891
  const LikeButton = (_a) => {
11890
- var { active, activeIcon, unActicveIcon, recData } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData"]);
11892
+ var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
11891
11893
  const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
11892
11894
  const [state, setState] = React.useState(active);
11893
11895
  const likeIcon = useIconLink(defaultLikeIconPath);
@@ -11905,7 +11907,7 @@ Made in Italy` })));
11905
11907
  contentId: (_f = (_e = recData.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
11906
11908
  contentName: (_h = (_g = recData.video) === null || _g === void 0 ? void 0 : _g.title) !== null && _h !== void 0 ? _h : '',
11907
11909
  contentTags: JSON.stringify((_k = (_j = recData.video) === null || _j === void 0 ? void 0 : _j.tags) !== null && _k !== void 0 ? _k : []),
11908
- position: recData.position,
11910
+ position: position + '',
11909
11911
  contentFormat: ((_l = recData.video) === null || _l === void 0 ? void 0 : _l.url) ? 'video' : 'image',
11910
11912
  traceInfo: (_m = recData.video) === null || _m === void 0 ? void 0 : _m.traceInfo
11911
11913
  }
@@ -11925,7 +11927,7 @@ Made in Italy` })));
11925
11927
  contentId: (_q = (_p = recData.video) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : '',
11926
11928
  contentName: (_s = (_r = recData.video) === null || _r === void 0 ? void 0 : _r.title) !== null && _s !== void 0 ? _s : '',
11927
11929
  contentTags: JSON.stringify((_u = (_t = recData.video) === null || _t === void 0 ? void 0 : _t.tags) !== null && _u !== void 0 ? _u : []),
11928
- position: recData.position,
11930
+ position: position + '',
11929
11931
  contentFormat: ((_v = recData.video) === null || _v === void 0 ? void 0 : _v.url) ? 'video' : 'image',
11930
11932
  traceInfo: (_w = recData.video) === null || _w === void 0 ? void 0 : _w.traceInfo
11931
11933
  }
@@ -11983,7 +11985,7 @@ Made in Italy` })));
11983
11985
  startTime: videoCurrentTime,
11984
11986
  videoDuration,
11985
11987
  contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
11986
- position: item.position,
11988
+ position: index + '',
11987
11989
  contentFormat: 'video',
11988
11990
  traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
11989
11991
  }
@@ -12011,7 +12013,7 @@ Made in Italy` })));
12011
12013
  startTime: videoCurrentTime,
12012
12014
  videoDuration,
12013
12015
  contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
12014
- position: item.position,
12016
+ position: index + '',
12015
12017
  contentFormat: 'video',
12016
12018
  traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
12017
12019
  }
@@ -12071,7 +12073,7 @@ Made in Italy` })));
12071
12073
  videoDuration,
12072
12074
  playDuration,
12073
12075
  contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
12074
- position: item.position,
12076
+ position: index + '',
12075
12077
  contentFormat: 'video',
12076
12078
  traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
12077
12079
  }
@@ -12419,7 +12421,7 @@ Made in Italy` })));
12419
12421
  * @Author: binruan@chatlabs.com
12420
12422
  * @Date: 2023-12-26 16:11:34
12421
12423
  * @LastEditors: binruan@chatlabs.com
12422
- * @LastEditTime: 2024-04-10 16:49:34
12424
+ * @LastEditTime: 2024-04-11 18:14:05
12423
12425
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
12424
12426
  *
12425
12427
  */
@@ -12453,7 +12455,7 @@ Made in Italy` })));
12453
12455
  const Component = withBindDataSource(t);
12454
12456
  const defaulSetting = (_x = t === null || t === void 0 ? void 0 : t.extend) === null || _x === void 0 ? void 0 : _x.defaulSetting;
12455
12457
  const isExternalLink = ((_0 = (_z = (_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.event) === null || _z === void 0 ? void 0 : _z.onClick) === null || _0 === void 0 ? void 0 : _0.linkType) === 'externalLink';
12456
- return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_1 = value === null || value === void 0 ? void 0 : value.item) === null || _1 === void 0 ? void 0 : _1.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.textStyle), bindDatas: (_4 = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.bindDatas) !== null && _4 !== void 0 ? _4 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.props, { event: ((_6 = value === null || value === void 0 ? void 0 : value.item) === null || _6 === void 0 ? void 0 : _6.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 })));
12458
+ return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_1 = value === null || value === void 0 ? void 0 : value.item) === null || _1 === void 0 ? void 0 : _1.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.textStyle), bindDatas: (_4 = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.bindDatas) !== null && _4 !== void 0 ? _4 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.props, { event: ((_6 = value === null || value === void 0 ? void 0 : value.item) === null || _6 === void 0 ? void 0 : _6.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 })));
12457
12459
  }
12458
12460
  else {
12459
12461
  return null;
@@ -12479,7 +12481,7 @@ Made in Italy` })));
12479
12481
  * @Author: binruan@chatlabs.com
12480
12482
  * @Date: 2024-01-15 19:03:09
12481
12483
  * @LastEditors: binruan@chatlabs.com
12482
- * @LastEditTime: 2024-04-10 10:13:48
12484
+ * @LastEditTime: 2024-04-11 18:45:44
12483
12485
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12484
12486
  *
12485
12487
  */
@@ -12607,7 +12609,7 @@ Made in Italy` })));
12607
12609
  eventDescription: 'Session completed',
12608
12610
  relatedContentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
12609
12611
  relatedProductId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
12610
- position: item === null || item === void 0 ? void 0 : item.position,
12612
+ position: activeIndex,
12611
12613
  fromKName,
12612
12614
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
12613
12615
  relatedCtatId: (_q = (_p = (_o = item.video) === null || _o === void 0 ? void 0 : _o.bindCta) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : ''
@@ -12650,7 +12652,7 @@ Made in Italy` })));
12650
12652
  const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
12651
12653
  const Component = withBindDataSource(t);
12652
12654
  const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
12653
- return (React.createElement(Component, Object.assign({ key: index, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }) })));
12655
+ return (React.createElement(Component, Object.assign({ key: index, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }), index: index })));
12654
12656
  });
12655
12657
  }
12656
12658
  return null;
@@ -12669,7 +12671,7 @@ Made in Italy` })));
12669
12671
  }
12670
12672
  return null;
12671
12673
  }, [descStyle, activeIndex, tempMap, resolver, tipText, nudge, hashTagStyle]);
12672
- const renderLikeButton = React.useCallback((rec) => {
12674
+ const renderLikeButton = React.useCallback((rec, index) => {
12673
12675
  var _a, _b;
12674
12676
  if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
12675
12677
  return;
@@ -12681,7 +12683,7 @@ Made in Italy` })));
12681
12683
  return (React.createElement(LikeButton$1, { key: rec.position, activeIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIcon, unActicveIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unlikeIcon, active: rec.isCollected, recData: rec, className: 'clc-sxp-like-button', style: {
12682
12684
  top,
12683
12685
  right: (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _b !== void 0 ? _b : 0
12684
- } }));
12686
+ }, position: index }));
12685
12687
  }
12686
12688
  return null;
12687
12689
  }, [globalConfig, waterFallData]);
@@ -12699,7 +12701,7 @@ Made in Italy` })));
12699
12701
  imageEndTime: `${endTime}`,
12700
12702
  playDuration: `${duration}`,
12701
12703
  contentTags: JSON.stringify((_f = item.video.tags) !== null && _f !== void 0 ? _f : []),
12702
- position: item.position,
12704
+ position: activeIndex,
12703
12705
  contentFormat: 'image',
12704
12706
  traceInfo: item.video.traceInfo
12705
12707
  }
@@ -12744,7 +12746,7 @@ Made in Italy` })));
12744
12746
  const handleReportProductView = (item) => {
12745
12747
  var _a, _b, _c;
12746
12748
  if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && !((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls) && (item === null || item === void 0 ? void 0 : item.product)) {
12747
- productView(item, item.product, (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.bindCta, viewTime.current);
12749
+ productView(item, item.product, (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.bindCta, viewTime.current, activeIndex);
12748
12750
  }
12749
12751
  };
12750
12752
  React.useEffect(() => {
@@ -12767,7 +12769,7 @@ Made in Italy` })));
12767
12769
  contentName: (_e = item.video.title) !== null && _e !== void 0 ? _e : '',
12768
12770
  imageStartTime: `${startTime}`,
12769
12771
  contentTags: JSON.stringify((_f = item.video.tags) !== null && _f !== void 0 ? _f : []),
12770
- position: item.position,
12772
+ position: activeIndex,
12771
12773
  contentFormat: 'image',
12772
12774
  traceInfo: item.video.traceInfo
12773
12775
  }
@@ -12801,7 +12803,7 @@ Made in Italy` })));
12801
12803
  React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement(React.Fragment, null,
12802
12804
  renderContent(rec, index),
12803
12805
  renderBottom(rec, index),
12804
- renderLikeButton(rec)))))));
12806
+ renderLikeButton(rec, index)))))));
12805
12807
  });
12806
12808
  }, [containerWidth, data, height, loading, renderBottom, renderContent, visList, loadingImage]);
12807
12809
  const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
@@ -12858,7 +12860,7 @@ Made in Italy` })));
12858
12860
  * @Author: binruan@chatlabs.com
12859
12861
  * @Date: 2023-10-31 10:56:01
12860
12862
  * @LastEditors: binruan@chatlabs.com
12861
- * @LastEditTime: 2024-04-12 09:50:58
12863
+ * @LastEditTime: 2024-04-15 09:39:17
12862
12864
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
12863
12865
  *
12864
12866
  */
@@ -12894,7 +12896,7 @@ Made in Italy` })));
12894
12896
  const product = (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
12895
12897
  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;
12896
12898
  if (product && cta) {
12897
- productView(data, product, cta, curTimeRef.current);
12899
+ productView(data, product, cta, curTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
12898
12900
  }
12899
12901
  setTimeout(() => {
12900
12902
  window === null || window === void 0 ? void 0 : window.sxpPopup('');