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.js CHANGED
@@ -6,6 +6,7 @@ import qs from 'qs';
6
6
  import { css } from '@emotion/css';
7
7
  import { BetaSchemaForm } from '@ant-design/pro-components';
8
8
  import * as ReactDOM from 'react-dom';
9
+ import Hls from 'hls.js';
9
10
  import EventEmitter from 'eventemitter3';
10
11
 
11
12
  /******************************************************************************
@@ -554,7 +555,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
554
555
  fromKName = 'imagePage';
555
556
  }
556
557
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
557
- 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 })
558
+ 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 })
558
559
  });
559
560
  }, [bffEventReport, isFromHashtag]);
560
561
  useEffect(() => {
@@ -8127,8 +8128,8 @@ function useEventReport() {
8127
8128
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
8128
8129
  contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
8129
8130
  position: position + '',
8130
- 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 : '',
8131
- relatedCtatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
8131
+ 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 : '',
8132
+ ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
8132
8133
  traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
8133
8134
  }
8134
8135
  });
@@ -8152,8 +8153,8 @@ function useEventReport() {
8152
8153
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
8153
8154
  contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
8154
8155
  position: position + '',
8155
- relatedContentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
8156
- relatedCtatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
8156
+ contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
8157
+ ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
8157
8158
  traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
8158
8159
  timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
8159
8160
  eventSubject: 'productView',
@@ -11771,7 +11772,7 @@ const WaterFall = (props) => {
11771
11772
  }
11772
11773
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
11773
11774
  eventInfo: {
11774
- relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
11775
+ contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
11775
11776
  position: cacheActiveIndex + '',
11776
11777
  contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
11777
11778
  traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
@@ -12103,20 +12104,22 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12103
12104
  setIsPauseVideo(false);
12104
12105
  if (!videoRef.current.src) {
12105
12106
  const videoSrc = rec.video.url;
12106
- // if (videoSrc.includes('.m3u8')) {
12107
- // if (Hls.isSupported()) {
12108
- // const hls = new Hls();
12109
- // hls.loadSource(videoSrc);
12110
- // hls.attachMedia(videoRef.current);
12111
- // } else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
12112
- // videoRef.current.src = videoSrc;
12113
- // } else {
12114
- // videoRef.current.src = videoSrc;
12115
- // }
12116
- // } else {
12117
- // videoRef.current.src = videoSrc;
12118
- // }
12119
- videoRef.current.src = videoSrc;
12107
+ if (videoSrc.includes('.m3u8')) {
12108
+ if (Hls.isSupported()) {
12109
+ const hls = new Hls();
12110
+ hls.loadSource(videoSrc);
12111
+ hls.attachMedia(videoRef.current);
12112
+ }
12113
+ else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
12114
+ videoRef.current.src = videoSrc;
12115
+ }
12116
+ else {
12117
+ videoRef.current.src = videoSrc;
12118
+ }
12119
+ }
12120
+ else {
12121
+ videoRef.current.src = videoSrc;
12122
+ }
12120
12123
  videoRef.current.setAttribute('x5-playsinline', 'true');
12121
12124
  videoRef.current.setAttribute('webkit-playsinline', 'true');
12122
12125
  }
@@ -12540,7 +12543,7 @@ const Nudge = ({ nudge }) => {
12540
12543
  * @Author: binruan@chatlabs.com
12541
12544
  * @Date: 2024-01-15 19:03:09
12542
12545
  * @LastEditors: binruan@chatlabs.com
12543
- * @LastEditTime: 2024-04-18 19:27:03
12546
+ * @LastEditTime: 2024-04-23 15:48:32
12544
12547
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12545
12548
  *
12546
12549
  */
@@ -12622,8 +12625,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12622
12625
  // sessionDuration: Math.floor(((new Date() as any) - curTime) / 1000) + '',
12623
12626
  // eventSubject: 'sessionCompleted',
12624
12627
  // eventDescription: 'Session completed',
12625
- // relatedContentId: item?.video?.itemId,
12626
- // relatedProductId: item?.product?.itemId,
12628
+ // contentId: item?.video?.itemId,
12629
+ // productId: item?.product?.itemId,
12627
12630
  // position: item?.position
12628
12631
  // }
12629
12632
  // });
@@ -12667,12 +12670,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12667
12670
  sessionDuration: Math.floor((new Date() - curTime.current) / 1000) + '',
12668
12671
  eventSubject: 'sessionCompleted',
12669
12672
  eventDescription: 'Session completed',
12670
- relatedContentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
12671
- relatedProductId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
12673
+ contentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
12674
+ productId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
12672
12675
  position: activeIndex + '',
12673
12676
  fromKName,
12674
12677
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
12675
- 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 : ''
12678
+ 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 : ''
12676
12679
  }
12677
12680
  });
12678
12681
  }
@@ -12806,8 +12809,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12806
12809
  eventInfo: {
12807
12810
  eventSubject: 'scrollDown',
12808
12811
  eventDescription: 'User scroll down',
12809
- relatedContentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
12810
- relatedProductId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
12812
+ contentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
12813
+ productId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
12811
12814
  requestId: null
12812
12815
  }
12813
12816
  });
@@ -12819,8 +12822,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12819
12822
  eventInfo: {
12820
12823
  eventSubject: 'scrollUp',
12821
12824
  eventDescription: 'User scroll up',
12822
- relatedContentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
12823
- relatedProductId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
12825
+ contentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
12826
+ productId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
12824
12827
  requestId: null
12825
12828
  }
12826
12829
  });