pb-sxp-ui 1.7.2 → 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 (57) hide show
  1. package/dist/index.cjs +107 -48
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +107 -48
  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 +107 -48
  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/PictureGroup/Picture.d.ts +1 -1
  14. package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +4 -1
  15. package/es/core/components/SxpPageRender/PictureGroup/index.js +24 -4
  16. package/es/core/components/SxpPageRender/RenderCard.js +6 -1
  17. package/es/core/components/SxpPageRender/VideoWidget/index.js +14 -7
  18. package/es/core/components/SxpPageRender/WaterFall/List.js +3 -2
  19. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +3 -2
  20. package/es/core/components/SxpPageRender/index.d.ts +1 -0
  21. package/es/core/components/SxpPageRender/index.js +12 -10
  22. package/es/core/utils/materials.d.ts +7 -1
  23. package/es/core/utils/materials.js +5 -2
  24. package/es/core/utils/tool.d.ts +2 -1
  25. package/es/core/utils/tool.js +11 -1
  26. package/es/materials/sxp/cta/AniLink/settingRender.d.ts +11 -0
  27. package/es/materials/sxp/cta/AniLink/settingRender.js +6 -0
  28. package/es/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +1 -1
  29. package/es/materials/sxp/cta/AniLinkPopup/settingRender.js +6 -0
  30. package/es/materials/sxp/popup/CommodityDetail/index.js +3 -2
  31. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -2
  32. package/es/materials/sxp/popup/CommodityList/index.js +5 -4
  33. package/es/materials/sxp/template/components/settingRender.d.ts +1 -1
  34. package/es/materials/sxp/template/components/settingRender.js +6 -0
  35. package/lib/core/components/SxpPageRender/PictureGroup/Picture.d.ts +1 -1
  36. package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +4 -1
  37. package/lib/core/components/SxpPageRender/PictureGroup/index.js +23 -4
  38. package/lib/core/components/SxpPageRender/RenderCard.js +6 -1
  39. package/lib/core/components/SxpPageRender/VideoWidget/index.js +13 -7
  40. package/lib/core/components/SxpPageRender/WaterFall/List.js +3 -2
  41. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +3 -2
  42. package/lib/core/components/SxpPageRender/index.d.ts +1 -0
  43. package/lib/core/components/SxpPageRender/index.js +12 -10
  44. package/lib/core/utils/materials.d.ts +7 -1
  45. package/lib/core/utils/materials.js +5 -2
  46. package/lib/core/utils/tool.d.ts +2 -1
  47. package/lib/core/utils/tool.js +12 -1
  48. package/lib/materials/sxp/cta/AniLink/settingRender.d.ts +11 -0
  49. package/lib/materials/sxp/cta/AniLink/settingRender.js +6 -0
  50. package/lib/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +1 -1
  51. package/lib/materials/sxp/cta/AniLinkPopup/settingRender.js +6 -0
  52. package/lib/materials/sxp/popup/CommodityDetail/index.js +3 -2
  53. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -2
  54. package/lib/materials/sxp/popup/CommodityList/index.js +5 -4
  55. package/lib/materials/sxp/template/components/settingRender.d.ts +1 -1
  56. package/lib/materials/sxp/template/components/settingRender.js +6 -0
  57. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -320,6 +320,16 @@ function getCookie(val) {
320
320
  });
321
321
  return value !== null && value !== void 0 ? value : '';
322
322
  }
323
+ const getResFileSizeFromSrc = (imageSrc) => {
324
+ if (!imageSrc)
325
+ return '';
326
+ return fetch(imageSrc)
327
+ .then((response) => response.blob())
328
+ .then((blob) => {
329
+ const fileSizeInMB = blob.size / (1024 * 1024); // 将文件大小转换为 MB
330
+ return fileSizeInMB.toFixed(2) + '';
331
+ });
332
+ };
323
333
 
324
334
  function unzip(b64Data) {
325
335
  const strData = atob(b64Data);
@@ -9290,7 +9300,7 @@ var CommodityGroup$1 = React.memo(CommodityGroup);
9290
9300
  * @Author: binruan@chatlabs.com
9291
9301
  * @Date: 2024-03-20 14:56:16
9292
9302
  * @LastEditors: binruan@chatlabs.com
9293
- * @LastEditTime: 2024-09-14 10:07:47
9303
+ * @LastEditTime: 2024-10-24 17:51:19
9294
9304
  * @FilePath: \pb-sxp-ui\src\core\utils\materials.ts
9295
9305
  *
9296
9306
  */
@@ -9317,8 +9327,8 @@ const getMediaValueByMode = (obj) => {
9317
9327
  return file && file.length > 0 ? (_a = file[0]) === null || _a === void 0 ? void 0 : _a.url : null;
9318
9328
  }
9319
9329
  };
