pb-sxp-ui 1.0.30 → 1.0.32

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.
package/dist/index.cjs CHANGED
@@ -10,6 +10,7 @@ var qs = require('qs');
10
10
  var css = require('@emotion/css');
11
11
  var proComponents = require('@ant-design/pro-components');
12
12
  var ReactDOM = require('react-dom');
13
+ var Hls = require('hls.js');
13
14
  var EventEmitter = require('eventemitter3');
14
15
 
15
16
  function _interopNamespaceDefault(e) {
@@ -577,7 +578,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
577
578
  fromKName = 'imagePage';
578
579
  }
579
580
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
580
- 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 })
581
+ eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : '', fromKName })
581
582
  });
582
583
  }, [bffEventReport, isFromHashtag]);
583
584
  React.useEffect(() => {
@@ -8150,8 +8151,8 @@ function useEventReport() {
8150
8151
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
8151
8152
  contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
8152
8153
  position: position + '',
8153
- 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 : '',
8154
- relatedCtatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
8154
+ contentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
8155
+ ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
8155
8156
  traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
8156
8157
  }
8157
8158
  });
@@ -8175,8 +8176,8 @@ function useEventReport() {
8175
8176
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
8176
8177
  contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
8177
8178
  position: position + '',
8178
- relatedContentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
8179
- relatedCtatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
8179
+ contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
8180
+ ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
8180
8181
  traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
8181
8182
  timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
8182
8183
  eventSubject: 'productView',
@@ -11794,7 +11795,7 @@ const WaterFall = (props) => {
11794
11795
  }
11795
11796
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
11796
11797
  eventInfo: {
11797
- relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
11798
+ contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
11798
11799
  position: cacheActiveIndex + '',
11799
11800
  contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
11800
11801
  traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
@@ -12126,20 +12127,22 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12126
12127
  setIsPauseVideo(false);
12127
12128
  if (!videoRef.current.src) {
12128
12129
  const videoSrc = rec.video.url;
12129
- // if (videoSrc.includes('.m3u8')) {
12130
- // if (Hls.isSupported()) {
12131
- // const hls = new Hls();
12132
- // hls.loadSource(videoSrc);
12133
- // hls.attachMedia(videoRef.current);
12134
- // } else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
12135
- // videoRef.current.src = videoSrc;
12136
- // } else {
12137
- // videoRef.current.src = videoSrc;
12138
- // }
12139
- // } else {
12140
- // videoRef.current.src = videoSrc;
12141
- // }
12142
- videoRef.current.src = videoSrc;
12130
+ if (videoSrc.includes('.m3u8')) {
12131
+ if (Hls.isSupported()) {
12132
+ const hls = new Hls();
12133
+ hls.loadSource(videoSrc);
12134
+ hls.attachMedia(videoRef.current);
12135
+ }
12136
+ else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
12137
+ videoRef.current.src = videoSrc;
12138
+ }
12139
+ else {
12140
+ videoRef.current.src = videoSrc;
12141
+ }
12142
+ }
12143
+ else {
12144
+ videoRef.current.src = videoSrc;
12145
+ }
12143
12146
  videoRef.current.setAttribute('x5-playsinline', 'true');
12144
12147
  videoRef.current.setAttribute('webkit-playsinline', 'true');
12145
12148
  }
@@ -12563,7 +12566,7 @@ const Nudge = ({ nudge }) => {
12563
12566
  * @Author: binruan@chatlabs.com
12564
12567
  * @Date: 2024-01-15 19:03:09
12565
12568
  * @LastEditors: binruan@chatlabs.com
12566
- * @LastEditTime: 2024-04-18 19:27:03
12569
+ * @LastEditTime: 2024-04-23 15:48:32
12567
12570
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12568
12571
  *
12569
12572
  */
@@ -12645,8 +12648,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12645
12648
  // sessionDuration: Math.floor(((new Date() as any) - curTime) / 1000) + '',
12646
12649
  // eventSubject: 'sessionCompleted',
12647
12650
  // eventDescription: 'Session completed',
12648
- // relatedContentId: item?.video?.itemId,
12649
- // relatedProductId: item?.product?.itemId,
12651
+ // contentId: item?.video?.itemId,
12652
+ // productId: item?.product?.itemId,
12650
12653
  // position: item?.position
12651
12654
  // }
12652
12655
  // });
@@ -12690,12 +12693,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12690
12693
  sessionDuration: Math.floor((new Date() - curTime.current) / 1000) + '',
12691
12694
  eventSubject: 'sessionCompleted',
12692
12695
  eventDescription: 'Session completed',
12693
- relatedContentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
12694
- relatedProductId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
12696
+ contentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
12697
+ productId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
12695
12698
  position: activeIndex + '',
12696
12699
  fromKName,
12697
12700
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
12698
- 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 : ''
12701
+ 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 : ''
12699
12702
  }
12700
12703
  });
12701
12704
  }
@@ -12829,8 +12832,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12829
12832
  eventInfo: {
12830
12833
  eventSubject: 'scrollDown',
12831
12834
  eventDescription: 'User scroll down',
12832
- relatedContentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
12833
- relatedProductId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
12835
+ contentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
12836
+ productId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
12834
12837
  requestId: null
12835
12838
  }
12836
12839
  });
@@ -12842,8 +12845,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12842
12845
  eventInfo: {
12843
12846
  eventSubject: 'scrollUp',
12844
12847
  eventDescription: 'User scroll up',
12845
- relatedContentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
12846
- relatedProductId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
12848
+ contentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
12849
+ productId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
12847
12850
  requestId: null
12848
12851
  }
12849
12852
  });