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.js CHANGED
@@ -797,23 +797,65 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
797
797
  type: 'beacon'
798
798
  });
799
799
  }, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
800
- const bffFbReport = useCallback((_a) => {
801
- var _b, _c, _d;
802
- 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;
800
+ const bffFbReport = useCallback(({ eventName, product }) => {
801
+ var _a, _b, _c, _d;
803
802
  if (!enableReportEvent || !enabledMetaConversionApi || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
804
803
  return;
805
804
  }
806
- const fakeUserId = storeAndLoadFeUserId();
805
+ let jsonParams = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName];
807
806
  const urlParams = new URLSearchParams(window.location.search);
808
- const fbclid = urlParams.get('fbclid');
807
+ const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
808
+ const fix_par = {
809
+ event_source_url: (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href,
810
+ external_id: storeAndLoadFeUserId(),
811
+ 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 : '',
812
+ fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
813
+ fbp: getCookie('_fbp') ? `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` : '',
814
+ time: new Date().getTime()
815
+ };
816
+ const regex = /\{\{(.*?)\}\}/g;
817
+ const getEventParams = (obj) => {
818
+ if (!obj)
819
+ return;
820
+ if (obj instanceof Array) {
821
+ obj === null || obj === void 0 ? void 0 : obj.map((item) => getEventParams(item));
822
+ }
823
+ else {
824
+ for (const key in obj) {
825
+ if (obj.hasOwnProperty(key)) {
826
+ const value = obj === null || obj === void 0 ? void 0 : obj[key];
827
+ if (typeof value === 'object') {
828
+ getEventParams(value);
829
+ }
830
+ else if (typeof value === 'string') {
831
+ const matches = value === null || value === void 0 ? void 0 : value.match(regex);
832
+ if (matches) {
833
+ matches.forEach((match) => {
834
+ const prop = match.substring(2, match.length - 2);
835
+ try {
836
+ const replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
837
+ if (replaceValue) {
838
+ obj[key] = replaceValue;
839
+ }
840
+ else {
841
+ delete obj[key];
842
+ }
843
+ }
844
+ catch (error) {
845
+ delete obj[key];
846
+ console.error('An error occurred:', error === null || error === void 0 ? void 0 : error.message);
847
+ }
848
+ });
849
+ }
850
+ }
851
+ }
852
+ }
853
+ }
854
+ };
855
+ getEventParams(jsonParams);
809
856
  return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/fb/events', {
810
857
  method: 'POST',
811
- body: {
812
- eventName,
813
- actionSource,
814
- eventSourceUrl,
815
- 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 : '' })
816
- },
858
+ body: jsonParams,
817
859
  type: 'beacon'
818
860
  });
819
861
  }, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
@@ -8912,7 +8954,7 @@ SwiperSlide.displayName = 'SwiperSlide';
8912
8954
  * @Author: binruan@chatlabs.com
8913
8955
  * @Date: 2023-11-02 18:34:34
8914
8956
  * @LastEditors: binruan@chatlabs.com
8915
- * @LastEditTime: 2024-10-11 18:18:41
8957
+ * @LastEditTime: 2024-10-23 16:44:34
8916
8958
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
8917
8959
  *
8918
8960
  */
@@ -8929,7 +8971,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
8929
8971
  const [isShow, setIsShow] = useState(false);
8930
8972
  const modalEleRef = useRef(null);
8931
8973
  const { globalConfig, popupDetailData } = useSxpDataSource();
8932
- const { schema: _schema } = useEditor();
8974
+ const { schema: _schema, popup: _popup } = useEditor();
8933
8975
  const [scrollTop, setScrollTop] = useState(15);
8934
8976
  useEffect(() => {
8935
8977
  const parentNode = document.getElementById('sxp-render');
@@ -8967,6 +9009,9 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
8967
9009
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
8968
9010
  }
8969
9011
  }, [isOpen, popup]);
9012
+ const child = useCallback(() => {
9013
+ return children;
9014
+ }, [_popup]);
8970
9015
  if (!modalEleRef.current)
8971
9016
  return null;
8972
9017
  const handleClose = debounce(() => {
@@ -9052,7 +9097,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
9052
9097
  var _a;
9053
9098
  setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
9054
9099
  }
9055
- })), children)))))), modalEleRef.current);
9100
+ })), child())))))), modalEleRef.current);
9056
9101
  };
9057
9102
  var Modal$1 = memo(Modal);
9058
9103
 
@@ -9310,7 +9355,7 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
9310
9355
 
9311
9356
  const CommodityDetail$1 = (_a) => {
9312
9357
  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;
9313
- 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"]);
9358
+ 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"]);
9314
9359
  const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
9315
9360
  const { jumpToWeb, productView } = useEventReport();
9316
9361
  const curTimeRef = useRef(null);
@@ -9340,12 +9385,17 @@ const CommodityDetail$1 = (_a) => {
9340
9385
  }
9341
9386
  };