9320
- const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef }) => {
9321
- var _a, _b, _c, _d, _e;
9330
+ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef, style }) => {
9331
+ var _a, _b, _c, _d, _e, _f, _g, _h;
9322
9332
  if ((!(product === null || product === void 0 ? void 0 : product.currency) || !(product === null || product === void 0 ? void 0 : product.price)) && isHiddenDef)
9323
9333
  return null;
9324
9334
  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;
@@ -9366,6 +9376,8 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
9366
9376
  }
9367
9377
  });
9368
9378
  }
9379
+ 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>`;
9380
+ text = setFontForText(text, style);
9369
9381
  if ((priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) && (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) !== 'none') {
9370
9382
  text = (priceSymbol === null || priceSymbol === void 0 ? void 0 : priceSymbol.currencyPosition) === 'left' ? currency + text : text + currency;
9371
9383
  }
@@ -9431,7 +9443,8 @@ const CommodityDetail$1 = (_a) => {
9431
9443
  const priceText = getPriceText({
9432
9444
  product: product,
9433
9445
  enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
9434
- globalConfig
9446
+ globalConfig,
9447
+ style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
9435
9448
  });
9436
9449
  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;
9437
9450
  const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
@@ -9445,7 +9458,7 @@ const CommodityDetail$1 = (_a) => {
9445
9458
  __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)
9446
9459
  } }),
9447
9460
  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: {
9448
- __html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
9461
+ __html: priceText !== null && priceText !== void 0 ? priceText : ''
9449
9462
  } }),
9450
9463
  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: {
9451
9464
  __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)
@@ -10319,7 +10332,8 @@ const CommodityDetailDiroNew$1 = (_a) => {
10319
10332
  const priceText = getPriceText({
10320
10333
  product,
10321
10334
  enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
10322
- globalConfig
10335
+ globalConfig,
10336
+ style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
10323
10337
  });
10324
10338
  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;
10325
10339
  const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
@@ -10480,7 +10494,7 @@ Made in Italy` })));
10480
10494
  } })),
10481
10495
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
10482
10496
  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: {
10483
- __html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
10497
+ __html: priceText !== null && priceText !== void 0 ? priceText : ''
10484
10498
  } }),
10485
10499
  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: {
10486
10500
  __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)
@@ -10938,7 +10952,8 @@ const CommodityList$1 = (_a) => {
10938
10952
  return getPriceText({
10939
10953
  product,
10940
10954
  enableFormattedPrice: (_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
10941
- globalConfig
10955
+ globalConfig,
10956
+ style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price
10942
10957
  });
10943
10958
  }, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
10944
10959
  const handleClick = lodash.throttle((item, multiCheckIndex) => {
@@ -10963,7 +10978,7 @@ const CommodityList$1 = (_a) => {
10963
10978
  });
10964
10979
  }, []);
10965
10980
  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) => {
10966
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
10981
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
10967
10982
  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({
10968
10983
  display: 'flex'
10969
10984
  }), onClick: () => handleClick(item, index) }),
@@ -10990,10 +11005,10 @@ const CommodityList$1 = (_a) => {
10990
11005
  }) },
10991
11006
  React.createElement("div", null,
10992
11007
  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: {
10993
- __html: setFontForText(priceText(item), commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
11008
+ __html: (_j = priceText(item)) !== null && _j !== void 0 ? _j : ''
10994
11009
  } })),
10995
11010
  React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
10996
- __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)
11011
+ __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)
10997
11012
  } })))))));
10998
11013
  })));
10999
11014
  };
