pb-sxp-ui 1.7.1 → 1.7.2

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 (41) hide show
  1. package/dist/index.cjs +118 -57
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +118 -57
  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 +118 -57
  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.js +6 -3
  14. package/es/core/components/SxpPageRender/VideoWidget/index.js +8 -5
  15. package/es/core/components/SxpPageRender/WaterFall/index.js +5 -2
  16. package/es/core/components/SxpPageRender/index.d.ts +1 -0
  17. package/es/core/components/SxpPageRender/index.js +10 -17
  18. package/es/core/context/SxpDataSourceProvider.d.ts +2 -4
  19. package/es/core/context/SxpDataSourceProvider.js +53 -11
  20. package/es/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
  21. package/es/materials/sxp/popup/CommodityDetail/index.js +12 -7
  22. package/es/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
  23. package/es/materials/sxp/popup/CommodityDetailDiro/index.js +15 -8
  24. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
  25. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +15 -8
  26. package/es/materials/sxp/popup/CommodityList/index.js +7 -2
  27. package/lib/core/components/SxpPageRender/Modal/index.js +5 -2
  28. package/lib/core/components/SxpPageRender/VideoWidget/index.js +8 -5
  29. package/lib/core/components/SxpPageRender/WaterFall/index.js +5 -2
  30. package/lib/core/components/SxpPageRender/index.d.ts +1 -0
  31. package/lib/core/components/SxpPageRender/index.js +10 -17
  32. package/lib/core/context/SxpDataSourceProvider.d.ts +2 -4
  33. package/lib/core/context/SxpDataSourceProvider.js +53 -11
  34. package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
  35. package/lib/materials/sxp/popup/CommodityDetail/index.js +12 -7
  36. package/lib/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
  37. package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +15 -8
  38. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
  39. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +15 -8
  40. package/lib/materials/sxp/popup/CommodityList/index.js +6 -1
  41. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -819,23 +819,65 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
819
819
  type: 'beacon'
820
820
  });
821
821
  }, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
822
- const bffFbReport = React.useCallback((_a) => {
823
- var _b, _c, _d;
824
- var { eventName, actionSource = 'website', eventSourceUrl = (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href, externalId } = _a;
822
+ const bffFbReport = React.useCallback(({ eventName, product }) => {
823
+ var _a, _b, _c, _d;
825
824
  if (!enableReportEvent || !enabledMetaConversionApi || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
826
825
  return;
827
826
  }
828
- const fakeUserId = storeAndLoadFeUserId();
827
+ let jsonParams = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName];
829
828
  const urlParams = new URLSearchParams(window.location.search);
830
- const fbclid = urlParams.get('fbclid');
829
+ const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
830
+ const fix_par = {
831
+ event_source_url: (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href,
832
+ external_id: storeAndLoadFeUserId(),
833
+ 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 : '',
834
+ fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
835
+ fbp: getCookie('_fbp') ? `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` : '',
836
+ time: new Date().getTime()
837
+ };
838
+ const regex = /\{\{(.*?)\}\}/g;
839
+ const getEventParams = (obj) => {
840
+ if (!obj)
841
+ return;
842
+ if (obj instanceof Array) {
843
+ obj === null || obj === void 0 ? void 0 : obj.map((item) => getEventParams(item));
844
+ }
845
+ else {
846
+ for (const key in obj) {
847
+ if (obj.hasOwnProperty(key)) {
848
+ const value = obj === null || obj === void 0 ? void 0 : obj[key];
849
+ if (typeof value === 'object') {
850
+ getEventParams(value);
851
+ }
852
+ else if (typeof value === 'string') {
853
+ const matches = value === null || value === void 0 ? void 0 : value.match(regex);
854
+ if (matches) {
855
+ matches.forEach((match) => {
856
+ const prop = match.substring(2, match.length - 2);
857
+ try {
858
+ const replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
859
+ if (replaceValue) {
860
+ obj[key] = replaceValue;
861
+ }
862
+ else {
863
+ delete obj[key];
864
+ }
865
+ }
866
+ catch (error) {
867
+ delete obj[key];
868
+ console.error('An error occurred:', error === null || error === void 0 ? void 0 : error.message);
869
+ }
870
+ });
871
+ }
872
+ }
873
+ }
874
+ }
875
+ }
876
+ };
877
+ getEventParams(jsonParams);
831
878
  return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/fb/events', {
832
879
  method: 'POST',
833
- body: {
834
- eventName,
835
- actionSource,
836
- eventSourceUrl,
837
- userData: Object.assign(Object.assign(Object.assign({ externalId: fakeUserId }, (fbclid && { fbc: `fb.2.${new Date().getTime()}.${fbclid}` })), (getCookie('_fbp') && { fbp: `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` })), { clientUserAgent: (_d = (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent) !== null && _d !== void 0 ? _d : '' })
838
- },
880
+ body: jsonParams,
839
881
  type: 'beacon'
840
882
  });
841
883
  }, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
@@ -8934,7 +8976,7 @@ SwiperSlide.displayName = 'SwiperSlide';
8934
8976
  * @Author: binruan@chatlabs.com
8935
8977
  * @Date: 2023-11-02 18:34:34
8936
8978
  * @LastEditors: binruan@chatlabs.com
8937
- * @LastEditTime: 2024-10-11 18:18:41
8979
+ * @LastEditTime: 2024-10-23 16:44:34
8938
8980
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
8939
8981
  *
8940
8982
  */
@@ -8951,7 +8993,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
8951
8993
  const [isShow, setIsShow] = React.useState(false);
8952
8994
  const modalEleRef = React.useRef(null);
8953
8995
  const { globalConfig, popupDetailData } = useSxpDataSource();
8954
- const { schema: _schema } = useEditor();
8996
+ const { schema: _schema, popup: _popup } = useEditor();
8955
8997
  const [scrollTop, setScrollTop] = React.useState(15);
8956
8998
  React.useEffect(() => {
8957
8999
  const parentNode = document.getElementById('sxp-render');
@@ -8989,6 +9031,9 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
8989
9031
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
8990
9032
  }
8991
9033
  }, [isOpen, popup]);
9034
+ const child = React.useCallback(() => {
9035
+ return children;
9036
+ }, [_popup]);
8992
9037
  if (!modalEleRef.current)
8993
9038
  return null;
8994
9039
  const handleClose = lodash.debounce(() => {
@@ -9074,7 +9119,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
9074
9119
  var _a;
9075
9120
  setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
9076
9121
  }
9077
- })), children)))))), modalEleRef.current);
9122
+ })), child())))))), modalEleRef.current);
9078
9123
  };
