pb-sxp-ui 1.7.3 → 1.7.5

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 (33) hide show
  1. package/dist/index.cjs +60 -67
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +60 -67
  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 +60 -67
  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/Modal/index.d.ts +1 -0
  14. package/es/core/components/SxpPageRender/Modal/index.js +2 -2
  15. package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +2 -3
  16. package/es/core/components/SxpPageRender/PictureGroup/index.js +5 -8
  17. package/es/core/components/SxpPageRender/RenderCard.js +2 -1
  18. package/es/core/components/SxpPageRender/VideoWidget/index.js +15 -17
  19. package/es/core/components/SxpPageRender/index.js +25 -20
  20. package/es/core/context/SxpDataSourceProvider.js +9 -6
  21. package/es/core/utils/tool.d.ts +1 -2
  22. package/es/core/utils/tool.js +1 -11
  23. package/lib/core/components/SxpPageRender/Modal/index.d.ts +1 -0
  24. package/lib/core/components/SxpPageRender/Modal/index.js +2 -2
  25. package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +2 -3
  26. package/lib/core/components/SxpPageRender/PictureGroup/index.js +5 -8
  27. package/lib/core/components/SxpPageRender/RenderCard.js +2 -1
  28. package/lib/core/components/SxpPageRender/VideoWidget/index.js +15 -17
  29. package/lib/core/components/SxpPageRender/index.js +25 -20
  30. package/lib/core/context/SxpDataSourceProvider.js +9 -6
  31. package/lib/core/utils/tool.d.ts +1 -2
  32. package/lib/core/utils/tool.js +1 -12
  33. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -298,16 +298,6 @@ function getCookie(val) {
298
298
  });
299
299
  return value !== null && value !== void 0 ? value : '';
300
300
  }
301
- const getResFileSizeFromSrc = (imageSrc) => {
302
- if (!imageSrc)
303
- return '';
304
- return fetch(imageSrc)
305
- .then((response) => response.blob())
306
- .then((blob) => {
307
- const fileSizeInMB = blob.size / (1024 * 1024); // 将文件大小转换为 MB
308
- return fileSizeInMB.toFixed(2) + '';
309
- });
310
- };
311
301
 
312
302
  function unzip(b64Data) {
313
303
  const strData = atob(b64Data);
@@ -808,17 +798,20 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
808
798
  });
809
799
  }, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
