pb-sxp-ui 1.7.1 → 1.7.3

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 (73) hide show
  1. package/dist/index.cjs +222 -102
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +222 -102
  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 +222 -102
  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/PictureGroup/Picture.d.ts +1 -1
  15. package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +4 -1
  16. package/es/core/components/SxpPageRender/PictureGroup/index.js +24 -4
  17. package/es/core/components/SxpPageRender/RenderCard.js +6 -1
  18. package/es/core/components/SxpPageRender/VideoWidget/index.js +22 -12
  19. package/es/core/components/SxpPageRender/WaterFall/List.js +3 -2
  20. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +3 -2
  21. package/es/core/components/SxpPageRender/WaterFall/index.js +5 -2
  22. package/es/core/components/SxpPageRender/index.d.ts +2 -0
  23. package/es/core/components/SxpPageRender/index.js +20 -25
  24. package/es/core/context/SxpDataSourceProvider.d.ts +2 -4
  25. package/es/core/context/SxpDataSourceProvider.js +53 -11
  26. package/es/core/utils/materials.d.ts +7 -1
  27. package/es/core/utils/materials.js +5 -2
  28. package/es/core/utils/tool.d.ts +2 -1
  29. package/es/core/utils/tool.js +11 -1
  30. package/es/materials/sxp/cta/AniLink/settingRender.d.ts +11 -0
  31. package/es/materials/sxp/cta/AniLink/settingRender.js +6 -0
  32. package/es/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +1 -1
  33. package/es/materials/sxp/cta/AniLinkPopup/settingRender.js +6 -0
  34. package/es/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
  35. package/es/materials/sxp/popup/CommodityDetail/index.js +15 -9
  36. package/es/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
  37. package/es/materials/sxp/popup/CommodityDetailDiro/index.js +15 -8
  38. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
  39. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +18 -10
  40. package/es/materials/sxp/popup/CommodityList/index.js +12 -6
  41. package/es/materials/sxp/template/components/settingRender.d.ts +1 -1
  42. package/es/materials/sxp/template/components/settingRender.js +6 -0
  43. package/lib/core/components/SxpPageRender/Modal/index.js +5 -2
  44. package/lib/core/components/SxpPageRender/PictureGroup/Picture.d.ts +1 -1
  45. package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +4 -1
  46. package/lib/core/components/SxpPageRender/PictureGroup/index.js +23 -4
  47. package/lib/core/components/SxpPageRender/RenderCard.js +6 -1
  48. package/lib/core/components/SxpPageRender/VideoWidget/index.js +21 -12
  49. package/lib/core/components/SxpPageRender/WaterFall/List.js +3 -2
  50. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +3 -2
  51. package/lib/core/components/SxpPageRender/WaterFall/index.js +5 -2
  52. package/lib/core/components/SxpPageRender/index.d.ts +2 -0
  53. package/lib/core/components/SxpPageRender/index.js +20 -25
  54. package/lib/core/context/SxpDataSourceProvider.d.ts +2 -4
  55. package/lib/core/context/SxpDataSourceProvider.js +53 -11
  56. package/lib/core/utils/materials.d.ts +7 -1
  57. package/lib/core/utils/materials.js +5 -2
  58. package/lib/core/utils/tool.d.ts +2 -1
  59. package/lib/core/utils/tool.js +12 -1
  60. package/lib/materials/sxp/cta/AniLink/settingRender.d.ts +11 -0
  61. package/lib/materials/sxp/cta/AniLink/settingRender.js +6 -0
  62. package/lib/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +1 -1
  63. package/lib/materials/sxp/cta/AniLinkPopup/settingRender.js +6 -0
  64. package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
  65. package/lib/materials/sxp/popup/CommodityDetail/index.js +15 -9
  66. package/lib/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
  67. package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +15 -8
  68. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
  69. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +18 -10
  70. package/lib/materials/sxp/popup/CommodityList/index.js +11 -5
  71. package/lib/materials/sxp/template/components/settingRender.d.ts +1 -1
  72. package/lib/materials/sxp/template/components/settingRender.js +6 -0
  73. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -298,6 +298,16 @@ 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
+ };
301
311
 
302
312
  function unzip(b64Data) {
303
313
  const strData = atob(b64Data);
@@ -797,23 +807,65 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
797
807
  type: 'beacon'
798
808
  });