9079
9124
  var Modal$1 = React.memo(Modal);
9080
9125
 
@@ -9332,7 +9377,7 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
9332
9377
 
9333
9378
  const CommodityDetail$1 = (_a) => {
9334
9379
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
9335
- var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor"]);
9380
+ var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive"]);
9336
9381
  const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
9337
9382
  const { jumpToWeb, productView } = useEventReport();
9338
9383
  const curTimeRef = React.useRef(null);
@@ -9362,12 +9407,17 @@ const CommodityDetail$1 = (_a) => {
9362
9407
  }
9363
9408
  };
9364
9409
  React.useEffect(() => {
9365
- if (!isPost) {
9366
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
9367
- eventName: 'ProductView'
9368
- });
9369
- }
9370
- }, [isPost, bffFbReport]);
9410
+ if (!isActive)
9411
+ return;
9412
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
9413
+ eventName: 'ProductView',
9414
+ product
9415
+ });
9416
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
9417
+ eventName: 'PageView',
9418
+ product
9419
+ });
9420
+ }, [isActive, bffFbReport]);
9371
9421
  React.useEffect(() => {
9372
9422
  const initTime = () => {
9373
9423
  curTimeRef.current = new Date();
@@ -10209,7 +10259,7 @@ var settingRender$7 = [
10209
10259
 
10210
10260
  const CommodityDetailDiroNew$1 = (_a) => {
10211
10261
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
10212
- var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor"]);
10262
+ var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive"]);
10213
10263
  React.useState(true);
10214
10264
  const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
10215
10265
  const { jumpToWeb, productView } = useEventReport();
@@ -10243,14 +10293,21 @@ const CommodityDetailDiroNew$1 = (_a) => {
10243
10293
  }
10244
10294
  };
10245
10295
  React.useEffect(() => {
10246
- if (!isPost) {
10247
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10248
- eventName: 'ProductView'
10249
- });
10250
- }
10251
- }, [isPost, bffFbReport]);
10296
+ if (!isActive)
10297
+ return;
10298
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10299
+ eventName: 'ProductView',
10300
+ product
10301
+ });
10302
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10303
+ eventName: 'PageView',
10304
+ product
10305
+ });
10306
+ }, [isActive, bffFbReport]);
10252
10307
  React.useEffect(() => {
10253
10308
  const initTime = () => {
10309
+ if (!isActive)
10310
+ return;
10254
10311
  curTimeRef.current = new Date();
10255
10312
  };
10256
10313
  initTime();
@@ -10258,7 +10315,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
10258
10315
  return () => {
10259
10316
  window.removeEventListener('pageshow', initTime);
10260
10317
  };
10261
- }, []);
10318
+ }, [isActive]);
10262
10319
  const priceText = getPriceText({
10263
10320
  product,
10264
10321
  enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
@@ -10870,7 +10927,7 @@ var Img$1 = React.memo(Img);
10870
10927
  const CommodityList$1 = (_a) => {
10871
10928
  var _b, _c, _d;
10872
10929
  var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, translateY = 0, commodityPicture, isExternalLink, onClick } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "translateY", "commodityPicture", "isExternalLink", "onClick"]);
