pb-sxp-ui 1.0.70 → 1.0.72

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 (55) hide show
  1. package/dist/index.cjs +167 -131
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +167 -131
  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 +171 -134
  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/DiyPortalPreview/VideoWidget.js +15 -16
  14. package/es/core/components/DiyPortalPreview/index.js +8 -8
  15. package/es/core/components/SxpPageCore/index.js +2 -2
  16. package/es/core/components/SxpPageRender/FormatImage.js +2 -1
  17. package/es/core/components/SxpPageRender/LikeButton/index.js +11 -11
  18. package/es/core/components/SxpPageRender/Nudge/index.js +2 -2
  19. package/es/core/components/SxpPageRender/VideoWidget/index.js +13 -13
  20. package/es/core/components/SxpPageRender/WaterFall/List.js +5 -9
  21. package/es/core/components/SxpPageRender/index.js +39 -30
  22. package/es/core/components/SxpPageRender/typing.d.ts +1 -0
  23. package/es/core/context/SxpDataSourceProvider.d.ts +1 -0
  24. package/es/core/context/SxpDataSourceProvider.js +12 -4
  25. package/es/materials/sxp/HashTag/settingRender.d.ts +2 -7
  26. package/es/materials/sxp/HashTag/settingRender.js +0 -5
  27. package/es/materials/sxp/defaultSetting.js +1 -1
  28. package/es/materials/sxp/template/Commodity/index.js +4 -4
  29. package/es/materials/sxp/template/CommodityDiro/index.js +4 -4
  30. package/es/materials/sxp/template/CommodityDiroNew/index.js +4 -4
  31. package/es/materials/sxp/template/MultiCommodity/index.js +4 -4
  32. package/es/materials/sxp/template/MultiCommodityDiro/index.js +4 -4
  33. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +4 -4
  34. package/lib/core/components/DiyPortalPreview/VideoWidget.js +15 -16
  35. package/lib/core/components/DiyPortalPreview/index.js +8 -8
  36. package/lib/core/components/SxpPageCore/index.js +2 -2
  37. package/lib/core/components/SxpPageRender/FormatImage.js +1 -0
  38. package/lib/core/components/SxpPageRender/LikeButton/index.js +11 -11
  39. package/lib/core/components/SxpPageRender/Nudge/index.js +2 -2
  40. package/lib/core/components/SxpPageRender/VideoWidget/index.js +13 -13
  41. package/lib/core/components/SxpPageRender/WaterFall/List.js +5 -9
  42. package/lib/core/components/SxpPageRender/index.js +39 -30
  43. package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
  44. package/lib/core/context/SxpDataSourceProvider.d.ts +1 -0
  45. package/lib/core/context/SxpDataSourceProvider.js +12 -4
  46. package/lib/materials/sxp/HashTag/settingRender.d.ts +2 -7
  47. package/lib/materials/sxp/HashTag/settingRender.js +0 -5
  48. package/lib/materials/sxp/defaultSetting.js +1 -1
  49. package/lib/materials/sxp/template/Commodity/index.js +4 -4
  50. package/lib/materials/sxp/template/CommodityDiro/index.js +4 -4
  51. package/lib/materials/sxp/template/CommodityDiroNew/index.js +4 -4
  52. package/lib/materials/sxp/template/MultiCommodity/index.js +4 -4
  53. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +4 -4
  54. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +4 -4
  55. package/package.json +1 -2
@@ -1,5 +1,4 @@
1
1
  import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
- import Hls from 'hls.js';
3
2
  import { useIconLink } from '../SxpPageRender/useIconLink';
4
3
  import FormatImage from '../SxpPageRender/FormatImage';
5
4
  import { useSxpDataSource } from '../../../core/hooks';
@@ -35,15 +34,15 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
35
34
  eventInfo: {
36
35
  eventSubject: 'playVideo',
37
36
  eventDescription: 'User played the video',
38
- contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
39
- contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
37
+ contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
38
+ contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
40
39
  playType,
41
40
  startTime: videoCurrentTime,
42
41
  videoDuration,
43
- contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
42
+ contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
44
43
  position: index + '',
45
44
  contentFormat: 'video',
46
- traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
45
+ traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
47
46
  }
48
47
  });
49
48
  setIsFirstPlay(false);
