pb-sxp-ui 1.0.8 → 1.0.10

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 (85) hide show
  1. package/dist/index.cjs +79 -69
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +79 -69
  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 +79 -69
  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/Nudge/index.js +2 -2
  16. package/es/core/components/SxpPageRender/Popup/index.js +1 -1
  17. package/es/core/components/SxpPageRender/RenderCard.js +1 -1
  18. package/es/core/components/SxpPageRender/VideoWidget/index.js +3 -3
  19. package/es/core/components/SxpPageRender/WaterFall/List.js +1 -1
  20. package/es/core/components/SxpPageRender/WaterFall/index.js +3 -3
  21. package/es/core/components/SxpPageRender/index.d.ts +1 -0
  22. package/es/core/components/SxpPageRender/index.js +10 -10
  23. package/es/core/context/SxpDataSourceProvider.d.ts +4 -2
  24. package/es/core/context/SxpDataSourceProvider.js +2 -2
  25. package/es/core/hooks/useEventReport.d.ts +2 -2
  26. package/es/core/hooks/useEventReport.js +4 -4
  27. package/es/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
  28. package/es/materials/sxp/popup/CommodityDetail/index.js +4 -3
  29. package/es/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
  30. package/es/materials/sxp/popup/CommodityDetailDiro/index.js +4 -3
  31. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
  32. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +4 -3
  33. package/es/materials/sxp/template/Appoint/index.d.ts +1 -0
  34. package/es/materials/sxp/template/Commodity/index.d.ts +1 -0
  35. package/es/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
  36. package/es/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
  37. package/es/materials/sxp/template/Link/index.d.ts +1 -0
  38. package/es/materials/sxp/template/Link/index.js +3 -3
  39. package/es/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
  40. package/es/materials/sxp/template/MultiCommodity/index.js +5 -5
  41. package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
  42. package/es/materials/sxp/template/MultiCommodityDiro/index.js +5 -5
  43. package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
  44. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +5 -5
  45. package/es/materials/sxp/template/components/EventProvider.d.ts +1 -0
  46. package/es/materials/sxp/template/components/EventProvider.js +6 -6
  47. package/es/materials/sxp/template/components/Img.d.ts +1 -0
  48. package/es/materials/sxp/template/components/Img.js +3 -3
  49. package/lib/core/components/SxpPageRender/LikeButton/index.d.ts +1 -0
  50. package/lib/core/components/SxpPageRender/LikeButton/index.js +3 -3
  51. package/lib/core/components/SxpPageRender/Nudge/index.js +2 -2
  52. package/lib/core/components/SxpPageRender/Popup/index.js +1 -1
  53. package/lib/core/components/SxpPageRender/RenderCard.js +1 -1
  54. package/lib/core/components/SxpPageRender/VideoWidget/index.js +3 -3
  55. package/lib/core/components/SxpPageRender/WaterFall/List.js +1 -1
  56. package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -3
  57. package/lib/core/components/SxpPageRender/index.d.ts +1 -0
  58. package/lib/core/components/SxpPageRender/index.js +10 -10
  59. package/lib/core/context/SxpDataSourceProvider.d.ts +4 -2
  60. package/lib/core/context/SxpDataSourceProvider.js +2 -2
  61. package/lib/core/hooks/useEventReport.d.ts +2 -2
  62. package/lib/core/hooks/useEventReport.js +4 -4
  63. package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
  64. package/lib/materials/sxp/popup/CommodityDetail/index.js +4 -3
  65. package/lib/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
  66. package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +4 -3
  67. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
  68. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +4 -3
  69. package/lib/materials/sxp/template/Appoint/index.d.ts +1 -0
  70. package/lib/materials/sxp/template/Commodity/index.d.ts +1 -0
  71. package/lib/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
  72. package/lib/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
  73. package/lib/materials/sxp/template/Link/index.d.ts +1 -0
  74. package/lib/materials/sxp/template/Link/index.js +3 -3
  75. package/lib/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
  76. package/lib/materials/sxp/template/MultiCommodity/index.js +5 -5
  77. package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
  78. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +5 -5
  79. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
  80. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +5 -5
  81. package/lib/materials/sxp/template/components/EventProvider.d.ts +1 -0
  82. package/lib/materials/sxp/template/components/EventProvider.js +6 -6
  83. package/lib/materials/sxp/template/components/Img.d.ts +1 -0
  84. package/lib/materials/sxp/template/components/Img.js +3 -3
  85. package/package.json +1 -1