810
800
  const bffFbReport = useCallback(({ eventName, product }) => {
811
- var _a, _b, _c, _d;
812
- if (!enableReportEvent || !enabledMetaConversionApi || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
801
+ var _a, _b, _c, _d, _e;
802
+ if (!enableReportEvent ||
803
+ !enabledMetaConversionApi ||
804
+ (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) ||
805
+ !((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName])) {
813
806
  return;
814
807
  }
815
- let jsonParams = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName];
808
+ let jsonParams = JSON.parse(JSON.stringify((_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _b === void 0 ? void 0 : _b[eventName]));
816
809
  const urlParams = new URLSearchParams(window.location.search);
817
810
  const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
818
811
  const fix_par = {
819
- event_source_url: (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href,
812
+ event_source_url: (_c = window === null || window === void 0 ? void 0 : window.location) === null || _c === void 0 ? void 0 : _c.href,
820
813
  external_id: storeAndLoadFeUserId(),
821
- client_user_agent: (_d = (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent) !== null && _d !== void 0 ? _d : '',
814
+ client_user_agent: (_e = (_d = window === null || window === void 0 ? void 0 : window.navigator) === null || _d === void 0 ? void 0 : _d.userAgent) !== null && _e !== void 0 ? _e : '',
822
815
  fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
823
816
  fbp: getCookie('_fbp') ? `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` : '',
824
817
  time: new Date().getTime()
@@ -843,7 +836,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
843
836
  matches.forEach((match) => {
844
837
  const prop = match.substring(2, match.length - 2);
845
838
  try {
846
- const replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
839
+ let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
847
840
  if (replaceValue) {
848
841
  obj[key] = replaceValue;
849
842
  }
@@ -8964,12 +8957,12 @@ SwiperSlide.displayName = 'SwiperSlide';
8964
8957
  * @Author: binruan@chatlabs.com
8965
8958
  * @Date: 2023-11-02 18:34:34
8966
8959
  * @LastEditors: binruan@chatlabs.com
8967
- * @LastEditTime: 2024-10-23 16:44:34
8960
+ * @LastEditTime: 2024-10-30 19:22:59
8968
8961
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
8969
8962
  *
8970
8963
  */
8971
8964
  const closeIcon$1 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
8972
- const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema, fullHeight = window.innerHeight, isFullScreen = false }) => {
8965
+ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema, fullHeight = window.innerHeight, isFullScreen = false, openState }) => {
8973
8966
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
8974
8967
  const touchRef = useRef(null);
8975
8968
  const fTouchRef = useRef(null);
@@ -9021,7 +9014,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
9021
9014
  }, [isOpen, popup]);
9022
9015
  const child = useCallback(() => {
9023
9016
  return children;
9024
- }, [_popup]);
9017
+ }, [_popup, openState]);
9025
9018
  if (!modalEleRef.current)
9026
9019
  return null;
9027
9020
  const handleClose = debounce(() => {
@@ -15661,6 +15654,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15661
15654
  const videoEleRef = useRef(null);
15662
15655
  const hlsRef = useRef(null);
15663
15656
  const initTimeRef = useRef();
15657
+ const loadedTimeRef = useRef();
15664
15658
  const blur = useMemo(() => {
15665
15659
  return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
15666
15660
  }, [videoPostConfig]);
@@ -15707,7 +15701,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15707
15701
  setIsLoadFinish(true);
15708
15702
  }, []);
15709
15703
  const handleStartPlay = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
15710
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
15704
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
15711
15705
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
15712
15706
  return;
15713
15707
  setIsPauseVideo(false);
@@ -15717,22 +15711,20 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15717
15711
  const videoDuration = ((_d = (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
15718
15712
  const videoCurrentTime = ((_f = (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
15719
15713
  const playType = isFirstPlay ? '0' : '1';
15720
- const contentSize = yield getResFileSizeFromSrc((_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.url);
15721
15714
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
15722
15715
  eventInfo: {
15723
15716
  eventSubject: 'playVideo',
15724
15717
  eventDescription: 'User played the video',
15725
- contentId: (_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.itemId) !== null && _j !== void 0 ? _j : '',
15726
- contentName: (_l = (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.title) !== null && _l !== void 0 ? _l : '',
15718
+ 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 : '',
15719
+ 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 : '',
15727
15720
  playType,
15728
15721
  startTime: videoCurrentTime,
15729
15722
  videoDuration,
15730
- contentTags: JSON.stringify((_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.tags) !== null && _o !== void 0 ? _o : []),
15723
+ 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 : []),
15731
15724
  position: index + '',
15732
15725
  contentFormat: 'video',
15733
- traceInfo: (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.traceInfo,
15734
- contentSize,
15735
- loadTime: (new Date() - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current)).toFixed(2) + ''
15726
+ traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo,
15727
+ loadTime: ((loadedTimeRef === null || loadedTimeRef === void 0 ? void 0 : loadedTimeRef.current) - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current)).toFixed(2) + ''
15736
15728
  }
15737
15729
  });
15738
15730
  setIsFirstPlay(false);
@@ -15763,6 +15755,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15763
15755
  const handleLoadedmetadata = useCallback(() => {
15764
15756
  if (!videoRef.current)
15765
15757
  return;
15758
+ loadedTimeRef.current = new Date();
15766
15759
  handleStartPlay();
15767
15760
  handLoadeddata();
15768
15761
  }, [videoRef.current, handLoadeddata, handleStartPlay]);
@@ -15885,7 +15878,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15885
15878
  };
15886
15879
  }, [isActive]);
15887
15880
  useEffect(() => {
15888
- var _a, _b, _c, _d;
15881
+ var _a, _b, _c, _d, _e, _f;
15889
15882
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
15890
15883
  return;
15891
15884
  if (isActive) {
@@ -15893,10 +15886,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15893
15886
  eventName: 'ViewContent',
15894
15887
  product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProduct
15895
15888
  });
15896
- (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
15889
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
15890
+ eventName: 'PageView',
15891
+ product: (_d = (_c = data === null || data === void 0 ? void 0 : data[index]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.bindProduct
15892
+ });
15893
+ (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
15897
15894
  }
15898
15895
  else {
15899
- (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.pause();
15896
+ (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
15900
15897
  }
15901
15898
  }, [isActive, isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
15902
15899
  /*
@@ -15918,12 +15915,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15918
15915
  if (!isActive)
15919
15916
  return;
15920
15917
  const onShow = () => {
15921
- var _a, _b;
15922
15918
  handleClickVideo('start')();
15923
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
15924
- eventName: 'ViewContent',
15925
- product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProduct
15926
- });
15927
15919
  };
15928
15920
  const onHide = handleClickVideo('pause');
15929
15921
  SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
@@ -16094,7 +16086,7 @@ const Picture = (props) => {
16094
16086
  }, onLoad: onShowFirstImage }))));
16095
16087
  };
16096
16088
 
16097
- const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
16089
+ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
16098
16090
  var _a, _b;
16099
16091
  const ref = useRef();
16100
16092
  const { isActive } = useSwiperSlide();
@@ -16106,21 +16098,19 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageE
16106
16098
  if (isLoad && isActive) {
16107
16099
  (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.start();
16108
16100
  if (openHashtag) {
16109
- onReportViewImageEnd(rec);
16101
+ onViewImageEndEvent(rec);
16110
16102
  }
16111
16103
  else {
16112
- onViewImageStartEvent(index, imgInfo);
16104
+ onViewImageStartEvent(index, imgInfo, true);
16113
16105
  }
16114
16106
  }
16115
16107
  else {
16116
16108
  (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.stop();
16117
16109
  }
16118
- }, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
16110
+ }, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
16119
16111
  const showFirstImageFn = useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
16120
16112
  if (!isLoad) {
16121
- const contentSize = yield getResFileSizeFromSrc(e.src);
16122
16113
  setImgInfo({
16123
- contentSize,
16124
16114
  loadTime: (new Date() - initTime).toFixed(2) + ''
16125
16115
  });
16126
16116
  setIsLoad(true);
@@ -16131,7 +16121,7 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageE
16131
16121
  // }
16132
16122
  useEffect(() => {
16133
16123
  const onShow = () => onViewImageStartEvent(index, imgInfo);
16134
- const onHide = () => onReportViewImageEnd(rec);
16124
+ const onHide = () => onViewImageEndEvent(rec);
16135
16125
  SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
16136
16126
  SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
16137
16127
  return () => {
@@ -16277,7 +16267,7 @@ function withBindDataSource(Component) {
16277
16267
  * @Author: binruan@chatlabs.com
16278
16268
  * @Date: 2023-12-26 16:11:34
16279
16269
  * @LastEditors: binruan@chatlabs.com
16280
- * @LastEditTime: 2024-10-25 10:36:59
16270
+ * @LastEditTime: 2024-10-30 14:51:19
16281
16271
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
16282
16272
  *
16283
16273
  */
@@ -16326,7 +16316,7 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }
16326
16316
  const Component = withBindDataSource(t);
16327
16317
  const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
16328
16318
  const isExternalLink = ((_2 = (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.event) === null || _1 === void 0 ? void 0 : _1.onClick) === null || _2 === void 0 ? void 0 : _2.linkType) === 'externalLink';
16329
- let style = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style;
16319
+ let style = cloneDeep((_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style);
16330
16320
  if (style.hasOwnProperty('backdropFilter')) {
16331
16321
  let sbf = style['backdropFilter'];
16332
16322
  style['backdropFilter'] = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
@@ -16424,7 +16414,7 @@ var Tagbar$1 = memo(Tagbar);
16424
16414
  * @Author: binruan@chatlabs.com
16425
16415
  * @Date: 2024-01-15 19:03:09
16426
16416
  * @LastEditors: binruan@chatlabs.com
16427
- * @LastEditTime: 2024-10-25 15:41:58
16417
+ * @LastEditTime: 2024-10-28 16:36:22
16428
16418
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
16429
16419
  *
16430
16420
  */
@@ -16494,7 +16484,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16494
16484
  // 移动端h5直接杀掉浏览器或宿主app时不会触发,pc端直接杀掉标签页时能触发
16495
16485
  if (repCond) {
16496
16486
  SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_HIDE, item);
16497
- // handleReportViewImageEnd(item);
16498
16487
  handleReportProductView(item);
16499
16488
  }
16500
16489
  let fromKName = '';
@@ -16539,7 +16528,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16539
16528
  // 页面可见时触发,注意页面初始化时不会触发
16540
16529
  handleH5EnterLink();
16541
16530
  if (repCond) {
16542
- // handleViewImageStartEvent(activeIndex);
16543
16531
  SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
16544
16532
  backMainFeed('external', selectTag);
16545
16533
  }
@@ -16624,7 +16612,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16624
16612
  return (React.createElement(VideoWidget$3, { key: isReload, rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon }));
16625
16613
  }
16626
16614
  if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
16627
- return (React.createElement(PictureGroup$3, { 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 }));
16615
+ return (React.createElement(PictureGroup$3, { 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, onViewImageEndEvent: handleViewImageStartEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
16628
16616
  }
16629
16617
  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) {
16630
16618
  return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
@@ -16698,7 +16686,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16698
16686
  if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike) || !visible)
16699
16687
  return;
16700
16688
  let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
16701
- if (waterFallData && top < 40) {
16689
+ if (waterFallData && top < 40 && globalConfig.likeIconYPosit === 'top') {
16702
16690
  top += 40;
16703
16691
  }
16704
16692
  if (rec === null || rec === void 0 ? void 0 : rec.video) {
@@ -16710,7 +16698,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16710
16698
  }
16711
16699
  return null;
16712
16700
  }, [globalConfig, waterFallData]);
16713
- const handleReportViewImageEnd = (item) => {
16701
+ const handleViewImageStartEnd = (item) => {
16714
16702
  var _a, _b, _c, _d, _e, _f;
16715
16703
  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)) {
16716
16704
  const endTime = Date.now();
@@ -16793,7 +16781,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16793
16781
  }
16794
16782
  });
16795
16783
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
16796
- handleReportViewImageEnd(item);
16784
+ handleViewImageStartEnd(item);
16797
16785
  handleSlideSkip(item, swiper.previousIndex);
16798
16786
  }
16799
16787
  else {
@@ -16810,7 +16798,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16810
16798
  }
16811
16799
  });
16812
16800
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
16813
- handleReportViewImageEnd(item);
16801
+ handleViewImageStartEnd(item);
16814
16802
  }