@@ -92,15 +91,15 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
92
91
  eventInfo: {
93
92
  eventSubject: 'playOverVideo',
94
93
  eventDescription: 'User finished playing the video',
95
- contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
96
- contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
94
+ contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
95
+ contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
97
96
  endTime: videoCurrentTime,
98
97
  videoDuration,
99
98
  playDuration,
100
- contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
99
+ contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
101
100
  position: index + '',
102
101
  contentFormat: 'video',
103
- traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
102
+ traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
104
103
  }
105
104
  });
106
105
  }
@@ -137,10 +136,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
137
136
  return;
138
137
  setIsPauseVideo(false);
139
138
  if (!videoRef.current.src) {
140
- const videoSrc = rec.video.url;
139
+ const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
141
140
  if (videoSrc.includes('.m3u8')) {
142
- if (Hls.isSupported()) {
143
- const hls = new Hls();
141
+ if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.Hls.isSupported())) {
142
+ const hls = new window.Hls();
144
143
  hls.loadSource(videoSrc);
145
144
  hls.attachMedia(videoRef.current);
146
145
  }
@@ -168,7 +167,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
168
167
  (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
169
168
  (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
170
169
  };
171
- }, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
170
+ }, [handleLoadedMetadata, handlePlaying, rec === null || rec === void 0 ? void 0 : rec.video, handLoadeddata]);
172
171
  const renderPoster = useMemo(() => {
173
172
  if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
174
173
  return null;
@@ -195,10 +194,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
195
194
  }
196
195
  : {};
197
196
  }, [blur]);
198
- if (!rec.video) {
197
+ if (!(rec === null || rec === void 0 ? void 0 : rec.video)) {
199
198
  return null;
200
199
  }
201
- return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
200
+ return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, onClick: handleClickVideo(), style: {
202
201
  position: 'relative',
203
202
  width,
204
203
  height,
@@ -223,7 +222,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
223
222
  objectFit: 'contain'
224
223
  } }),
225
224
  React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
226
- renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
225
+ renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, onClick: handleClickVideo(), style: {
227
226
  position: 'relative',
228
227
  width,
229
228
  height,
@@ -31,11 +31,11 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
31
31
  }, [globalConfig, containerHeight, tagList]);
32
32
  const renderContent = (rec, index) => {
33
33
  var _a, _b, _c, _d;
34
- if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
34
+ if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
35
35
  return (React.createElement(VideoWidget, { rec: rec, index: index, muted: true, width: containerWidth, data: data !== null && data !== void 0 ? data : [], height: height, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost }));
36
36
  }