@@ -5,6 +5,7 @@ interface ILikeProps extends React.DetailedHTMLProps<React.ButtonHTMLAttributes<
5
5
  unActicveIcon?: string;
6
6
  active?: boolean;
7
7
  recData: RecItemType;
8
+ position: number;
8
9
  }
9
10
  declare const _default: React.NamedExoticComponent<ILikeProps>;
10
11
  export default _default;
@@ -6,7 +6,7 @@ import { useSxpDataSource } from '../../../../core/hooks';
6
6
  const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
7
7
  const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
8
8
  const LikeButton = (_a) => {
9
- var { active, activeIcon, unActicveIcon, recData } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData"]);
9
+ var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
10
10
  const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
11
11
  const [state, setState] = useState(active);
12
12
  const likeIcon = useIconLink(defaultLikeIconPath);
@@ -23,7 +23,7 @@ const LikeButton = (_a) => {
23
23
  contentId: (_f = (_e = recData.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
24
24
  contentName: (_h = (_g = recData.video) === null || _g === void 0 ? void 0 : _g.title) !== null && _h !== void 0 ? _h : '',
25
25
  contentTags: JSON.stringify((_k = (_j = recData.video) === null || _j === void 0 ? void 0 : _j.tags) !== null && _k !== void 0 ? _k : []),
26
- position: recData.position,
26
+ position: position + '',
27
27
  contentFormat: ((_l = recData.video) === null || _l === void 0 ? void 0 : _l.url) ? 'video' : 'image',
28
28
  traceInfo: (_m = recData.video) === null || _m === void 0 ? void 0 : _m.traceInfo
29
29
  }
@@ -42,7 +42,7 @@ const LikeButton = (_a) => {
42
42
  contentId: (_q = (_p = recData.video) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : '',
43
43
  contentName: (_s = (_r = recData.video) === null || _r === void 0 ? void 0 : _r.title) !== null && _s !== void 0 ? _s : '',
44
44
  contentTags: JSON.stringify((_u = (_t = recData.video) === null || _t === void 0 ? void 0 : _t.tags) !== null && _u !== void 0 ? _u : []),
45
- position: recData.position,
45
+ position: position + '',
46
46
  contentFormat: ((_v = recData.video) === null || _v === void 0 ? void 0 : _v.url) ? 'video' : 'image',
47
47
  traceInfo: (_w = recData.video) === null || _w === void 0 ? void 0 : _w.traceInfo
48
48
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  const Nudge = ({ nudge }) => {
3
- return (React.createElement("div", { hidden: !(nudge === null || nudge === void 0 ? void 0 : nudge.isOpen), className: 'clc-sxp-bottom-nudge', style: {
3
+ return (React.createElement(React.Fragment, null, (nudge === null || nudge === void 0 ? void 0 : nudge.isOpen) && (React.createElement("div", { className: 'clc-sxp-bottom-nudge', style: {
4
4
  marginBottom: nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom,
5
5
  width: nudge === null || nudge === void 0 ? void 0 : nudge.size.width,
6
6
  height: nudge === null || nudge === void 0 ? void 0 : nudge.size.height,
@@ -8,6 +8,6 @@ const Nudge = ({ nudge }) => {
8
8
  borderRadius: nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius
9
9
  } },
10
10
  (nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover' } }) : null,
11
- React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, nudge === null || nudge === void 0 ? void 0 : nudge.content)));
11
+ React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, nudge === null || nudge === void 0 ? void 0 : nudge.content)))));
12
12
  };
13
13
  export default Nudge;
@@ -35,7 +35,7 @@ const Popup = () => {
35
35
  const product = (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
36
36
  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;
37
37
  if (product && cta) {
38
- productView(data, product, cta, curTimeRef.current);
38
+ productView(data, product, cta, curTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
39
39
  }
40
40
  setTimeout(() => {
41
41
  window === null || window === void 0 ? void 0 : window.sxpPopup('');
@@ -32,7 +32,7 @@ const RenderCard = ({ rec, index, tempMap, resolver }) => {
32
32
  const Component = withBindDataSource(t);
33
33
  const defaulSetting = (_x = t === null || t === void 0 ? void 0 : t.extend) === null || _x === void 0 ? void 0 : _x.defaulSetting;
34
34
  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';
35
- 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 })));
35
+ 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 })));
36
36
  }
37
37
  else {
38
38
  return null;
@@ -39,7 +39,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
39
39
  startTime: videoCurrentTime,
40
40
  videoDuration,
41
41
  contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
42
- position: item.position,
42
+ position: index + '',
43
43
  contentFormat: 'video',
44
44
  traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
45
45
  }
@@ -67,7 +67,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
67
67
  startTime: videoCurrentTime,
68
68
  videoDuration,
69
69
  contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
70
- position: item.position,
70
+ position: index + '',
71
71
  contentFormat: 'video',
72
72
  traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
73
73
  }
@@ -127,7 +127,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
127
127
  videoDuration,
128
128
  playDuration,
129
129
  contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
130
- position: item.position,
130
+ position: index + '',
131
131
  contentFormat: 'video',
132
132
  traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
133
133
  }
@@ -96,7 +96,7 @@ const WaterfallFlowItem = (props) => {
96
96
  };
97
97
  }, [src, showVideo]);