16815
16803
  // 商品浏览事件
16816
16804
  handleReportProductView(item);
@@ -16831,7 +16819,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16831
16819
  viewTime.current = new Date();
16832
16820
  }
16833
16821
  }, [openHashtag, data, activeIndex]);
16834
- const handleViewImageStartEvent = (activeIndex, imgInfo) => {
16822
+ const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
16835
16823
  var _a, _b, _c, _d, _e, _f, _g, _h;
16836
16824
  const item = data[activeIndex];
16837
16825
  // 如果是图片集则上报事件
@@ -16849,33 +16837,38 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16849
16837
  position: activeIndex + '',
16850
16838
  contentFormat: 'image',
16851
16839
  traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
16852
- contentSize: imgInfo === null || imgInfo === void 0 ? void 0 : imgInfo.contentSize,
16853
16840
  loadTime: imgInfo === null || imgInfo === void 0 ? void 0 : imgInfo.loadTime
16854
16841
  }
16855
16842
  });
16856
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16857
- eventName: 'ViewContent',
16858
- product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
16859
- });
16860
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16861
- eventName: 'PageView',
16862
- product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
16863
- });
16843
+ if (enableCapi) {
16844
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16845
+ eventName: 'ViewContent',
16846
+ product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
16847
+ });
16848
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16849
+ eventName: 'PageView',
16850
+ product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
16851
+ });
16852
+ }
16864
16853
  }