799
809
  }, [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;
810
+ const bffFbReport = useCallback(({ eventName, product }) => {
811
+ var _a, _b, _c, _d;
803
812
  if (!enableReportEvent || !enabledMetaConversionApi || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
804
813
  return;
805
814
  }
806
- const fakeUserId = storeAndLoadFeUserId();
815
+ let jsonParams = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _a === void 0 ? void 0 : _a[eventName];
807
816
  const urlParams = new URLSearchParams(window.location.search);
808
- const fbclid = urlParams.get('fbclid');
817
+ const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
818
+ 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,
820
+ 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 : '',
822
+ fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
823
+ fbp: getCookie('_fbp') ? `fb.2.${new Date().getTime()}.${getCookie('_fbp')}` : '',
824
+ time: new Date().getTime()
825
+ };
826
+ const regex = /\{\{(.*?)\}\}/g;
827
+ const getEventParams = (obj) => {
828
+ if (!obj)
829
+ return;
830
+ if (obj instanceof Array) {
831
+ obj === null || obj === void 0 ? void 0 : obj.map((item) => getEventParams(item));
832
+ }
833
+ else {
834
+ for (const key in obj) {
835
+ if (obj.hasOwnProperty(key)) {
836
+ const value = obj === null || obj === void 0 ? void 0 : obj[key];
837
+ if (typeof value === 'object') {
838
+ getEventParams(value);
839
+ }
840
+ else if (typeof value === 'string') {
841
+ const matches = value === null || value === void 0 ? void 0 : value.match(regex);
842
+ if (matches) {
843
+ matches.forEach((match) => {
844
+ const prop = match.substring(2, match.length - 2);
845
+ try {
846
+ const replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
847
+ if (replaceValue) {
848
+ obj[key] = replaceValue;
849
+ }
850
+ else {
851
+ delete obj[key];
852
+ }
853
+ }
854
+ catch (error) {
855
+ delete obj[key];
856
+ console.error('An error occurred:', error === null || error === void 0 ? void 0 : error.message);
857
+ }
858
+ });
859
+ }
860
+ }
861
+ }
862
+ }
863
+ }
864
+ };
865
+ getEventParams(jsonParams);
809
866
  return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/fb/events', {
810
867
  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
- },
868
+ body: jsonParams,
817
869
  type: 'beacon'
818
870
  });
819
871
  }, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
@@ -8912,7 +8964,7 @@ SwiperSlide.displayName = 'SwiperSlide';
8912
8964
  * @Author: binruan@chatlabs.com
8913
8965
  * @Date: 2023-11-02 18:34:34
8914
8966
  * @LastEditors: binruan@chatlabs.com
8915
- * @LastEditTime: 2024-10-11 18:18:41
8967
+ * @LastEditTime: 2024-10-23 16:44:34
8916
8968
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
8917
8969
  *
8918
8970
  */
@@ -8929,7 +8981,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
8929
8981
  const [isShow, setIsShow] = useState(false);
8930
8982
  const modalEleRef = useRef(null);
8931
8983
  const { globalConfig, popupDetailData } = useSxpDataSource();
8932
- const { schema: _schema } = useEditor();
8984
+ const { schema: _schema, popup: _popup } = useEditor();
8933
8985
  const [scrollTop, setScrollTop] = useState(15);
8934
8986
  useEffect(() => {
8935
8987
  const parentNode = document.getElementById('sxp-render');
@@ -8967,6 +9019,9 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
8967
9019
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
8968
9020
  }
8969
9021
  }, [isOpen, popup]);
9022
+ const child = useCallback(() => {
9023
+ return children;
9024
+ }, [_popup]);
8970
9025
  if (!modalEleRef.current)
8971
9026
  return null;
8972
9027
  const handleClose = debounce(() => {
@@ -9052,7 +9107,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
9052
9107
  var _a;
9053
9108
  setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
9054
9109
  }
9055
- })), children)))))), modalEleRef.current);
9110
+ })), child())))))), modalEleRef.current);
9056
9111
  };
9057
9112
  var Modal$1 = memo(Modal);
9058
9113
 
@@ -9223,7 +9278,7 @@ var CommodityGroup$1 = memo(CommodityGroup);
9223
9278
  * @Author: binruan@chatlabs.com
9224
9279
  * @Date: 2024-03-20 14:56:16
9225
9280
  * @LastEditors: binruan@chatlabs.com
9226
- * @LastEditTime: 2024-09-14 10:07:47
9281
+ * @LastEditTime: 2024-10-24 17:51:19
9227
9282
  * @FilePath: \pb-sxp-ui\src\core\utils\materials.ts
9228
9283
  *
9229
9284
  */
@@ -9250,8 +9305,8 @@ const getMediaValueByMode = (obj) => {
9250
9305
  return file && file.length > 0 ? (_a = file[0]) === null || _a === void 0 ? void 0 : _a.url : null;
9251
9306
  }
9252
9307
  };