98
98
  const handleClickToDetail = () => {
99
- reportTagsView();
99
+ reportTagsView(index);
100
100
  setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(list);
101
101
  setTimeout(() => {
102
102
  var _a;
@@ -29,7 +29,7 @@ const WaterFall = (props) => {
29
29
  if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
30
30
  setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
31
31
  }
32
- reportTagsView();
32
+ reportTagsView(0);
33
33
  setWaterFallData === null || setWaterFallData === void 0 ? void 0 : setWaterFallData(undefined);
34
34
  setIsFromHashtag === null || setIsFromHashtag === void 0 ? void 0 : setIsFromHashtag(false);
35
35
  setTimeout(() => {
@@ -46,7 +46,7 @@ const WaterFall = (props) => {
46
46
  setRecData(waterFallData);
47
47
  }
48
48
  }, [waterFallData]);
49
- const reportTagsView = useCallback(() => {
49
+ const reportTagsView = useCallback((index) => {
50
50
  var _a, _b, _c, _d, _e, _f;
51
51
  const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
52
52
  if (!rec)
@@ -64,7 +64,7 @@ const WaterFall = (props) => {
64
64
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
65
65
  eventInfo: {
66
66
  relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
67
- position: rec === null || rec === void 0 ? void 0 : rec.position,
67
+ position: index + '',
68
68
  contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
69
69
  traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
70
70
  hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
@@ -18,6 +18,7 @@ interface ISxpPageRenderProps {
18
18
  isShowLike?: boolean;
19
19
  swipeTipIcon?: string;
20
20
  hashTag?: any[];
21
+ isOpenTextShadow?: boolean;
21
22
  };
22
23
  descStyle?: CSSProperties;
23
24
  tipText?: {
@@ -120,7 +120,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
120
120
  eventDescription: 'Session completed',
121
121
  relatedContentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
122
122
  relatedProductId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
123
- position: item === null || item === void 0 ? void 0 : item.position,
123
+ position: activeIndex,
124
124
  fromKName,
125
125
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
126
126
  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 : ''
@@ -162,7 +162,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
162
162
  const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
163
163
  const Component = withBindDataSource(t);
164
164
  const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
165
- 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' }) })));
165
+ 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 })));
166
166
  });
167
167
  }
168
168
  return null;
@@ -176,12 +176,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
176
176
  React.createElement(Nudge, { nudge: nudge }),
177
177
  React.createElement("div", { className: 'clc-sxp-bottom-card' },
178
178
  React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
179
- React.createElement(ExpandableText, { 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: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: descStyle }),
179
+ React.createElement(ExpandableText, { 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: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', 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' }) }),
180
180
  React.createElement(Hashtag, { index: activeIndex, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.url) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))));