16865
16854
  };
16866
16855
  const renderToggleButton = useCallback((visible) => {
16867
16856
  var _a, _b, _c, _d, _e, _f;
16868
16857
  if (!visible)
16869
16858
  return;
16859
+ let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _a !== void 0 ? _a : 23;
16860
+ if (waterFallData && top < 40 && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) === 'top') {
16861
+ top += 40;
16862
+ }
16870
16863
  return (((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === true) && (React.createElement(ToggleButton$1, { style: {
16871
16864
  position: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed) ? 'fixed' : 'absolute',
16872
- visibility: ((_b = (_a = visList === null || visList === void 0 ? void 0 : visList[activeIndex]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.url) ? 'visible' : 'hidden',
16865
+ visibility: ((_c = (_b = visList === null || visList === void 0 ? void 0 : visList[activeIndex]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.url) ? 'visible' : 'hidden',
16873
16866
  zIndex: 999,
16874
16867
  transform: 'translate3d(0px,0px,0px)',
16875
- [(_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _c !== void 0 ? _c : 'right']: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _d !== void 0 ? _d : 0,
16876
- [(_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _e !== void 0 ? _e : 'bottom']: (_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _f !== void 0 ? _f : 23
16868
+ [(_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _d !== void 0 ? _d : 'right']: (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _e !== void 0 ? _e : 0,
16869
+ [(_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _f !== void 0 ? _f : 'bottom']: top
16877
16870
  }, defaultValue: isMuted, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon, onChange: setIsMuted })));
16878
- }, [globalConfig, visList, activeIndex, isMuted]);
16871
+ }, [globalConfig, visList, activeIndex, isMuted, waterFallData]);
16879
16872
  const renderView = useMemo(() => {
16880
16873
  if (loading) {
16881
16874
  return (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
@@ -16908,7 +16901,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16908
16901
  renderToggleButton
16909
16902
  ]);
16910
16903
  return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container', style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
16911
- waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
16904
+ waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff', top: `${minusHeight}px` }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
16912
16905
  const isEq = isEqual(rtcList, cacheRtcList);
16913
16906
  if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
16914
16907
  setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);