9342
9387
  useEffect(() => {
9343
- if (!isPost) {
9344
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
9345
- eventName: 'ProductView'
9346
- });
9347
- }
9348
- }, [isPost, bffFbReport]);
9388
+ if (!isActive)
9389
+ return;
9390
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
9391
+ eventName: 'ProductView',
9392
+ product
9393
+ });
9394
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
9395
+ eventName: 'PageView',
9396
+ product
9397
+ });
9398
+ }, [isActive, bffFbReport]);
9349
9399
  useEffect(() => {
9350
9400
  const initTime = () => {
9351
9401
  curTimeRef.current = new Date();
@@ -10187,7 +10237,7 @@ var settingRender$7 = [
10187
10237
 
10188
10238
  const CommodityDetailDiroNew$1 = (_a) => {
10189
10239
  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;
10190
- 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"]);
10240
+ 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"]);
10191
10241
  useState(true);
10192
10242
  const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
10193
10243
  const { jumpToWeb, productView } = useEventReport();
@@ -10221,14 +10271,21 @@ const CommodityDetailDiroNew$1 = (_a) => {
10221
10271
  }
10222
10272
  };
10223
10273
  useEffect(() => {
10224
- if (!isPost) {
10225
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10226
- eventName: 'ProductView'
10227
- });
10228
- }
10229
- }, [isPost, bffFbReport]);
10274
+ if (!isActive)
10275
+ return;
10276
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10277
+ eventName: 'ProductView',
10278
+ product
10279
+ });
10280
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10281
+ eventName: 'PageView',
10282
+ product
10283
+ });
10284
+ }, [isActive, bffFbReport]);
10230
10285
  useEffect(() => {
10231
10286
  const initTime = () => {
10287
+ if (!isActive)
10288
+ return;
10232
10289
  curTimeRef.current = new Date();
10233
10290
  };
10234
10291
  initTime();
@@ -10236,7 +10293,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
10236
10293
  return () => {
10237
10294
  window.removeEventListener('pageshow', initTime);
10238
10295
  };
10239
- }, []);
10296
+ }, [isActive]);
10240
10297
  const priceText = getPriceText({
10241
10298
  product,
10242
10299
  enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
@@ -10848,7 +10905,7 @@ var Img$1 = memo(Img);
10848
10905
  const CommodityList$1 = (_a) => {
10849
10906
  var _b, _c, _d;
10850
10907
  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"]);
10851
- const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent, globalConfig } = useSxpDataSource();
10908
+ const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent, globalConfig, bffFbReport } = useSxpDataSource();
10852
10909
  const { jumpToWeb } = useEventReport();
10853
10910
  const { popup } = useEditor();
10854
10911
  const recData = isPost ? rec : popupDetailData;
@@ -10878,6 +10935,11 @@ const CommodityList$1 = (_a) => {
10878
10935
  onClick === null || onClick === void 0 ? void 0 : onClick();
10879
10936
  }
10880
10937
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
10938
+ useEffect(() => {
10939
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10940
+ eventName: 'PageView'
10941
+ });
10942
+ }, []);
10881
10943
  return (React.createElement("div", { className: 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) => {
10882
10944
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
10883
10945
  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({
@@ -14395,13 +14457,13 @@ function WaterfallList(_a) {
14395
14457
  * @Author: binruan@chatlabs.com
14396
14458
  * @Date: 2024-01-10 10:58:24
14397
14459
  * @LastEditors: binruan@chatlabs.com
14398
- * @LastEditTime: 2024-10-11 13:43:22
14460
+ * @LastEditTime: 2024-10-23 16:58:01
14399
14461
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
14400
14462
  *
14401
14463
  */
14402
14464
  const WaterFall = (props) => {
14403
14465
  var _a;
14404
- const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag } = useSxpDataSource();
14466
+ const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag, bffFbReport } = useSxpDataSource();
14405
14467
  const { backMainFeed } = useEventReport();
14406
14468
  useRef(null);
14407
14469
  const modalEleRef = useRef(null);
@@ -14478,8 +14540,11 @@ const WaterFall = (props) => {
14478
14540
  useEffect(() => {
14479
14541
  if (openHashtag) {
14480
14542
  setViewTime(new Date());
14543
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
14544
+ eventName: 'PageView'
14545
+ });
14481
14546
  }
14482
- }, [openHashtag]);
14547
+ }, [openHashtag, bffFbReport]);
14483
14548
  useEffect(() => {
14484
14549
  const initTime = () => {
14485
14550
  setViewTime(new Date());
@@ -15780,17 +15845,18 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15780
15845
  };
15781
15846
  }, [isActive]);
15782
15847
  useEffect(() => {
15783
- var _a, _b;
15848
+ var _a, _b, _c, _d;
15784
15849
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
15785
15850
  return;
15786
15851
  if (isActive) {
15787
15852
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
15788
- eventName: 'ViewContent'
15853
+ eventName: 'ViewContent',
15854
+ 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
15789
15855
  });
15790
- (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
15856
+ (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
15791
15857
  }
15792
15858
  else {
15793
- (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.pause();
15859
+ (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.pause();
15794
15860
  }
15795
15861
  }, [isActive, isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
15796
15862
  /*
@@ -15812,9 +15878,11 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15812
15878
  if (!isActive)
15813
15879
  return;
15814
15880
  const onShow = () => {
15881
+ var _a, _b;
15815
15882
  handleClickVideo('start')();
15816
15883
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
15817
- eventName: 'ViewContent'
15884
+ eventName: 'ViewContent',
15885
+ 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
15818
15886
  });
15819
15887
  };
15820
15888
  const onHide = handleClickVideo('pause');
@@ -16301,7 +16369,7 @@ var Tagbar$1 = memo(Tagbar);
16301
16369
  * @Author: binruan@chatlabs.com
16302
16370
  * @Date: 2024-01-15 19:03:09
16303
16371
  * @LastEditors: binruan@chatlabs.com
16304
- * @LastEditTime: 2024-10-17 17:16:42
16372
+ * @LastEditTime: 2024-10-23 18:06:34
16305
16373
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
16306
16374
  *
16307
16375
  */
@@ -16331,9 +16399,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16331
16399
  if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
16332
16400
  const now = new Date();
16333
16401
  viewTime.current = now;
16334
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16335
- eventName: 'PageView'
16336
- });
16337
16402
  }
16338
16403
  }, [data === null || data === void 0 ? void 0 : data.length]);
16339
16404
  const handleH5EnterLink = useCallback(() => {
@@ -16342,11 +16407,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16342
16407
  if (data.length > 0) {
16343
16408
  const now = new Date();
16344
16409
  viewTime.current = now;
16345
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16346
- eventName: 'PageView'
16347
- });
16348
16410
  }
16349
- }, [data.length, bffFbReport, h5EnterLink]);
16411
+ }, [data.length, h5EnterLink]);
16350
16412
  useEffect(() => {
16351
16413
  var _a;
16352
16414
  if (!ctaType || (ctaType === null || ctaType === void 0 ? void 0 : ctaType.length) < 1)
@@ -16515,7 +16577,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16515
16577
  const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
16516
16578
  const Component = withBindDataSource(t);
16517
16579
  const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
16518
- 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 })));
16580
+ 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 })));
16519
16581
  });