181
181
  }
182
182
  return null;
183
- }, [descStyle, activeIndex, tempMap, resolver, tipText, nudge, hashTagStyle]);
184
- const renderLikeButton = useCallback((rec) => {
183
+ }, [descStyle, activeIndex, tempMap, resolver, tipText, nudge, hashTagStyle, globalConfig]);
184
+ const renderLikeButton = useCallback((rec, index) => {
185
185
  var _a, _b;
186
186
  if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
187
187
  return;
@@ -193,7 +193,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
193
193
  return (React.createElement(LikeButton, { 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: {
194
194
  top,
195
195
  right: (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _b !== void 0 ? _b : 0
196
- } }));
196
+ }, position: index }));
197
197
  }
198
198
  return null;
199
199
  }, [globalConfig, waterFallData]);
@@ -211,7 +211,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
211
211
  imageEndTime: `${endTime}`,
212
212
  playDuration: `${duration}`,
213
213
  contentTags: JSON.stringify((_f = item.video.tags) !== null && _f !== void 0 ? _f : []),
214
- position: item.position,
214
+ position: activeIndex,
215
215
  contentFormat: 'image',
216
216
  traceInfo: item.video.traceInfo
217
217
  }
@@ -253,7 +253,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
253
253
  const handleReportProductView = (item) => {
254
254
  var _a, _b, _c;
255
255
  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)) {
256
- productView(item, item.product, (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.bindCta, viewTime.current);
256
+ 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);
257
257
  }
258
258
  };
259
259
  useEffect(() => {
@@ -275,7 +275,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
275
275
  contentName: (_e = item.video.title) !== null && _e !== void 0 ? _e : '',
276
276
  imageStartTime: `${startTime}`,
277
277
  contentTags: JSON.stringify((_f = item.video.tags) !== null && _f !== void 0 ? _f : []),
278
- position: item.position,
278
+ position: activeIndex,
279
279
  contentFormat: 'image',
280
280
  traceInfo: item.video.traceInfo
281
281
  }
@@ -309,7 +309,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
309
309
  React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement(React.Fragment, null,
310
310
  renderContent(rec, index),
311
311
  renderBottom(rec, index),
312
- renderLikeButton(rec)))))));
312
+ renderLikeButton(rec, index)))))));
313
313
  });
314
314
  }, [containerWidth, data, height, loading, renderBottom, renderContent, visList, loadingImage]);
315
315
  const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