37
- if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
38
- return (React.createElement(PictureGroup, { key: rec.video.itemId, imgUrls: rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
37
+ if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
38
+ return (React.createElement(PictureGroup, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
39
39
  }
40
40
  if (rec.product) {
41
41
  if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.length) > 0) {
@@ -65,15 +65,15 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
65
65
  };
66
66
  const renderBottom = (rec, index) => {
67
67
  var _a, _b, _c, _d, _e, _f, _g;
68
- if (rec.video) {
68
+ if (rec === null || rec === void 0 ? void 0 : rec.video) {
69
69
  return (React.createElement(React.Fragment, null,
70
- ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
70
+ ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
71
71
  React.createElement("div", { className: 'clc-sxp-bottom' },
72
72
  React.createElement(Nudge, { nudge: nudge }),
73
73
  CTA(rec, index),
74
74
  React.createElement("div", null,
75
- 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' }) })),
76
- React.createElement(Hashtag, { index: index, 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.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))));
75
+ 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 === null || rec === void 0 ? void 0 : 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' }) })),
76
+ React.createElement(Hashtag, { index: index, 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 === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))));
77
77
  }
78
78
  return null;
79
79
  };
@@ -87,7 +87,7 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
87
87
  if (top < 40) {
88
88
  top += 40;
89
89
  }
90
- if (rec.video) {
90
+ if (rec === null || rec === void 0 ? void 0 : rec.video) {
91
91
  return (React.createElement(LikeButton, { key: rec.position, activeIcon: (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIcon) !== null && _b !== void 0 ? _b : likeIcon, unActicveIcon: (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unlikeIcon) !== null && _c !== void 0 ? _c : unlikeIcon, position: index, active: rec.isCollected, recData: rec, className: 'clc-sxp-like-button', style: {
92
92
  top,
93
93
  right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0
@@ -9,14 +9,14 @@ Object.values(_materials_).forEach((v) => {
9
9
  RESOLVER[v.extend.type] = v;
10
10
  });
11
11
  const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl, enabledMetaConversionApi }) => {
12
- var _a, _b, _c, _d, _e, _f;
12
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
13
13
  const utmVal = useMemo(() => {
14
14
  var _a;
15
15
  const searchParams = (location === null || location === void 0 ? void 0 : location.search) ? (_a = location === null || location === void 0 ? void 0 : location.search) === null || _a === void 0 ? void 0 : _a.replace('?', '') : '';
16
16
  return searchParams;
17
17
  }, []);
18
18
  return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
19
- React.createElement(SxpDataSourceProvider, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, render: ({ rtcList, tagList }) => {
19
+ React.createElement(SxpDataSourceProvider, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, isShowTag: (_j = (_h = (_g = data === null || data === void 0 ? void 0 : data.data) === null || _g === void 0 ? void 0 : _g.sxpPageConf) === null || _h === void 0 ? void 0 : _h.globalConfig) === null || _j === void 0 ? void 0 : _j.isShowTag, render: ({ rtcList, tagList }) => {
20
20
  var _a;
21
21
  return (React.createElement(React.Fragment, null,
22
22
  React.createElement(SxpPageRender, Object.assign({}, (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER, licenseUrl: licenseUrl })),
@@ -1,4 +1,4 @@
1
- import React, { forwardRef, memo, useEffect, useImperativeHandle, useState } from 'react';
1
+ import React, { forwardRef, memo, useEffect, useImperativeHandle, useRef, useState } from 'react';
2
2
  const FormatImage = forwardRef((props, ref) => {
3
3
  const { src, onLoad, style, className, loading } = props;
4
4
  const [imgSrc, setImgSrc] = useState();
@@ -10,6 +10,7 @@ const FormatImage = forwardRef((props, ref) => {
10
10
  useEffect(() => {
11
11
  setImgSrc(src);
12
12
  }, [src]);
13
+ const imgRef = useRef(null);
13
14
  return (React.createElement(React.Fragment, null, (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
14
15
  React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
15
16
  React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
@@ -15,17 +15,17 @@ const LikeButton = (_a) => {
15
15
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
16
16
  if (state) {
17
17
  setState(false);
18
- const result = (_d = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ videoItemId: (_c = (_b = recData.video) === null || _b === void 0 ? void 0 : _b.itemId) !== null && _c !== void 0 ? _c : '' })))) !== null && _d !== void 0 ? _d : false;
18
+ const result = (_d = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ videoItemId: (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.itemId) !== null && _c !== void 0 ? _c : '' })))) !== null && _d !== void 0 ? _d : false;
19
19
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
20
20
  eventInfo: {
21
21
  eventSubject: 'favoriteContentCanceled',
22
22
  eventDescription: 'This content was unfavorite by the user',
23
- contentId: (_f = (_e = recData.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
24
- contentName: (_h = (_g = recData.video) === null || _g === void 0 ? void 0 : _g.title) !== null && _h !== void 0 ? _h : '',
25
- contentTags: JSON.stringify((_k = (_j = recData.video) === null || _j === void 0 ? void 0 : _j.tags) !== null && _k !== void 0 ? _k : []),
23
+ contentId: (_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
24
+ contentName: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.title) !== null && _h !== void 0 ? _h : '',
25
+ contentTags: JSON.stringify((_k = (_j = recData === null || recData === void 0 ? void 0 : recData.video) === null || _j === void 0 ? void 0 : _j.tags) !== null && _k !== void 0 ? _k : []),
26
26
  position: position + '',
27
- contentFormat: ((_l = recData.video) === null || _l === void 0 ? void 0 : _l.url) ? 'video' : 'image',
28
- traceInfo: (_m = recData.video) === null || _m === void 0 ? void 0 : _m.traceInfo
27
+ contentFormat: ((_l = recData === null || recData === void 0 ? void 0 : recData.video) === null || _l === void 0 ? void 0 : _l.url) ? 'video' : 'image',
28
+ traceInfo: (_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.traceInfo
29
29
  }
30
30
  });
31
31
  if (!result) {
@@ -39,12 +39,12 @@ const LikeButton = (_a) => {
39
39
  eventInfo: {
40
40
  eventSubject: 'favoriteContent',
41
41
  eventDescription: 'This content was favorite by the user',
42
- contentId: (_q = (_p = recData.video) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : '',
43
- contentName: (_s = (_r = recData.video) === null || _r === void 0 ? void 0 : _r.title) !== null && _s !== void 0 ? _s : '',
44
- contentTags: JSON.stringify((_u = (_t = recData.video) === null || _t === void 0 ? void 0 : _t.tags) !== null && _u !== void 0 ? _u : []),
42
+ contentId: (_q = (_p = recData === null || recData === void 0 ? void 0 : recData.video) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : '',
43
+ contentName: (_s = (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.title) !== null && _s !== void 0 ? _s : '',
44
+ contentTags: JSON.stringify((_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.tags) !== null && _u !== void 0 ? _u : []),
45
45
  position: position + '',
46
- contentFormat: ((_v = recData.video) === null || _v === void 0 ? void 0 : _v.url) ? 'video' : 'image',
47
- traceInfo: (_w = recData.video) === null || _w === void 0 ? void 0 : _w.traceInfo
46
+ contentFormat: ((_v = recData === null || recData === void 0 ? void 0 : recData.video) === null || _v === void 0 ? void 0 : _v.url) ? 'video' : 'image',
47
+ traceInfo: (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.traceInfo
48
48
  }
49
49
  });
50
50
  if (!result) {
@@ -8,7 +8,7 @@ const Nudge = ({ nudge }) => {
8
8
  backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
9
9
  borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
10
10
  } },
11
- (nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover' } }) : null,
12
- React.createElement("p", { style: Object.assign(Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle), { textWrap: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }) }, (_g = nudge === null || nudge === void 0 ? void 0 : nudge.content) !== null && _g !== void 0 ? _g : '')))));
11
+ (nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover', flexShrink: 0 } }) : null,
12
+ React.createElement("p", { style: Object.assign(Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle), { textWrap: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', flex: 1, marginBottom: 0 }) }, (_g = nudge === null || nudge === void 0 ? void 0 : nudge.content) !== null && _g !== void 0 ? _g : '')))));
13
13
  };
14
14
  export default Nudge;
@@ -69,15 +69,15 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
69
69
  eventInfo: {
70
70
  eventSubject: 'playVideo',
71
71
  eventDescription: 'User played the video',
72
- contentId: (_d = (_c = item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
73
- contentName: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : '',
72
+ contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
73
+ contentName: (_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : '',
74
74
  playType,
75
75
  startTime: videoCurrentTime,
76
76
  videoDuration,
77
- contentTags: JSON.stringify((_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []),
77
+ contentTags: JSON.stringify((_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []),
78
78
  position: index + '',
79
79
  contentFormat: 'video',
80
- traceInfo: (_j = item.video) === null || _j === void 0 ? void 0 : _j.traceInfo
80
+ traceInfo: (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.traceInfo
81
81
  }
82
82
  });
83
83
  setIsFirstPlay(false);
@@ -162,15 +162,15 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
162
162
  eventInfo: {
163
163
  eventSubject: 'playOverVideo',
164
164
  eventDescription: 'User finished playing the video',
165
- contentId: (_d = (_c = item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
166
- contentName: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : '',
165
+ contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
166
+ contentName: (_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : '',
167
167
  endTime: videoCurrentTime,
168
168
  videoDuration,
169
169
  playDuration,
170
- contentTags: JSON.stringify((_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []),
170
+ contentTags: JSON.stringify((_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []),
171
171
  position: index + '',
172
172
  contentFormat: 'video',
173
- traceInfo: (_j = item.video) === null || _j === void 0 ? void 0 : _j.traceInfo
173
+ traceInfo: (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.traceInfo
174
174
  }
175
175
  });
176
176
  }
@@ -178,9 +178,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
178
178
  useEffect(() => {
179
179
  if (!isActive || !videoRef)
180
180
  return;
181
- const videoSrc = rec.video.url;
181
+ const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
182
182
  if (!videoSrc)
183
183
  return;
184
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.src(videoSrc);
184
185
  setIsPauseVideo(false);
185
186
  const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
186
187
  const dom = document.querySelector('#player-container-id');
@@ -188,7 +189,6 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
188
189
  if (!dom && !dom2)
189
190
  return;
190
191
  videoPlayerWrapperNode === null || videoPlayerWrapperNode === void 0 ? void 0 : videoPlayerWrapperNode.appendChild(dom || dom2);
191
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.src(videoSrc);
192
192
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadedmetadata', handleLoadedmetadata);
193
193
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadeddata', handLoadeddata);
194
194
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('playing', handlePlaying);
@@ -264,10 +264,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
264
264
  window.removeEventListener('beforeunload', handleBeforeUnload);
265
265
  };
266
266
  }, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
267
- if (!rec.video) {
267
+ if (!(rec === null || rec === void 0 ? void 0 : rec.video)) {
268
268
  return null;
269
269
  }
270
- return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: Object.assign({ position: 'relative', width: '100%', height, overflow: 'hidden' }, bgStyle) },
270
+ return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, onClick: handleClickVideo(), style: Object.assign({ position: 'relative', width: '100%', height, overflow: 'hidden' }, bgStyle) },
271
271
  !isBgColor && (React.createElement(FormatImage, { src: blurBgSrc, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) })),
272
272
  React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
273
273
  React.createElement("div", { style: {
@@ -282,7 +282,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
282
282
  React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
283
283
  React.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
284
284
  React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
285
- renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, style: {
285
+ renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, style: {
286
286
  position: 'relative',
287
287
  width: '100%',
288
288
  height,
@@ -14,19 +14,15 @@ const WaterfallFlowItem = (props) => {
14
14
  const canvasRef = useRef(null);
15
15
  const [firstFrameSrc, setFirstFrameSrc] = useState('');
16
16
  const src = useMemo(() => {
17
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
17
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
18
18
  if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) {
19
19
  return (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover;
20
20
  }
21
- else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.url) {
22
- setShowVideo(true);
23
- return (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.url;
21
+ else if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.imgUrls) === null || _d === void 0 ? void 0 : _d.length) {
22
+ return (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.imgUrls) === null || _f === void 0 ? void 0 : _f[0];
24
23
  }
25
- else if ((_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.imgUrls) === null || _f === void 0 ? void 0 : _f.length) {
26
- return (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.imgUrls) === null || _h === void 0 ? void 0 : _h[0];
27
- }
28
- else if ((_k = (_j = rec === null || rec === void 0 ? void 0 : rec.product) === null || _j === void 0 ? void 0 : _j.homePage) === null || _k === void 0 ? void 0 : _k.length) {
29
- return (_m = (_l = rec === null || rec === void 0 ? void 0 : rec.product) === null || _l === void 0 ? void 0 : _l.homePage) === null || _m === void 0 ? void 0 : _m[0];
24
+ else if ((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.product) === null || _g === void 0 ? void 0 : _g.homePage) === null || _h === void 0 ? void 0 : _h.length) {
25
+ return (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.product) === null || _j === void 0 ? void 0 : _j.homePage) === null || _k === void 0 ? void 0 : _k[0];
30
26
  }
31
27
  else {
32
28
  return (sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) || '';
@@ -76,23 +76,29 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
76
76
  };
77
77
  const firstRef = useRef();
78
78
  useEffect(() => {
79
- if (!firstRef.current && !videoRef) {
79
+ var _a, _b, _c;
80
+ if (!firstRef.current && !videoRef && (playerRef === null || playerRef === void 0 ? void 0 : playerRef.current) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
80
81
  firstRef.current = true;
81
82
  const player = TCPlayer('player-container-id', {
82
83
  licenseUrl,
83
84
  controls: false,
84
- autoplay: false,
85
85
  loop: false,
86
+ autoplay: true,
86
87
  muted: true,
87
88
  preload: 'auto',
88
89
  posterImage: false,
89
- bigPlayButton: true
90
+ bigPlayButton: true,
91
+ sources: [
92
+ {
93
+ src: (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.url) !== null && _c !== void 0 ? _c : ''
94
+ }
95
+ ]
90
96
  });
91
97
  player === null || player === void 0 ? void 0 : player.ready(() => {
92
98
  setVideoRef(player);
93
99
  });
94
100
  }
95
- }, [videoRef, licenseUrl]);
101
+ }, [videoRef, licenseUrl, data]);
96
102
  useEffect(() => {
97
103
  if (!isInit)
98
104
  handleH5EnterLink();
@@ -125,7 +131,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
125
131
  if (popupDetailData && (((_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
126
132
  fromKName = 'pdpPage';
127
133
  }
128
- else if (popupDetailData && (tempMap === null || tempMap === void 0 ? void 0 : tempMap[(_f = (_e = (_d = item.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : ''].item.type) === 'Appoint') {
134
+ else if (popupDetailData && (tempMap === null || tempMap === void 0 ? void 0 : tempMap[(_f = (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : ''].item.type) === 'Appoint') {
129
135
  fromKName = 'formPage';
130
136
  }
131
137
  else if (isFromHashtag) {
@@ -150,7 +156,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
150
156
  position: activeIndex + '',
151
157
  fromKName,
152
158
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
153
- ctatId: (_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 : ''
159
+ ctatId: (_q = (_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.bindCta) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : ''
154
160
  }
155
161
  });
156
162
  }
@@ -187,11 +193,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
187
193
  }, [globalConfig]);
188
194
  const renderContent = useCallback((rec, index) => {
189
195
  var _a, _b, _c, _d;
190
- if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
196
+ if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
191
197
  return (React.createElement(VideoWidget, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoRef: videoRef }));
192
198
  }
193
- if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
194
- return (React.createElement(PictureGroup, { key: rec.video.itemId, imgUrls: rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
199
+ if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
200
+ return (React.createElement(PictureGroup, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
195
201
  }
196
202
  if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.length) > 0) {
197
203
  return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
@@ -232,16 +238,16 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
232
238
  }, [isShowMore]);
233
239
  const renderBottom = useCallback((rec, index) => {
234
240
  var _a, _b, _c, _d, _e, _f, _g;
235
- if (rec.video) {
241
+ if (rec === null || rec === void 0 ? void 0 : rec.video) {
236
242
  return (React.createElement(React.Fragment, null,
237
- ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
243
+ ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
238
244
  React.createElement("div", { className: 'clc-sxp-bottom' },
239
245
  React.createElement(Nudge, { nudge: nudge }),
240
246
  (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
241
247
  React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver }))) : null,
242
248
  React.createElement("div", null,
243
- 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' }), onChange: onExpandableChange }),
244
- 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.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle })))));
249
+ 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 === null || rec === void 0 ? void 0 : 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' }), onChange: onExpandableChange }),
250
+ 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 === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle })))));
245
251
  }
246
252
  return null;
247
253
  }, [
@@ -265,7 +271,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
265
271
  if (waterFallData && top < 40) {
266
272
  top += 40;
267
273
  }
268
- if (rec.video) {
274
+ if (rec === null || rec === void 0 ? void 0 : rec.video) {
269
275
  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: {
270
276
  [(_b = globalConfig.likeIconXPosit) !== null && _b !== void 0 ? _b : 'right']: (_c = globalConfig.likeIconX) !== null && _c !== void 0 ? _c : 0,
271
277
  [(_d = globalConfig.likeIconYPosit) !== null && _d !== void 0 ? _d : 'bottom']: top
@@ -275,27 +281,27 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
275
281
  }, [globalConfig, waterFallData]);
276
282
  const handleReportViewImageEnd = (item) => {
277
283
  var _a, _b, _c, _d, _e, _f;
278
- if (!((_a = item.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = item.video) === null || _b === void 0 ? void 0 : _b.imgUrls)) {
284
+ 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)) {
279
285
  const endTime = Date.now();
280
286
  const duration = (endTime - viewImageStartTime.current) / 1000;
281
287
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
282
288
  eventInfo: {
283
289
  eventSubject: 'viewImageCarouselEnd',
284
290
  eventDescription: 'User end view the image carousel',
285
- contentId: (_d = (_c = item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
286
- contentName: (_e = item.video.title) !== null && _e !== void 0 ? _e : '',
291
+ contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
292
+ contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
287
293
  imageEndTime: `${endTime}`,
288
294
  playDuration: `${duration}`,
289
- contentTags: JSON.stringify((_f = item.video.tags) !== null && _f !== void 0 ? _f : []),
295
+ contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
290
296
  position: activeIndex + '',
291
297
  contentFormat: 'image',
292
- traceInfo: item.video.traceInfo
298
+ traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
293
299
  }
294
300
  });
295
301
  }
296
302
  };
297
303
  const handleScrollEvent = (swiper) => {
298
- var _a, _b, _c, _d, _e, _f, _g, _h;
304
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
299
305
  viewTime.current = new Date();
300
306
  const item = data[swiper.previousIndex];
301
307
  if (!item)
@@ -305,8 +311,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
305
311
  eventInfo: {
306
312
  eventSubject: 'scrollDown',
307
313
  eventDescription: 'User scroll down',
308
- contentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
309
- productId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
314
+ contentId: (_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
315
+ productId: (_d = (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
310
316
  requestId: null
311
317
  }
312
318
  });
@@ -317,7 +323,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
317
323
  eventInfo: {
318
324
  eventSubject: 'scrollUp',
319
325
  eventDescription: 'User scroll up',
320
- contentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
326
+ contentId: (_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
321
327
  productId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
322
328
  requestId: null
323
329
  }
@@ -325,14 +331,17 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
325
331
  handleReportViewImageEnd(item);
326
332
  }
327
333
  handleReportProductView(item);
334
+ const curItem = data[swiper.activeIndex];
335
+ if (!((_j = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _j === void 0 ? void 0 : _j.url) && !((_k = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _k === void 0 ? void 0 : _k.imgUrls) && (curItem === null || curItem === void 0 ? void 0 : curItem.product)) {
336
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
337
+ eventName: 'ProductView'
338
+ });
339
+ }
328
340
  };
329
341
  const handleReportProductView = (item) => {
330
342
  var _a, _b, _c;
331
343
  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)) {
332
344
  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);
333
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
334
- eventName: 'ProductView'
335
- });
336
345
  }
337
346
  };
338
347
  useEffect(() => {
@@ -350,13 +359,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
350
359
  eventInfo: {
351
360
  eventSubject: 'viewImageCarouselStart',
352
361
  eventDescription: 'User start view the image carousel',
353
- contentId: (_d = (_c = item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
354
- contentName: (_e = item.video.title) !== null && _e !== void 0 ? _e : '',
362
+ contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
363
+ contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
355
364
  imageStartTime: `${startTime}`,
356
- contentTags: JSON.stringify((_f = item.video.tags) !== null && _f !== void 0 ? _f : []),
365
+ contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
357
366
  position: activeIndex + '',
358
367
  contentFormat: 'image',
359
- traceInfo: item.video.traceInfo
368
+ traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
360
369
  }
361
370
  });
362
371
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
@@ -40,6 +40,7 @@ export type ProductInfoType = {
40
40
  currency: string;
41
41
  bindCta?: CTAInfoType;
42
42
  taxInfo?: string;
43
+ cover?: string;
43
44
  };
44
45
  export type VideoInfoType = {
45
46
  bindCtaId: string;
@@ -102,6 +102,7 @@ export interface SxpDataSourceProviderProps {
102
102
  loadingImage?: string;
103
103
  isOpenHashTag?: boolean;
104
104
  enabledMetaConversionApi?: boolean;
105
+ isShowTag?: boolean;
105
106
  }
106
107
  declare const _default: React.NamedExoticComponent<SxpDataSourceProviderProps>;
107
108
  export default _default;
@@ -14,7 +14,7 @@ var DataSourceType;
14
14
  DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
15
15
  })(DataSourceType || (DataSourceType = {}));
16
16
  const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
17
- const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false }) => {
17
+ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, isShowTag = true }) => {
18
18
  const [rtcList, setRtcList] = useState([]);
19
19
  const [tagList, setTagList] = useState([]);
20
20
  const [loading, setLoading] = useState(false);
@@ -136,9 +136,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
136
136
  if (!enableReportEvent || !enabledMetaConversionApi) {
137
137
  return;
138
138
  }
139
+ const fakeUserId = storeAndLoadFeUserId();
139
140
  return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/fb/events', {
140
141
  method: 'POST',
141
- body: { eventName, actionSource, eventSourceUrl, 'userData.externalId': externalId },
142
+ body: {
143
+ eventName,
144
+ actionSource,
145
+ eventSourceUrl,
146
+ userData: {
147
+ externalId: fakeUserId
148
+ }
149
+ },
142
150
  type: 'beacon'
143
151
  });
144
152
  }, [bffFetch, enableReportEvent, enabledMetaConversionApi]);
@@ -156,7 +164,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
156
164
  }), [bffFetch]);
157
165
  const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
158
166
  var _h, _j, _k, _l, _m;
159
- if (!utmVal)
167
+ if (!utmVal || !isShowTag)
160
168
  return;
161
169
  try {
162
170
  const val = (_k = (_j = (_h = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _h === void 0 ? void 0 : _h.filter((val) => {
@@ -169,7 +177,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
169
177
  catch (e) {
170
178
  console.log('e', e);
171
179
  }
172
- }), [bffFetch, utmVal]);
180
+ }), [bffFetch, utmVal, isShowTag]);
173
181
  const ctaEvent = useCallback((eventInfo, rec, product, position) => {
174
182
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
175
183
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;