@@ -11141,7 +11156,7 @@ const Iframe = createMaterial(IframeComponent, {
11141
11156
  * @Author: binruan@chatlabs.com
11142
11157
  * @Date: 2024-03-26 16:50:25
11143
11158
  * @LastEditors: binruan@chatlabs.com
11144
- * @LastEditTime: 2024-07-04 17:47:52
11159
+ * @LastEditTime: 2024-10-24 19:04:37
11145
11160
  * @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\settingRender.tsx
11146
11161
  *
11147
11162
  */
@@ -11187,6 +11202,12 @@ var settingRender$4 = [
11187
11202
  label: '背景色',
11188
11203
  name: ['style', 'backgroundColor']
11189
11204
  },
11205
+ {
11206
+ type: 'Number',
11207
+ label: '背景色毛玻璃',
11208
+ name: ['style', 'backdropFilter'],
11209
+ addonAfter: 'px'
11210
+ },
11190
11211
  {
11191
11212
  label: '内边距',
11192
11213
  type: 'Number',
@@ -13970,7 +13991,8 @@ const WaterfallFlowItem$1 = (props) => {
13970
13991
  product: rec === null || rec === void 0 ? void 0 : rec.product,
13971
13992
  enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
13972
13993
  globalConfig,
13973
- isHiddenDef: true
13994
+ isHiddenDef: true,
13995
+ style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price
13974
13996
  });
13975
13997
  React.useEffect(() => {
13976
13998
  if (imgDom.current === null || src === '') {
@@ -14012,7 +14034,7 @@ const WaterfallFlowItem$1 = (props) => {
14012
14034
  __html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
14013
14035
  } }),
14014
14036
  React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price, dangerouslySetInnerHTML: {
14015
- __html: setFontForText(priceText, textStyles === null || textStyles === void 0 ? void 0 : textStyles.price)
14037
+ __html: priceText !== null && priceText !== void 0 ? priceText : ''
14016
14038
  } }))));
14017
14039
  };
14018
14040
  function WaterfallList$1(_a) {
@@ -14287,7 +14309,8 @@ const WaterfallFlowItem = (props) => {
14287
14309
  product: rec === null || rec === void 0 ? void 0 : rec.product,
14288
14310
  enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
14289
14311
  globalConfig,
14290
- isHiddenDef: true
14312
+ isHiddenDef: true,
14313
+ style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price
14291
14314
  });
14292
14315
  // useEffect(() => {
14293
14316
  // if (imgDom.current === null || src === '') {
@@ -14374,7 +14397,7 @@ const WaterfallFlowItem = (props) => {
14374
14397
  __html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
14375
14398
  } }),
14376
14399
  React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText, dangerouslySetInnerHTML: {
14377
- __html: setFontForText(priceText, textStyles === null || textStyles === void 0 ? void 0 : textStyles.price)
14400
+ __html: priceText !== null && priceText !== void 0 ? priceText : ''
14378
14401
  } }))));
14379
14402
  };
14380
14403
  function WaterfallList(_a) {
@@ -14752,7 +14775,7 @@ const Consent = createMaterial(ConsentComponent, {
14752
14775
  * @Author: binruan@chatlabs.com
14753
14776
  * @Date: 2024-07-02 14:51:32
14754
14777
  * @LastEditors: binruan@chatlabs.com
14755
- * @LastEditTime: 2024-08-06 14:28:34
14778
+ * @LastEditTime: 2024-10-25 10:39:04
14756
14779
  * @FilePath: \pb-sxp-ui\src\materials\sxp\cta\AniLink\settingRender.tsx
14757
14780
  *
14758
14781
  */
@@ -14798,6 +14821,12 @@ var settingRender$1 = [
14798
14821
  label: '背景色',
14799
14822
  name: ['style', 'backgroundColor']
14800
14823
  },
14824
+ {
14825
+ type: 'Number',
14826
+ label: '背景色毛玻璃',
14827
+ name: ['style', 'backdropFilter'],
14828
+ addonAfter: 'px'
14829
+ },
14801
14830
  {
14802
14831
  type: 'TextMargin',
14803
14832
  name: ['style'],
@@ -15097,6 +15126,12 @@ var settingRender = [
15097
15126
  label: '背景色',
15098
15127
  name: ['style', 'backgroundColor']
15099
15128
  },
15129
+ {
15130
+ type: 'Number',
15131
+ label: '背景色毛玻璃',
15132
+ name: ['style', 'backdropFilter'],
15133
+ addonAfter: 'px'
15134
+ },
15100
15135
  {
15101
15136
  label: '外边距',
15102
15137
  type: 'Number',
@@ -15647,6 +15682,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15647
15682
  const videoId = `pb-cache-video-${index}`;
15648
15683
  const videoEleRef = React.useRef(null);
15649
15684
  const hlsRef = React.useRef(null);
15685
+ const initTimeRef = React.useRef();
15650
15686
  const blur = React.useMemo(() => {
15651
15687
  return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
15652
15688
  }, [videoPostConfig]);
@@ -15692,8 +15728,8 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15692
15728
  setWaiting(false);
15693
15729
  setIsLoadFinish(true);
15694
15730
  }, []);
15695
- const handleStartPlay = React.useCallback(() => {
15696
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
15731
+ const handleStartPlay = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
15732
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
15697
15733
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
15698
15734
  return;
15699
15735
  setIsPauseVideo(false);
@@ -15703,24 +15739,27 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15703
15739
  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);
15704
15740
  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);
15705
15741
  const playType = isFirstPlay ? '0' : '1';
15742
+ const contentSize = yield getResFileSizeFromSrc((_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.url);
15706
15743
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
15707
15744
  eventInfo: {
15708
15745
  eventSubject: 'playVideo',
15709
15746
  eventDescription: 'User played the video',
15710
- 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 : '',
15711
- 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 : '',
15747
+ 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 : '',
15748
+ 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 : '',
15712
15749
  playType,
15713
15750
  startTime: videoCurrentTime,
15714
15751
  videoDuration,
15715
- 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 : []),
15752
+ 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 : []),
15716
15753
  position: index + '',
15717
15754
  contentFormat: 'video',
15718
- traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
15755
+ traceInfo: (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.traceInfo,
15756
+ contentSize,
15757
+ loadTime: (new Date() - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current)).toFixed(2) + ''
15719
15758
  }
15720
15759
  });