@@ -22,7 +22,9 @@ export interface ISxpDataSourceContext {
22
22
  mutateLike?: (body: {
23
23
  content: string;
24
24
  }) => Promise<boolean>;
25
- popupDetailData?: RecItemType;
25
+ popupDetailData?: RecItemType & {
26
+ index: number;
27
+ };
26
28
  setPopupDetailData?: React.Dispatch<React.SetStateAction<any | null>>;
27
29
  loadVideos?: (page: number) => Promise<void>;
28
30
  getRecommendVideos?: (query?: {
@@ -44,7 +46,7 @@ export interface ISxpDataSourceContext {
44
46
  sxpParameter?: PageData['sxp_parameter'];
45
47
  waterFallData?: IWaterFallDataType;
46
48
  setWaterFallData?: React.Dispatch<React.SetStateAction<IWaterFallDataType | undefined>>;
47
- ctaEvent?: (eventInfo: any, rec?: RecItemType, product?: ProductInfoType | VideoInfoType | null) => void;
49
+ ctaEvent?: (eventInfo: any, rec?: RecItemType, product?: ProductInfoType | VideoInfoType | null, number?: number) => void;
48
50
  swiperRef?: any;
49
51
  openHashtag?: boolean;
50
52
  setOpenHashtag?: React.Dispatch<React.SetStateAction<boolean>>;
@@ -126,7 +126,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
126
126
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
127
127
  return res === null || res === void 0 ? void 0 : res.success;
128
128
  }), [bffFetch]);
129
- const ctaEvent = useCallback((eventInfo, rec, product) => {
129
+ const ctaEvent = useCallback((eventInfo, rec, product, position) => {
130
130
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
131
131
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
132
132
  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);
@@ -141,7 +141,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
141
141
  fromKName = 'imagePage';
142
142
  }
143
143
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
144
- 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 })
144
+ 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 })
145
145
  });
146
146
  }, [bffEventReport, isFromHashtag]);
147
147
  useEffect(() => {
@@ -1,5 +1,5 @@
1
1
  import { RecItemType } from '../components/SxpPageRender/typing';
2
2
  export declare function useEventReport(): {
3
- jumpToWeb: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta']) => void;
4
- productView: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], viewTime?: any) => void;
3
+ jumpToWeb: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], position?: number) => void;
4
+ productView: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], viewTime?: any, position?: number) => void;
5
5
  };
@@ -2,7 +2,7 @@ import { useCallback } from 'react';
2
2
  import { useSxpDataSource } from './useSxpDataSource';
3
3
  export function useEventReport() {
4
4
  const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = useSxpDataSource();
5
- const jumpToWeb = useCallback((data, product, cta) => {
5
+ const jumpToWeb = useCallback((data, product, cta, position) => {
6
6
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
7
7
  let fromKName = '';
8
8
  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))) {
@@ -31,14 +31,14 @@ export function useEventReport() {
31
31
  fromKName,
32
32
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
33
33
  contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
34
- position: (data === null || data === void 0 ? void 0 : data.position) + '',
34
+ position: position + '',
35
35
  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 : '',
36
36
  relatedCtatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
37
37
  traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
38
38
  }
39
39
  });
40
40
  }, [bffEventReport, popupDetailData, isFromHashtag]);