9253
- const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef }) => {
9254
- var _a, _b, _c, _d, _e;
9308
+ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef, style }) => {
9309
+ var _a, _b, _c, _d, _e, _f, _g, _h;
9255
9310
  if ((!(product === null || product === void 0 ? void 0 : product.currency) || !(product === null || product === void 0 ? void 0 : product.price)) && isHiddenDef)
9256
9311
  return null;
9257
9312
  let price = (product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price) ? product === null || product === void 0 ? void 0 : product.price : 7000;
@@ -9299,6 +9354,8 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
9299
9354
  }
9300
9355
  });
9301
9356
  }
9357
+ currency = `<span style="font-family:${(_h = (_g = (_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.priceSymbol) === null || _f === void 0 ? void 0 : _f.fontFamily) !== null && _g !== void 0 ? _g : style === null || style === void 0 ? void 0 : style['fontFamily-en']) !== null && _h !== void 0 ? _h : 'inherit'}">${currency}</span>`;
9358
+ text = setFontForText(text, style);
9302
9359
  if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) && (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) !== 'none') {
9303
9360
  text = (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) === 'left' ? currency + text : text + currency;
9304
9361
  }
@@ -9310,7 +9367,7 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
9310
9367
 
9311
9368
  const CommodityDetail$1 = (_a) => {
9312
9369
  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"]);
9370
+ 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
9371
  const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
9315
9372
  const { jumpToWeb, productView } = useEventReport();
9316
9373
  const curTimeRef = useRef(null);
@@ -9340,12 +9397,17 @@ const CommodityDetail$1 = (_a) => {
9340
9397
  }
9341
9398
  };
9342
9399
  useEffect(() => {
9343
- if (!isPost) {
9344
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
9345
- eventName: 'ProductView'
9346
- });
9347
- }
9348
- }, [isPost, bffFbReport]);
9400
+ if (!isActive)
9401
+ return;
9402
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
9403
+ eventName: 'ProductView',
9404
+ product
9405
+ });
9406
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
9407
+ eventName: 'PageView',
9408
+ product
9409
+ });
9410
+ }, [isActive, bffFbReport]);
9349
9411
  useEffect(() => {
9350
9412
  const initTime = () => {
9351
9413
  curTimeRef.current = new Date();
@@ -9359,7 +9421,8 @@ const CommodityDetail$1 = (_a) => {
9359
9421
  const priceText = getPriceText({
9360
9422
  product: product,
9361
9423
  enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
9362
- globalConfig
9424
+ globalConfig,
9425
+ style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
9363
9426
  });
9364
9427
  const width = (isPreview ? 375 : (_u = style === null || style === void 0 ? void 0 : style.width) !== null && _u !== void 0 ? _u : window.innerWidth) - ((_v = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _v !== void 0 ? _v : 0) * 2;
9365
9428
  const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
@@ -9373,7 +9436,7 @@ const CommodityDetail$1 = (_a) => {
9373
9436
  __html: setFontForText((_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
9374
9437
  } }),
9375
9438
  React.createElement("div", { className: 'pb-commondity-content-price', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price), hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), dangerouslySetInnerHTML: {
9376
- __html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
9439
+ __html: priceText !== null && priceText !== void 0 ? priceText : ''
9377
9440
  } }),
9378
9441
  React.createElement("div", { hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
9379
9442
  __html: setFontForText((_c = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _c !== void 0 ? _c : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
@@ -10187,7 +10250,7 @@ var settingRender$7 = [
10187
10250
 
10188
10251
  const CommodityDetailDiroNew$1 = (_a) => {
10189
10252
  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"]);
10253
+ 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
10254
  useState(true);
10192
10255
  const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
10193
10256
  const { jumpToWeb, productView } = useEventReport();
@@ -10221,14 +10284,21 @@ const CommodityDetailDiroNew$1 = (_a) => {
10221
10284
  }
10222
10285
  };
10223
10286
  useEffect(() => {
10224
- if (!isPost) {
10225
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10226
- eventName: 'ProductView'
10227
- });
10228
- }
10229
- }, [isPost, bffFbReport]);
10287
+ if (!isActive)
10288
+ return;
10289
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10290
+ eventName: 'ProductView',
10291
+ product
10292
+ });
10293
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10294
+ eventName: 'PageView',
10295
+ product
10296
+ });
10297
+ }, [isActive, bffFbReport]);
10230
10298
  useEffect(() => {
10231
10299
  const initTime = () => {
10300
+ if (!isActive)
10301
+ return;
10232
10302
  curTimeRef.current = new Date();
10233
10303
  };
10234
10304
  initTime();
@@ -10236,11 +10306,12 @@ const CommodityDetailDiroNew$1 = (_a) => {
10236
10306
  return () => {
10237
10307
  window.removeEventListener('pageshow', initTime);
10238
10308
  };
10239
- }, []);
10309
+ }, [isActive]);
10240
10310
  const priceText = getPriceText({
10241
10311
  product,
10242
10312
  enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
10243
- globalConfig
10313
+ globalConfig,
10314
+ style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
10244
10315
  });