15721
15760
  setIsFirstPlay(false);
15722
15761
  }
15723
- }, [bffEventReport, data, index, isFirstPlay, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
15762
+ }), [bffEventReport, data, index, isFirstPlay, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
15724
15763
  const handLoadeddata = React.useCallback(() => {
15725
15764
  var _a;
15726
15765
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
@@ -15824,6 +15863,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
15824
15863
  videoRef.current = mountVideoPlayerAtNode === null || mountVideoPlayerAtNode === void 0 ? void 0 : mountVideoPlayerAtNode(videoPlayerWrapperNode);
15825
15864
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
15826
15865
  return;
15866
+ initTimeRef.current = new Date();
15827
15867
  const Hls = window === null || window === void 0 ? void 0 : window.Hls;
15828
15868
  let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
15829
15869
  if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
@@ -16076,19 +16116,14 @@ const Picture = (props) => {
16076
16116
  }, onLoad: onShowFirstImage }))));
16077
16117
  };
16078
16118
 
16079
- /*
16080
- * @Author: lewinlu@chatlabs.com
16081
- * @Date: 2024-01-03 14:39:09
16082
- * @LastEditors: binruan@chatlabs.com
16083
- * @LastEditTime: 2024-10-10 17:53:30
16084
- * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
16085
- */
16086
16119
  const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
16087
16120
  var _a, _b;
16088
16121
  const ref = React.useRef();
16089
16122
  const { isActive } = useSwiperSlide();
16090
16123
  const { sxpParameter, openHashtag } = useSxpDataSource();
16091
16124
  const [isLoad, setIsLoad] = React.useState(false);
16125
+ const [imgInfo, setImgInfo] = React.useState();
16126
+ const initTime = new Date();
16092
16127
  React.useEffect(() => {
16093
16128
  if (isLoad && isActive) {
16094
16129
  (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.start();
@@ -16096,21 +16131,36 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageE
16096
16131
  onReportViewImageEnd(rec);
16097
16132
  }
16098
16133
  else {
16099
- onViewImageStartEvent(index);
16134
+ onViewImageStartEvent(index, imgInfo);
16100
16135
  }
16101
16136
  }
16102
16137
  else {
16103
16138
  (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.swiper.autoplay.stop();
16104
16139
  }
16105
- }, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad]);
16106
- const showFirstImageFn = React.useCallback(() => {
16140
+ }, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
16141
+ const showFirstImageFn = React.useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
16107
16142
  if (!isLoad) {
16143
+ const contentSize = yield getResFileSizeFromSrc(e.src);
16144
+ setImgInfo({
16145
+ contentSize,
16146
+ loadTime: (new Date() - initTime).toFixed(2) + ''
16147
+ });
16108
16148
  setIsLoad(true);
16109
16149
  }
16110
- }, [isLoad]);
16150
+ }), [isLoad]);
16111
16151
  // if (!isActive) {
16112
16152
  // return <img src={sxpParameter?.placeholder_image} style={{ width, height, objectFit: 'cover' }} />;
16113
16153
  // }
16154
+ React.useEffect(() => {
16155
+ const onShow = () => onViewImageStartEvent(index, imgInfo);
16156
+ const onHide = () => onReportViewImageEnd(rec);
16157
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
16158
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
16159
+ return () => {
16160
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
16161
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
16162
+ };
16163
+ }, [imgInfo]);
16114
16164
  return (React.createElement(Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
16115
16165
  clickable: true,
16116
16166
  bulletActiveClass: 'swipe-item-active-bullet',
@@ -16249,7 +16299,7 @@ function withBindDataSource(Component) {
16249
16299
  * @Author: binruan@chatlabs.com
16250
16300
  * @Date: 2023-12-26 16:11:34
16251
16301
  * @LastEditors: binruan@chatlabs.com
16252
- * @LastEditTime: 2024-10-12 16:22:10
16302
+ * @LastEditTime: 2024-10-25 10:36:59
16253
16303
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
16254
16304
  *
16255
16305
  */
@@ -16298,7 +16348,12 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }
16298
16348
  const Component = withBindDataSource(t);
16299
16349
  const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
16300
16350
  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';
16301
- 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 })));
16351
+ let style = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style;
16352
+ if (style.hasOwnProperty('backdropFilter')) {
16353
+ let sbf = style['backdropFilter'];
16354
+ style['backdropFilter'] = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
16355
+ }
16356
+ 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 })));
16302
16357
  }