10873
- const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent, globalConfig } = useSxpDataSource();
10930
+ const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent, globalConfig, bffFbReport } = useSxpDataSource();
10874
10931
  const { jumpToWeb } = useEventReport();
10875
10932
  const { popup } = useEditor();
10876
10933
  const recData = isPost ? rec : popupDetailData;
@@ -10900,6 +10957,11 @@ const CommodityList$1 = (_a) => {
10900
10957
  onClick === null || onClick === void 0 ? void 0 : onClick();
10901
10958
  }
10902
10959
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
10960
+ React.useEffect(() => {
10961
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10962
+ eventName: 'PageView'
10963
+ });
10964
+ }, []);
10903
10965
  return (React.createElement("div", { className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
10904
10966
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
10905
10967
  return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("div", Object.assign({ key: index }, props, { className: css.css({
@@ -14417,13 +14479,13 @@ function WaterfallList(_a) {
14417
14479
  * @Author: binruan@chatlabs.com
14418
14480
  * @Date: 2024-01-10 10:58:24
14419
14481
  * @LastEditors: binruan@chatlabs.com
14420
- * @LastEditTime: 2024-10-11 13:43:22
14482
+ * @LastEditTime: 2024-10-23 16:58:01
14421
14483
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
14422
14484
  *
14423
14485
  */
14424
14486
  const WaterFall = (props) => {
14425
14487
  var _a;
14426
- const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag } = useSxpDataSource();
14488
+ const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag, bffFbReport } = useSxpDataSource();
14427
14489
  const { backMainFeed } = useEventReport();
14428
14490
  React.useRef(null);
14429
14491
  const modalEleRef = React.useRef(null);
@@ -14500,8 +14562,11 @@ const WaterFall = (props) => {
14500
14562
  React.useEffect(() => {
14501
14563
  if (openHashtag) {
14502
14564
  setViewTime(new Date());
14565
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
14566
+ eventName: 'PageView'
14567
+ });
14503
14568
  }
14504
- }, [openHashtag]);
14569
+ }, [openHashtag, bffFbReport]);
14505
14570
  React.useEffect(() => {
14506
14571
  const initTime = () => {
14507
14572
  setViewTime(new Date());
@@ -15802,17 +15867,18 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15802
15867
  };
15803
15868
  }, [isActive]);
15804
15869
  React.useEffect(() => {
15805
- var _a, _b;
15870
+ var _a, _b, _c, _d;
15806
15871
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
15807
15872
  return;
15808
15873
  if (isActive) {
15809
15874
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
15810
- eventName: 'ViewContent'
15875
+ eventName: 'ViewContent',
15876
+ 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
15811
15877
  });
15812
- (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
15878
+ (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
15813
15879
  }
15814
15880
  else {
15815
- (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.pause();
15881
+ (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.pause();
15816
15882
  }
15817
15883
  }, [isActive, isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
15818
15884
  /*
@@ -15834,9 +15900,11 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15834
15900
  if (!isActive)
15835
15901
  return;
15836
15902
  const onShow = () => {
15903
+ var _a, _b;
15837
15904
  handleClickVideo('start')();
15838
15905
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
15839
- eventName: 'ViewContent'
15906
+ eventName: 'ViewContent',
15907
+ 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
15840
15908
  });
15841
15909
  };
15842
15910
  const onHide = handleClickVideo('pause');
@@ -16323,7 +16391,7 @@ var Tagbar$1 = React.memo(Tagbar);
16323
16391
  * @Author: binruan@chatlabs.com
16324
16392
  * @Date: 2024-01-15 19:03:09
16325
16393
  * @LastEditors: binruan@chatlabs.com
16326
- * @LastEditTime: 2024-10-17 17:16:42
16394
+ * @LastEditTime: 2024-10-23 18:06:34
16327
16395
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
16328
16396
  *
16329
16397
  */
@@ -16353,9 +16421,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16353
16421
  if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
16354
16422
  const now = new Date();
16355
16423
  viewTime.current = now;
16356
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16357
- eventName: 'PageView'
16358
- });
16359
16424
  }
16360
16425
  }, [data === null || data === void 0 ? void 0 : data.length]);
16361
16426
  const handleH5EnterLink = React.useCallback(() => {
@@ -16364,11 +16429,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16364
16429
  if (data.length > 0) {
16365
16430
  const now = new Date();
16366
16431
  viewTime.current = now;
16367
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16368
- eventName: 'PageView'
16369
- });
16370
16432
  }
16371
- }, [data.length, bffFbReport, h5EnterLink]);
16433
+ }, [data.length, h5EnterLink]);
16372
16434
  React.useEffect(() => {
16373
16435
  var _a;
16374
16436
  if (!ctaType || (ctaType === null || ctaType === void 0 ? void 0 : ctaType.length) < 1)
@@ -16537,7 +16599,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16537
16599
  const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
16538
16600
  const Component = withBindDataSource(t);
16539
16601
  const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
16540
- return (React.createElement(Component, Object.assign({ key: `${index}${idx}`, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }), index: index })));
16602
+ return (React.createElement(Component, Object.assign({ key: `${index}${idx}`, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }), index: index, isActive: activeIndex === index })));
16541
16603
  });