16520
16582
  }
16521
16583
  return null;
@@ -16651,7 +16713,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16651
16713
  }
16652
16714
  };
16653
16715
  const handleScrollEvent = (swiper) => {
16654
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
16716
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
16655
16717
  const item = data[swiper.previousIndex];
16656
16718
  if (!item)
16657
16719
  return;
@@ -16695,12 +16757,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16695
16757
  }
16696
16758
  // 商品浏览事件
16697
16759
  handleReportProductView(item);
16698
- const curItem = data[swiper.activeIndex];
16699
- 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)) {
16700
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16701
- eventName: 'ProductView'
16702
- });
16703
- }
16704
16760
  viewTime.current = new Date();
16705
16761
  };
16706
16762
  const handleReportProductView = (item) => {
@@ -16719,7 +16775,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16719
16775
  }
16720
16776
  }, [openHashtag, data, activeIndex]);
16721
16777
  const handleViewImageStartEvent = (activeIndex) => {
16722
- var _a, _b, _c, _d, _e, _f;
16778
+ var _a, _b, _c, _d, _e, _f, _g, _h;
16723
16779
  const item = data[activeIndex];
16724
16780
  // 如果是图片集则上报事件
16725
16781
  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)) {
@@ -16739,7 +16795,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16739
16795
  }
16740
16796
  });
16741
16797
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16742
- eventName: 'ViewContent'
16798
+ eventName: 'ViewContent',
16799
+ product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
16800
+ });
16801
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16802
+ eventName: 'PageView',
16803
+ product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
16743
16804
  });
16744
16805
  }
16745
16806
  };
@@ -17213,7 +17274,7 @@ var index$1 = memo(DiyPortalPreview);
17213
17274
  * @Author: binruan@chatlabs.com
17214
17275
  * @Date: 2023-10-31 10:56:01
17215
17276
  * @LastEditors: binruan@chatlabs.com
17216
- * @LastEditTime: 2024-08-23 10:28:15
17277
+ * @LastEditTime: 2024-10-23 15:07:29
17217
17278
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
17218
17279
  *
17219
17280
  */