10245
10316
  const width = (isPreview ? 375 : (_u = style === null || style === void 0 ? void 0 : style.width) !== null && _u !== void 0 ? _u : window.innerWidth) - ((_v = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _v !== void 0 ? _v : 0) * 2;
10246
10317
  const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
@@ -10401,7 +10472,7 @@ Made in Italy` })));
10401
10472
  } })),
10402
10473
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
10403
10474
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price), dangerouslySetInnerHTML: {
10404
- __html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
10475
+ __html: priceText !== null && priceText !== void 0 ? priceText : ''
10405
10476
  } }),
10406
10477
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
10407
10478
  __html: setFontForText((_2 = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _2 !== void 0 ? _2 : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
@@ -10848,7 +10919,7 @@ var Img$1 = memo(Img);
10848
10919
  const CommodityList$1 = (_a) => {
10849
10920
  var _b, _c, _d;
10850
10921
  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();
10922
+ const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent, globalConfig, bffFbReport } = useSxpDataSource();
10852
10923
  const { jumpToWeb } = useEventReport();
10853
10924
  const { popup } = useEditor();
10854
10925
  const recData = isPost ? rec : popupDetailData;
@@ -10859,7 +10930,8 @@ const CommodityList$1 = (_a) => {
10859
10930
  return getPriceText({
10860
10931
  product,
10861
10932
  enableFormattedPrice: (_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
10862
- globalConfig
10933
+ globalConfig,
10934
+ style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
10863
10935
  });
10864
10936
  }, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
10865
10937
  const handleClick = throttle((item, multiCheckIndex) => {
@@ -10878,8 +10950,13 @@ const CommodityList$1 = (_a) => {
10878
10950
  onClick === null || onClick === void 0 ? void 0 : onClick();
10879
10951
  }
10880
10952
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
10953
+ useEffect(() => {
10954
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10955
+ eventName: 'PageView'
10956
+ });
10957
+ }, []);
10881
10958
  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
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
10959
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
10883
10960
  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({
10884
10961
  display: 'flex'
10885
10962
  }), onClick: () => handleClick(item, index) }),
@@ -10906,10 +10983,10 @@ const CommodityList$1 = (_a) => {
10906
10983
  }) },
10907
10984
  React.createElement("div", null,
10908
10985
  React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.price), dangerouslySetInnerHTML: {
10909
- __html: setFontForText(priceText(item), commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
10986
+ __html: (_j = priceText(item)) !== null && _j !== void 0 ? _j : ''
10910
10987
  } })),
10911
10988
  React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
10912
- __html: setFontForText((_k = (_j = item === null || item === void 0 ? void 0 : item.bindCta) === null || _j === void 0 ? void 0 : _j.enTitle) !== null && _k !== void 0 ? _k : 'Shop Now', buttonStyle)
10989
+ __html: setFontForText((_l = (_k = item === null || item === void 0 ? void 0 : item.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', buttonStyle)
10913
10990
  } })))))));
10914
10991
  })));
10915
10992
  };
@@ -11057,7 +11134,7 @@ const Iframe = createMaterial(IframeComponent, {
11057
11134
  * @Author: binruan@chatlabs.com
11058
11135
  * @Date: 2024-03-26 16:50:25
11059
11136
  * @LastEditors: binruan@chatlabs.com
11060
- * @LastEditTime: 2024-07-04 17:47:52
11137
+ * @LastEditTime: 2024-10-24 19:04:37
11061
11138
  * @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\settingRender.tsx
11062
11139
  *
11063
11140
  */
@@ -11103,6 +11180,12 @@ var settingRender$4 = [
11103
11180
  label: '背景色',
11104
11181
  name: ['style', 'backgroundColor']
11105
11182
  },
11183
+ {
11184
+ type: 'Number',
11185
+ label: '背景色毛玻璃',
11186
+ name: ['style', 'backdropFilter'],
11187
+ addonAfter: 'px'
11188
+ },
11106
11189
  {
11107
11190
  label: '内边距',
11108
11191
  type: 'Number',
@@ -13886,7 +13969,8 @@ const WaterfallFlowItem$1 = (props) => {
13886
13969
  product: rec === null || rec === void 0 ? void 0 : rec.product,
13887
13970
  enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
13888
13971
  globalConfig,
13889
- isHiddenDef: true
13972
+ isHiddenDef: true,
13973
+ style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price
13890
13974
  });
13891
13975
  useEffect(() => {
13892
13976
  if (imgDom.current === null || src === '') {
@@ -13928,7 +14012,7 @@ const WaterfallFlowItem$1 = (props) => {
13928
14012
  __html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
13929
14013
  } }),
13930
14014
  React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price, dangerouslySetInnerHTML: {
13931
- __html: setFontForText(priceText, textStyles === null || textStyles === void 0 ? void 0 : textStyles.price)
14015
+ __html: priceText !== null && priceText !== void 0 ? priceText : ''
13932
14016
  } }))));
13933
14017
  };
13934
14018
  function WaterfallList$1(_a) {
@@ -14203,7 +14287,8 @@ const WaterfallFlowItem = (props) => {
14203
14287
  product: rec === null || rec === void 0 ? void 0 : rec.product,
14204
14288
  enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
14205
14289
  globalConfig,
14206
- isHiddenDef: true
14290
+ isHiddenDef: true,
14291
+ style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price
14207
14292
  });
14208
14293
  // useEffect(() => {
14209
14294
  // if (imgDom.current === null || src === '') {
@@ -14290,7 +14375,7 @@ const WaterfallFlowItem = (props) => {
14290
14375
  __html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
14291
14376
  } }),
14292
14377
  React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText, dangerouslySetInnerHTML: {
14293
- __html: setFontForText(priceText, textStyles === null || textStyles === void 0 ? void 0 : textStyles.price)
14378
+ __html: priceText !== null && priceText !== void 0 ? priceText : ''
14294
14379
  } }))));
14295
14380
  };
14296
14381
  function WaterfallList(_a) {
@@ -14395,13 +14480,13 @@ function WaterfallList(_a) {
14395
14480
  * @Author: binruan@chatlabs.com
14396
14481
  * @Date: 2024-01-10 10:58:24
14397
14482
  * @LastEditors: binruan@chatlabs.com
14398
- * @LastEditTime: 2024-10-11 13:43:22
14483
+ * @LastEditTime: 2024-10-23 16:58:01
14399
14484
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
14400
14485
  *
14401
14486
  */
14402
14487
  const WaterFall = (props) => {
14403
14488
  var _a;
14404
- const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag } = useSxpDataSource();
14489
+ const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag, bffFbReport } = useSxpDataSource();
14405
14490
  const { backMainFeed } = useEventReport();
14406
14491
  useRef(null);
14407
14492
  const modalEleRef = useRef(null);
@@ -14478,8 +14563,11 @@ const WaterFall = (props) => {
14478
14563
  useEffect(() => {
14479
14564
  if (openHashtag) {
14480
14565
  setViewTime(new Date());
14566
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
14567
+ eventName: 'PageView'
14568
+ });
14481
14569
  }
14482
- }, [openHashtag]);
14570
+ }, [openHashtag, bffFbReport]);
14483
14571
  useEffect(() => {
14484
14572
  const initTime = () => {
14485
14573
  setViewTime(new Date());
@@ -14665,7 +14753,7 @@ const Consent = createMaterial(ConsentComponent, {
14665
14753
  * @Author: binruan@chatlabs.com
14666
14754
  * @Date: 2024-07-02 14:51:32
14667
14755
  * @LastEditors: binruan@chatlabs.com
14668
- * @LastEditTime: 2024-08-06 14:28:34
14756
+ * @LastEditTime: 2024-10-25 10:39:04
14669
14757
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\settingRender.tsx
14670
14758
  *
14671
14759
  */
@@ -14711,6 +14799,12 @@ var settingRender$1 = [
14711
14799
  label: '背景色',
14712
14800
  name: ['style', 'backgroundColor']
14713
14801
  },
14802
+ {
14803
+ type: 'Number',
14804
+ label: '背景色毛玻璃',
14805
+ name: ['style', 'backdropFilter'],
14806
+ addonAfter: 'px'
14807
+ },
14714
14808
  {
14715
14809
  type: 'TextMargin',
14716
14810
  name: ['style'],
@@ -15010,6 +15104,12 @@ var settingRender = [
15010
15104
  label: '背景色',
15011
15105
  name: ['style', 'backgroundColor']
15012
15106
  },
15107
+ {
15108
+ type: 'Number',
15109
+ label: '背景色毛玻璃',
15110
+ name: ['style', 'backdropFilter'],
15111
+ addonAfter: 'px'
15112
+ },
15013
15113
  {
15014
15114
  label: '外边距',
15015
15115
  type: 'Number',
@@ -15560,6 +15660,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15560
15660
  const videoId = `pb-cache-video-${index}`;
15561
15661
  const videoEleRef = useRef(null);
15562
15662
  const hlsRef = useRef(null);
15663
+ const initTimeRef = useRef();
15563
15664
  const blur = useMemo(() => {
15564
15665
  return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
15565
15666
  }, [videoPostConfig]);
@@ -15605,8 +15706,8 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15605
15706
  setWaiting(false);
15606
15707
  setIsLoadFinish(true);
15607
15708
  }, []);
15608
- const handleStartPlay = useCallback(() => {
15609
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
15709
+ 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;
15610
15711
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
15611
15712
  return;
15612
15713
  setIsPauseVideo(false);
@@ -15616,24 +15717,27 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15616
15717
  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);
15617
15718
  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);
15618
15719
  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);
15619
15721
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
15620
15722
  eventInfo: {
15621
15723
  eventSubject: 'playVideo',
15622
15724
  eventDescription: 'User played the video',
15623
- 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 : '',
15624
- 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 : '',
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 : '',
15625
15727
  playType,
15626
15728
  startTime: videoCurrentTime,
15627
15729
  videoDuration,
15628
- 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 : []),
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 : []),
15629
15731
  position: index + '',
15630
15732
  contentFormat: 'video',
15631
- traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
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) + ''
15632
15736
  }
15633
15737
  });
15634
15738
  setIsFirstPlay(false);
15635
15739
  }
15636
- }, [bffEventReport, data, index, isFirstPlay, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
15740
+ }), [bffEventReport, data, index, isFirstPlay, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
15637
15741
  const handLoadeddata = useCallback(() => {
15638
15742
  var _a;
15639
15743
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
@@ -15737,6 +15841,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15737
15841
  videoRef.current = mountVideoPlayerAtNode === null || mountVideoPlayerAtNode === void 0 ? void 0 : mountVideoPlayerAtNode(videoPlayerWrapperNode);
15738
15842
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
15739
15843
  return;
15844
+ initTimeRef.current = new Date();
15740
15845
  const Hls = window === null || window === void 0 ? void 0 : window.Hls;
15741
15846
  let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
15742
15847
  if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
@@ -15780,17 +15885,18 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15780
15885
  };
15781
15886
  }, [isActive]);
15782
15887
  useEffect(() => {
15783
- var _a, _b;
15888
+ var _a, _b, _c, _d;
15784
15889
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
15785
15890
  return;
15786
15891
  if (isActive) {
15787
15892
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
15788
- eventName: 'ViewContent'
15893
+ eventName: 'ViewContent',
15894
+ 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
15895
  });
15790
- (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
15896
+ (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
15791
15897
  }
15792
15898
  else {
15793
- (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.pause();
15899
+ (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.pause();
15794
15900
  }
15795
15901
  }, [isActive, isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
15796
15902
  /*
@@ -15812,9 +15918,11 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15812
15918
  if (!isActive)
15813
15919
  return;
15814
15920
  const onShow = () => {
15921
+ var _a, _b;
15815
15922
  handleClickVideo('start')();
15816
15923
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
15817
- eventName: 'ViewContent'
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
15818
15926
  });
15819
15927
  };
15820
15928
  const onHide = handleClickVideo('pause');
@@ -15986,19 +16094,14 @@ const Picture = (props) => {
15986
16094
  }, onLoad: onShowFirstImage }))));
15987
16095
  };
15988
16096
 
15989
- /*
15990
- * @Author: lewinlu@chatlabs.com
15991
- * @Date: 2024-01-03 14:39:09
15992
- * @LastEditors: binruan@chatlabs.com
15993
- * @LastEditTime: 2024-10-10 17:53:30
15994
- * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
15995
- */
15996
16097
  const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
15997
16098
  var _a, _b;
15998
16099
  const ref = useRef();
15999
16100
  const { isActive } = useSwiperSlide();
16000
16101
  const { sxpParameter, openHashtag } = useSxpDataSource();
16001
16102
  const [isLoad, setIsLoad] = useState(false);
16103
+ const [imgInfo, setImgInfo] = useState();
16104
+ const initTime = new Date();
16002
16105
  useEffect(() => {
16003
16106
  if (isLoad && isActive) {
16004
16107
  (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.start();
@@ -16006,21 +16109,36 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageE
16006
16109
  onReportViewImageEnd(rec);
16007
16110
  }
16008
16111
  else {
16009
- onViewImageStartEvent(index);
16112
+ onViewImageStartEvent(index, imgInfo);
16010
16113
  }
16011
16114
  }
16012
16115
  else {
16013
16116
  (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.stop();
16014
16117
  }
16015
- }, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad]);
16016
- const showFirstImageFn = useCallback(() => {
16118
+ }, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
16119
+ const showFirstImageFn = useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
16017
16120
  if (!isLoad) {
16121
+ const contentSize = yield getResFileSizeFromSrc(e.src);
16122
+ setImgInfo({
16123
+ contentSize,
16124
+ loadTime: (new Date() - initTime).toFixed(2) + ''
16125
+ });
16018
16126
  setIsLoad(true);
16019
16127
  }
16020
- }, [isLoad]);
16128
+ }), [isLoad]);
16021
16129
  // if (!isActive) {
16022
16130
  // return <img src={sxpParameter?.placeholder_image} style={{ width, height, objectFit: 'cover' }} />;
16023
16131
  // }
16132
+ useEffect(() => {
16133
+ const onShow = () => onViewImageStartEvent(index, imgInfo);
16134
+ const onHide = () => onReportViewImageEnd(rec);
16135
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
16136
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
16137
+ return () => {
16138
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
16139
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
16140
+ };
16141
+ }, [imgInfo]);
16024
16142
  return (React.createElement(Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
16025
16143
  clickable: true,
16026
16144
  bulletActiveClass: 'swipe-item-active-bullet',
@@ -16159,7 +16277,7 @@ function withBindDataSource(Component) {
16159
16277
  * @Author: binruan@chatlabs.com
16160
16278
  * @Date: 2023-12-26 16:11:34
16161
16279
  * @LastEditors: binruan@chatlabs.com
16162
- * @LastEditTime: 2024-10-12 16:22:10
16280
+ * @LastEditTime: 2024-10-25 10:36:59
16163
16281
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
16164
16282
  *
16165
16283
  */
@@ -16208,7 +16326,12 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }
16208
16326
  const Component = withBindDataSource(t);
16209
16327
  const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
16210
16328
  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';
16211
- return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_4 = value === null || value === void 0 ? void 0 : value.item) === null || _4 === void 0 ? void 0 : _4.textStyle), bindDatas: (_6 = (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.bindDatas) !== null && _6 !== void 0 ? _6 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_7 = value === null || value === void 0 ? void 0 : value.item) === null || _7 === void 0 ? void 0 : _7.props, { event: ((_8 = value === null || value === void 0 ? void 0 : value.item) === null || _8 === void 0 ? void 0 : _8.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index, isActive: isActive })));
16329
+ let style = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style;
16330
+ if (style.hasOwnProperty('backdropFilter')) {
16331
+ let sbf = style['backdropFilter'];
16332
+ style['backdropFilter'] = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
16333
+ }
16334
+ return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_4 = value === null || value === void 0 ? void 0 : value.item) === null || _4 === void 0 ? void 0 : _4.textStyle), bindDatas: (_6 = (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.bindDatas) !== null && _6 !== void 0 ? _6 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_7 = value === null || value === void 0 ? void 0 : value.item) === null || _7 === void 0 ? void 0 : _7.props, { event: ((_8 = value === null || value === void 0 ? void 0 : value.item) === null || _8 === void 0 ? void 0 : _8.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index, isActive: isActive })));
16212
16335
  }
16213
16336
  else {
16214
16337
  return null;
@@ -16301,7 +16424,7 @@ var Tagbar$1 = memo(Tagbar);
16301
16424
  * @Author: binruan@chatlabs.com
16302
16425
  * @Date: 2024-01-15 19:03:09
16303
16426
  * @LastEditors: binruan@chatlabs.com
16304
- * @LastEditTime: 2024-10-17 17:16:42
16427
+ * @LastEditTime: 2024-10-25 15:41:58
16305
16428
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
16306
16429
  *
16307
16430
  */
@@ -16331,9 +16454,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16331
16454
  if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
16332
16455
  const now = new Date();
16333
16456
  viewTime.current = now;
16334
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16335
- eventName: 'PageView'
16336
- });
16337
16457
  }
16338
16458
  }, [data === null || data === void 0 ? void 0 : data.length]);
16339
16459
  const handleH5EnterLink = useCallback(() => {
@@ -16342,11 +16462,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16342
16462
  if (data.length > 0) {
16343
16463
  const now = new Date();
16344
16464
  viewTime.current = now;
16345
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16346
- eventName: 'PageView'
16347
- });
16348
16465
  }
16349
- }, [data.length, bffFbReport, h5EnterLink]);
16466
+ }, [data.length, h5EnterLink]);
16350
16467
  useEffect(() => {
16351
16468
  var _a;
16352
16469
  if (!ctaType || (ctaType === null || ctaType === void 0 ? void 0 : ctaType.length) < 1)
@@ -16377,7 +16494,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16377
16494
  // 移动端h5直接杀掉浏览器或宿主app时不会触发,pc端直接杀掉标签页时能触发
16378
16495
  if (repCond) {
16379
16496
  SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_HIDE, item);
16380
- handleReportViewImageEnd(item);
16497
+ // handleReportViewImageEnd(item);
16381
16498
  handleReportProductView(item);
16382
16499
  }
16383
16500
  let fromKName = '';
@@ -16422,7 +16539,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16422
16539
  // 页面可见时触发,注意页面初始化时不会触发
16423
16540
  handleH5EnterLink();
16424
16541
  if (repCond) {
16425
- handleViewImageStartEvent(activeIndex);
16542
+ // handleViewImageStartEvent(activeIndex);
16426
16543
  SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
16427
16544
  backMainFeed('external', selectTag);
16428
16545
  }
@@ -16515,7 +16632,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16515
16632
  const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
16516
16633
  const Component = withBindDataSource(t);
16517
16634
  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 })));
16635
+ 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
16636
  });
16520
16637
  }
16521
16638
  return null;
@@ -16671,7 +16788,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16671
16788
  productId: (_g = (_f = item === null || item === void 0 ? void 0 : item.product) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
16672
16789
  requestId: null,
16673
16790
  traceInfo: (_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.traceInfo) !== null && _j !== void 0 ? _j : '',
16674
- contentFormat
16791
+ contentFormat,
16792
+ position: ((_k = swiper.previousIndex) !== null && _k !== void 0 ? _k : 0) + ''
16675
16793
  }
16676
16794
  });
16677
16795
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
@@ -16683,11 +16801,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16683
16801
  eventInfo: {
16684
16802
  eventSubject: 'scrollUp',
16685
16803
  eventDescription: 'User scroll up',
16686
- contentId: (_l = (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '',
16687
- productId: (_o = (_m = item.product) === null || _m === void 0 ? void 0 : _m.itemId) !== null && _o !== void 0 ? _o : '',
16804
+ contentId: (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
16805
+ productId: (_p = (_o = item.product) === null || _o === void 0 ? void 0 : _o.itemId) !== null && _p !== void 0 ? _p : '',
16688
16806
  requestId: null,
16689
- traceInfo: (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.traceInfo) !== null && _q !== void 0 ? _q : '',
16690
- contentFormat
16807
+ traceInfo: (_r = (_q = item === null || item === void 0 ? void 0 : item.video) === null || _q === void 0 ? void 0 : _q.traceInfo) !== null && _r !== void 0 ? _r : '',
16808
+ contentFormat,
16809
+ position: ((_s = swiper.previousIndex) !== null && _s !== void 0 ? _s : 0) + ''
16691
16810
  }
16692
16811
  });
16693
16812
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
@@ -16695,12 +16814,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16695
16814
  }
16696
16815
  // 商品浏览事件
16697
16816
  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
16817
  viewTime.current = new Date();
16705
16818
  };
16706
16819
  const handleReportProductView = (item) => {
@@ -16718,8 +16831,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16718
16831
  viewTime.current = new Date();
16719
16832
  }
16720
16833
  }, [openHashtag, data, activeIndex]);
16721
- const handleViewImageStartEvent = (activeIndex) => {
16722
- var _a, _b, _c, _d, _e, _f;
16834
+ const handleViewImageStartEvent = (activeIndex, imgInfo) => {
16835
+ var _a, _b, _c, _d, _e, _f, _g, _h;
16723
16836
  const item = data[activeIndex];
16724
16837
  // 如果是图片集则上报事件
16725
16838
  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)) {
@@ -16735,11 +16848,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16735
16848
  contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
16736
16849
  position: activeIndex + '',
16737
16850
  contentFormat: 'image',
16738
- traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
16851
+ traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
16852
+ contentSize: imgInfo === null || imgInfo === void 0 ? void 0 : imgInfo.contentSize,
16853
+ loadTime: imgInfo === null || imgInfo === void 0 ? void 0 : imgInfo.loadTime
16739
16854
  }
16740
16855
  });
16741
16856
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16742
- eventName: 'ViewContent'
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
16743
16863
  });
16744
16864
  }
16745
16865
  };
@@ -17213,7 +17333,7 @@ var index$1 = memo(DiyPortalPreview);
17213
17333
  * @Author: binruan@chatlabs.com
17214
17334
  * @Date: 2023-10-31 10:56:01
17215
17335
  * @LastEditors: binruan@chatlabs.com
17216
- * @LastEditTime: 2024-08-23 10:28:15
17336
+ * @LastEditTime: 2024-10-23 15:07:29
17217
17337
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
17218
17338
  *
17219
17339
  */