16542
16604
  }
16543
16605
  return null;
@@ -16673,7 +16735,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16673
16735
  }
16674
16736
  };
16675
16737
  const handleScrollEvent = (swiper) => {
16676
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
16738
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
16677
16739
  const item = data[swiper.previousIndex];
16678
16740
  if (!item)
16679
16741
  return;
@@ -16717,12 +16779,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16717
16779
  }
16718
16780
  // 商品浏览事件
16719
16781
  handleReportProductView(item);
16720
- const curItem = data[swiper.activeIndex];
16721
- if (!((_r = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _r === void 0 ? void 0 : _r.url) && !((_s = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _s === void 0 ? void 0 : _s.imgUrls) && (curItem === null || curItem === void 0 ? void 0 : curItem.product)) {
16722
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16723
- eventName: 'ProductView'
16724
- });
16725
- }
16726
16782
  viewTime.current = new Date();
16727
16783
  };
16728
16784
  const handleReportProductView = (item) => {
@@ -16741,7 +16797,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16741
16797
  }
16742
16798
  }, [openHashtag, data, activeIndex]);
16743
16799
  const handleViewImageStartEvent = (activeIndex) => {
16744
- var _a, _b, _c, _d, _e, _f;
16800
+ var _a, _b, _c, _d, _e, _f, _g, _h;
16745
16801
  const item = data[activeIndex];
16746
16802
  // 如果是图片集则上报事件
16747
16803
  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)) {
@@ -16761,7 +16817,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16761
16817
  }
16762
16818
  });
16763
16819
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16764
- eventName: 'ViewContent'
16820
+ eventName: 'ViewContent',
16821
+ product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
16822
+ });
16823
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16824
+ eventName: 'PageView',
16825
+ product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
16765
16826
  });
16766
16827
  }
16767
16828
  };
@@ -17235,7 +17296,7 @@ var index$1 = React.memo(DiyPortalPreview);
17235
17296
  * @Author: binruan@chatlabs.com
17236
17297
  * @Date: 2023-10-31 10:56:01
17237
17298
  * @LastEditors: binruan@chatlabs.com
17238
- * @LastEditTime: 2024-08-23 10:28:15
17299
+ * @LastEditTime: 2024-10-23 15:07:29
17239
17300
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
17240
17301
  *
17241
17302
  */