41
- const productView = useCallback((data, product, cta, viewTime) => {
41
+ const productView = useCallback((data, product, cta, viewTime, position) => {
42
42
  var _a, _b, _c, _d;
43
43
  let fromKName = '';
44
44
  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))) {
@@ -56,7 +56,7 @@ export function useEventReport() {
56
56
  fromKName,
57
57
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
58
58
  contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
59
- position: (data === null || data === void 0 ? void 0 : data.position) + '',
59
+ position: position + '',
60
60
  relatedContentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
61
61
  relatedCtatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
62
62
  traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
@@ -28,6 +28,7 @@ export interface ICommodityDetailProps {
28
28
  info: CSSProperties;
29
29
  };
30
30
  buttonStyle?: CSSProperties;
31
+ index?: number;
31
32
  }
32
33
  declare const _default: React.NamedExoticComponent<ICommodityDetailProps>;
33
34
  export default _default;
@@ -10,7 +10,7 @@ import Modal from '../../../../core/components/SxpPageRender/Modal';
10
10
  import ExpandableText from '../../../../core/components/SxpPageRender/ExpandableText';
11
11
  const CommodityDetail = (_a) => {
12
12
  var _b, _c, _d, _e, _f, _g, _h, _j;
13
- 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"]);
13
+ 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"]);
14
14
  const { sxpParameter } = useSxpDataSource();
15
15
  const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
16
16
  const { jumpToWeb, productView } = useEventReport();
@@ -19,11 +19,12 @@ const CommodityDetail = (_a) => {
19
19
  const data = isPost ? rec : popupDetailData;
20
20
  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;
21
21
  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;
22
+ const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
22
23
  const handleLink = () => {
23
24
  if (product === null || product === void 0 ? void 0 : product.link) {
24
- jumpToWeb(popupDetailData, product, cta);
25
+ jumpToWeb(popupDetailData, product, cta, position);
25
26
  if (!isPost) {
26
- productView(data, product, cta, viewTime || curTimeRef.current);
27
+ productView(data, product, cta, viewTime || curTimeRef.current, position);
27
28
  }
28
29
  window.location.href = window.getJointUtmLink(product.link);
29
30
  }
@@ -13,6 +13,7 @@ export interface ICommodityDetailDiroProps {
13
13
  viewTime?: any;
14
14
  isPost?: boolean;
15
15
  bottom_image?: string;
16
+ index?: number;
16
17
  }
17
18
  declare const _default: React.NamedExoticComponent<ICommodityDetailDiroProps>;
18
19
  export default _default;
@@ -9,7 +9,7 @@ import arrow from './arrow.png';
9
9
  import { useEventReport } from '../../../../core/hooks/useEventReport';
10
10
  const CommodityDetailDiro = (_a) => {
11
11
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
12
- var { style, isDefault, rec, viewTime, isPost, bottom_image } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image"]);
12
+ var { style, isDefault, rec, viewTime, isPost, bottom_image, index } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "index"]);
13
13
  const [spread, setSpread] = useState(true);
14
14
  const { sxpParameter } = useSxpDataSource();
15
15
  const { popupDetailData, bffEventReport, isPreview, swiperRef, waterFallData } = useSxpDataSource();
@@ -24,11 +24,12 @@ const CommodityDetailDiro = (_a) => {
24
24
  const data = isPost ? rec : popupDetailData;
25
25
  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;
26
26
  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;
27
+ const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
27
28
  const handleLink = () => {
28
29
  if (product === null || product === void 0 ? void 0 : product.link) {
29
- jumpToWeb(data, product, cta);
30
+ jumpToWeb(data, product, cta, position);
30
31
  if (!isPost) {
31
- productView(data, product, cta, viewTime || curTimeRef.current);
32
+ productView(data, product, cta, viewTime || curTimeRef.current, position);
32
33
  }
33
34
  window.location.href = window.getJointUtmLink(product.link);
34
35
  }
@@ -29,6 +29,7 @@ export interface ICommodityDetailDiroNewProps {
29
29
  info: CSSProperties;
30
30
  };
31
31
  buttonStyle?: CSSProperties;
32
+ index?: number;
32
33
  }
33
34
  declare const _default: React.NamedExoticComponent<ICommodityDetailDiroNewProps>;
34
35
  export default _default;
@@ -10,7 +10,7 @@ import ExpandableText from '../../../../core/components/SxpPageRender/Expandable
10
10
  import { useEventReport } from '../../../../core/hooks/useEventReport';
11
11
  const CommodityDetailDiroNew = (_a) => {
12
12
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
13
- 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"]);
13
+ 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"]);
14
14
  const [spread, setSpread] = useState(true);
15
15
  const { sxpParameter } = useSxpDataSource();
16
16
  const { popupDetailData, bffEventReport, isPreview, swiperRef, waterFallData } = useSxpDataSource();
@@ -26,11 +26,12 @@ const CommodityDetailDiroNew = (_a) => {
26
26
  const data = isPost ? rec : popupDetailData;
27
27
  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;
28
28
  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;
29
+ const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
29
30
  const handleLink = () => {
30
31
  if (product === null || product === void 0 ? void 0 : product.link) {
31
- jumpToWeb(data, product, cta);
32
+ jumpToWeb(data, product, cta, position);
32
33
  if (!isPost) {
33
- productView(data, product, cta, viewTime || curTimeRef.current);
34
+ productView(data, product, cta, viewTime || curTimeRef.current, position);
34
35
  }
35
36
  window.location.href = window.getJointUtmLink(product.link);
36
37
  }
@@ -9,6 +9,7 @@ export interface IAppointProps {
9
9
  bottom_image?: string;
10
10
  ctaTempStyles?: ICtaTempStylesType;
11
11
  isExternalLink?: boolean;
12
+ index?: number;
12
13
  }
13
14
  declare const _default: React.NamedExoticComponent<IAppointProps>;
14
15
  export default _default;
@@ -9,6 +9,7 @@ export interface ICommodityProps {
9
9
  bottom_image?: string;
10
10
  ctaTempStyles?: ICtaTempStylesType;
11
11
  isExternalLink?: boolean;
12
+ index?: number;
12
13
  }
13
14
  declare const _default: React.NamedExoticComponent<ICommodityProps>;
14
15
  export default _default;
@@ -9,6 +9,7 @@ export interface ICommodityDiroProps {
9
9
  bottom_image?: string;
10
10
  ctaTempStyles?: ICtaTempStylesType;
11
11
  isExternalLink?: boolean;
12
+ index?: number;
12
13
  }
13
14
  declare const _default: React.NamedExoticComponent<ICommodityDiroProps>;
14
15
  export default _default;
@@ -9,6 +9,7 @@ export interface ICommodityDiroNewProps {
9
9
  bottom_image?: string;
10
10
  ctaTempStyles?: ICtaTempStylesType;
11
11
  isExternalLink?: boolean;
12
+ index?: number;
12
13
  }
13
14
  declare const _default: React.NamedExoticComponent<ICommodityDiroNewProps>;
14
15
  export default _default;
@@ -8,6 +8,7 @@ export interface ILinkProps {
8
8
  recData?: RecItemType;
9
9
  bottom_image?: string;
10
10
  ctaTempStyles?: ICtaTempStylesType;
11
+ index?: number;
11
12
  }
12
13
  declare const _default: React.NamedExoticComponent<ILinkProps>;
13
14
  export default _default;
@@ -7,18 +7,18 @@ import { useSxpDataSource } from '../../../../core/hooks';
7
7
  import { useEventReport } from '../../../../core/hooks/useEventReport';
8
8
  const Link = (_a) => {
9
9
  var _b, _c, _d, _e, _f;
10
- var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
10
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index"]);
11
11
  const { sxpParameter, bffEventReport } = useSxpDataSource();
12
12
  const { jumpToWeb } = useEventReport();
13
13
  const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
14
14
  const product = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
15
15
  const handleTo = () => {
16
16
  if (cta === null || cta === void 0 ? void 0 : cta.link) {
17
- jumpToWeb(recData, product, cta);
17
+ jumpToWeb(recData, product, cta, index);
18
18
  window.location.href = window.getJointUtmLink(cta.link);
19
19
  }
20
20
  };
21
- return (React.createElement(EventProvider, Object.assign({ rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
21
+ return (React.createElement(EventProvider, Object.assign({ index: index, rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
22
22
  React.createElement("div", { className: css(Object.assign({ backgroundColor: '#f2f2f2', overflow: 'hidden', flexShrink: 0 }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
23
23
  React.createElement("img", { className: 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: '' })),
24
24
  React.createElement("div", { className: css({
@@ -10,6 +10,7 @@ export interface IMultiCommodityProps {
10
10
  bottom_image?: string;
11
11
  ctaTempStyles?: ICtaTempStylesType;
12
12
  isExternalLink?: boolean;
13
+ index?: number;
13
14
  }
14
15
  declare const _default: React.NamedExoticComponent<IMultiCommodityProps>;
15
16
  export default _default;
@@ -10,7 +10,7 @@ import { useEditor, useSxpDataSource } from '../../../../core/hooks';
10
10
  import { useEventReport } from '../../../../core/hooks/useEventReport';
11
11
  const MultiCommodity = (_a) => {
12
12
  var _b, _c;
13
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
13
+ 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"]);
14
14
  const { sxpParameter } = useSxpDataSource();
15
15
  const { ctaEvent, setPopupDetailData } = useSxpDataSource();
16
16
  const { popup } = useEditor();
@@ -20,11 +20,11 @@ const MultiCommodity = (_a) => {
20
20
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
21
21
  eventSubject: 'clickCta',
22
22
  eventDescription: 'User clicked the CTA'
23
- }, recData, item);
24
- 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 }) }));
23
+ }, recData, item, index);
24
+ 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 }));
25
25
  if (isExternalLink) {
26
26
  if (item === null || item === void 0 ? void 0 : item.link) {
27
- jumpToWeb(recData, item, item.bindCta);
27
+ jumpToWeb(recData, item, item.bindCta, index);
28
28
  window.location.href = window.getJointUtmLink(item.link);
29
29
  }
30
30
  }
@@ -36,7 +36,7 @@ const MultiCommodity = (_a) => {
36
36
  var _a, _b, _c, _d, _e, _f;
37
37
  return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
38
38
  React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
39
- React.createElement(Img, { 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 })),
39
+ React.createElement(Img, { 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 })),
40
40
  React.createElement("div", { className: css({
41
41
  color: '#fff',
42
42
  display: 'flex',
@@ -10,6 +10,7 @@ export interface IMultiCommodityDiroProps {
10
10
  bottom_image?: string;
11
11
  ctaTempStyles?: ICtaTempStylesType;
12
12
  isExternalLink?: boolean;
13
+ index?: number;
13
14
  }
14
15
  declare const _default: React.NamedExoticComponent<IMultiCommodityDiroProps>;
15
16
  export default _default;
@@ -10,7 +10,7 @@ import { useEditor, useSxpDataSource } from '../../../../core/hooks';
10
10
  import { useEventReport } from '../../../../core/hooks/useEventReport';
11
11
  const MultiCommodityDiro = (_a) => {
12
12
  var _b, _c;
13
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
13
+ 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"]);
14
14
  const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
15
15
  const { popup } = useEditor();
16
16
  const { jumpToWeb } = useEventReport();
@@ -19,11 +19,11 @@ const MultiCommodityDiro = (_a) => {
19
19
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
20
20
  eventSubject: 'clickCta',
21
21
  eventDescription: 'User clicked the CTA'
22
- }, recData, item);
23
- 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 }) }));
22
+ }, recData, item, index);
23
+ 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 }));
24
24
  if (isExternalLink) {
25
25
  if (item === null || item === void 0 ? void 0 : item.link) {
26
- jumpToWeb(recData, item, item.bindCta);
26
+ jumpToWeb(recData, item, item.bindCta, index);
27
27
  window.location.href = window.getJointUtmLink(item.link);
28
28
  }
29
29
  }
@@ -35,7 +35,7 @@ const MultiCommodityDiro = (_a) => {
35
35
  var _a, _b, _c, _d, _e, _f;
36
36
  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(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
37
37
  React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
38
- React.createElement(Img, { 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 })),
38
+ React.createElement(Img, { 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 })),
39
39
  React.createElement("div", { className: css({
40
40
  color: '#000',
41
41
  display: 'flex',
@@ -10,6 +10,7 @@ export interface IMultiCommodityDiroNewProps {
10
10
  bottom_image?: string;
11
11
  ctaTempStyles?: ICtaTempStylesType;
12
12
  isExternalLink?: boolean;
13
+ index?: number;
13
14
  }
14
15
  declare const _default: React.NamedExoticComponent<IMultiCommodityDiroNewProps>;
15
16
  export default _default;