16303
16358
  else {
16304
16359
  return null;
@@ -16391,7 +16446,7 @@ var Tagbar$1 = React.memo(Tagbar);
16391
16446
  * @Author: binruan@chatlabs.com
16392
16447
  * @Date: 2024-01-15 19:03:09
16393
16448
  * @LastEditors: binruan@chatlabs.com
16394
- * @LastEditTime: 2024-10-23 18:06:34
16449
+ * @LastEditTime: 2024-10-25 15:41:58
16395
16450
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
16396
16451
  *
16397
16452
  */
@@ -16461,7 +16516,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16461
16516
  // 移动端h5直接杀掉浏览器或宿主app时不会触发,pc端直接杀掉标签页时能触发
16462
16517
  if (repCond) {
16463
16518
  SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_HIDE, item);
16464
- handleReportViewImageEnd(item);
16519
+ // handleReportViewImageEnd(item);
16465
16520
  handleReportProductView(item);
16466
16521
  }
16467
16522
  let fromKName = '';
@@ -16506,7 +16561,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16506
16561
  // 页面可见时触发,注意页面初始化时不会触发
16507
16562
  handleH5EnterLink();
16508
16563
  if (repCond) {
16509
- handleViewImageStartEvent(activeIndex);
16564
+ // handleViewImageStartEvent(activeIndex);
16510
16565
  SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
16511
16566
  backMainFeed('external', selectTag);
16512
16567
  }
@@ -16735,7 +16790,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16735
16790
  }
16736
16791
  };
16737
16792
  const handleScrollEvent = (swiper) => {
16738
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
16793
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
16739
16794
  const item = data[swiper.previousIndex];
16740
16795
  if (!item)
16741
16796
  return;
@@ -16755,7 +16810,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16755
16810
  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 : '',
16756
16811
  requestId: null,
16757
16812
  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 : '',
16758
- contentFormat
16813
+ contentFormat,
16814
+ position: ((_k = swiper.previousIndex) !== null && _k !== void 0 ? _k : 0) + ''
16759
16815
  }
16760
16816
  });
16761
16817
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
@@ -16767,11 +16823,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16767
16823
  eventInfo: {
16768
16824
  eventSubject: 'scrollUp',
16769
16825
  eventDescription: 'User scroll up',
16770
- 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 : '',
16771
- productId: (_o = (_m = item.product) === null || _m === void 0 ? void 0 : _m.itemId) !== null && _o !== void 0 ? _o : '',
16826
+ 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 : '',
16827
+ productId: (_p = (_o = item.product) === null || _o === void 0 ? void 0 : _o.itemId) !== null && _p !== void 0 ? _p : '',
16772
16828
  requestId: null,
16773
- 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 : '',
16774
- contentFormat
16829
+ 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 : '',
16830
+ contentFormat,
16831
+ position: ((_s = swiper.previousIndex) !== null && _s !== void 0 ? _s : 0) + ''
16775
16832
  }
16776
16833
  });
16777
16834
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
@@ -16796,7 +16853,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16796
16853
  viewTime.current = new Date();
16797
16854
  }
16798
16855
  }, [openHashtag, data, activeIndex]);
16799
- const handleViewImageStartEvent = (activeIndex) => {
16856
+ const handleViewImageStartEvent = (activeIndex, imgInfo) => {
16800
16857
  var _a, _b, _c, _d, _e, _f, _g, _h;
16801
16858
  const item = data[activeIndex];
16802
16859
  // 如果是图片集则上报事件
@@ -16813,7 +16870,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16813
16870
  contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
16814
16871
  position: activeIndex + '',
16815
16872
  contentFormat: 'image',
16816
- traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
16873
+ traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
16874
+ contentSize: imgInfo === null || imgInfo === void 0 ? void 0 : imgInfo.contentSize,
16875
+ loadTime: imgInfo === null || imgInfo === void 0 ? void 0 : imgInfo.loadTime
16817
16876
  }
16818
16877
  });
16819
16878
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({