pb-sxp-ui 1.0.86 → 1.0.88

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 (61) hide show
  1. package/dist/index.cjs +113 -166
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +113 -166
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.cjs +3 -4
  6. package/dist/index.min.cjs.map +1 -1
  7. package/dist/index.min.js +3 -4
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/pb-ui.js +113 -166
  10. package/dist/pb-ui.js.map +1 -1
  11. package/dist/pb-ui.min.js +3 -4
  12. package/dist/pb-ui.min.js.map +1 -1
  13. package/es/core/components/Consent/index.js +2 -2
  14. package/es/core/components/DiyPortalPreview/VideoWidget.js +3 -3
  15. package/es/core/components/SxpPageRender/FingerSwipeTip/index.js +1 -1
  16. package/es/core/components/SxpPageRender/FormatImage.js +2 -2
  17. package/es/core/components/SxpPageRender/LikeButton/index.js +1 -1
  18. package/es/core/components/SxpPageRender/Navbar.js +1 -1
  19. package/es/core/components/SxpPageRender/Nudge/index.js +1 -1
  20. package/es/core/components/SxpPageRender/Tagbar.js +6 -7
  21. package/es/core/components/SxpPageRender/ToggleButton/index.js +2 -2
  22. package/es/core/components/SxpPageRender/VideoWidget/index.js +3 -3
  23. package/es/core/components/SxpPageRender/WaterFall/List.js +2 -2
  24. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +17 -52
  25. package/es/core/components/SxpPageRender/WaterFall/index.js +2 -4
  26. package/es/core/components/SxpPageRender/index.js +28 -30
  27. package/es/core/context/SxpDataSourceProvider.d.ts +4 -0
  28. package/es/core/context/SxpDataSourceProvider.js +9 -3
  29. package/es/core/hooks/useEventReport.d.ts +1 -1
  30. package/es/core/hooks/useEventReport.js +13 -10
  31. package/es/materials/sxp/popup/AppointForm/index.js +1 -1
  32. package/es/materials/sxp/popup/CommodityDetail/index.js +3 -3
  33. package/es/materials/sxp/popup/CommodityDetailDiro/index.js +4 -4
  34. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -3
  35. package/es/materials/sxp/popup/Prompt/index.js +2 -2
  36. package/es/materials/sxp/template/Appoint/index.js +1 -1
  37. package/lib/core/components/Consent/index.js +2 -2
  38. package/lib/core/components/DiyPortalPreview/VideoWidget.js +3 -3
  39. package/lib/core/components/SxpPageRender/FingerSwipeTip/index.js +1 -1
  40. package/lib/core/components/SxpPageRender/FormatImage.js +2 -2
  41. package/lib/core/components/SxpPageRender/LikeButton/index.js +1 -1
  42. package/lib/core/components/SxpPageRender/Navbar.js +1 -1
  43. package/lib/core/components/SxpPageRender/Nudge/index.js +1 -1
  44. package/lib/core/components/SxpPageRender/Tagbar.js +7 -8
  45. package/lib/core/components/SxpPageRender/ToggleButton/index.js +2 -2
  46. package/lib/core/components/SxpPageRender/VideoWidget/index.js +3 -3
  47. package/lib/core/components/SxpPageRender/WaterFall/List.js +2 -2
  48. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +17 -52
  49. package/lib/core/components/SxpPageRender/WaterFall/index.js +2 -4
  50. package/lib/core/components/SxpPageRender/index.js +28 -30
  51. package/lib/core/context/SxpDataSourceProvider.d.ts +4 -0
  52. package/lib/core/context/SxpDataSourceProvider.js +10 -4
  53. package/lib/core/hooks/useEventReport.d.ts +1 -1
  54. package/lib/core/hooks/useEventReport.js +13 -10
  55. package/lib/materials/sxp/popup/AppointForm/index.js +1 -1
  56. package/lib/materials/sxp/popup/CommodityDetail/index.js +3 -3
  57. package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +4 -4
  58. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -3
  59. package/lib/materials/sxp/popup/Prompt/index.js +2 -2
  60. package/lib/materials/sxp/template/Appoint/index.js +1 -1
  61. package/package.json +1 -1
package/dist/pb-ui.js CHANGED
@@ -434,7 +434,7 @@
434
434
  * @Author: binruan@chatlabs.com
435
435
  * @Date: 2024-06-13 15:16:53
436
436
  * @LastEditors: binruan@chatlabs.com
437
- * @LastEditTime: 2024-06-18 16:06:16
437
+ * @LastEditTime: 2024-06-19 14:13:50
438
438
  * @FilePath: \pb-sxp-ui\src\core\components\Consent\index.tsx
439
439
  *
440
440
  */
@@ -489,8 +489,8 @@
489
489
  React.createElement("div", { className: 'consent-title' }, privacy_title !== null && privacy_title !== void 0 ? privacy_title : 'Privacy Policy'),
490
490
  React.createElement("div", { className: 'consent-content' }, privacy_context !== null && privacy_context !== void 0 ? privacy_context : 'This site uses cookies to improve your online experience. By continuing to use the site please agree the policy first.')),
491
491
  React.createElement("div", { className: 'consent-col' },
492
- React.createElement("button", { className: 'consent-btn', onClick: handleAgree }, "Agree"),
493
- React.createElement("a", { className: 'consent-policy', target: '_blank', href: privacy_policy_url }, privacy_policy_title !== null && privacy_policy_title !== void 0 ? privacy_policy_title : 'More information')))));
492
+ React.createElement("button", { "aria-label": 'agree', className: 'consent-btn', onClick: handleAgree }, "Agree"),
493
+ React.createElement("a", { className: 'consent-policy', target: '_blank', href: privacy_policy_url ? `https://${privacy_policy_url}` : undefined }, privacy_policy_title !== null && privacy_policy_title !== void 0 ? privacy_policy_title : 'More information')))));
494
494
  };
495
495
  var Consent$3 = React.memo(Consent$2);
496
496
 
@@ -503,6 +503,7 @@
503
503
  DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
504
504
  })(DataSourceType || (DataSourceType = {}));
505
505
  const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
506
+ const DEFAULT_TAG = 'FOR U';
506
507
  const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false }) => {
507
508
  var _a, _b, _c;
508
509
  const [rtcList, setRtcList] = React.useState([]);
@@ -522,6 +523,7 @@
522
523
  const [videoRef, setVideoRef] = React.useState(null);
523
524
  const themeTag = React.useRef();
524
525
  const curTime = React.useRef();
526
+ const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
525
527
  const isShowConsent = React.useMemo(() => {
526
528
  var _a, _b, _c, _d;
527
529
  return (((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent;
@@ -731,8 +733,9 @@
731
733
  });
732
734
  }, [bffEventReport]);
733
735
  React.useEffect(() => {
734
- h5EnterLink();
735
- }, []);
736
+ if (!isShowConsent)
737
+ h5EnterLink();
738
+ }, [isShowConsent]);
736
739
  React.useEffect(() => {
737
740
  if (isShowConsent)
738
741
  return;
@@ -811,7 +814,10 @@
811
814
  setIsAgreePolicy,
812
815
  curTime,
813
816
  h5EnterLink,
814
- themeTag
817
+ themeTag,
818
+ isShowConsent,
819
+ selectTag,
820
+ setSelectTag
815
821
  } }, isShowConsent ? (React.createElement(Consent$3, Object.assign({}, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props))) : (render({
816
822
  rtcList,
817
823
  mutateLike: bffMutateLike,
@@ -1222,7 +1228,7 @@
1222
1228
  * @Author: binruan@chatlabs.com
1223
1229
  * @Date: 2024-03-12 10:59:06
1224
1230
  * @LastEditors: binruan@chatlabs.com
1225
- * @LastEditTime: 2024-06-12 10:53:57
1231
+ * @LastEditTime: 2024-06-20 13:39:07
1226
1232
  * @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
1227
1233
  *
1228
1234
  */
@@ -1292,16 +1298,18 @@
1292
1298
  }
1293
1299
  });
1294
1300
  }, [bffEventReport, popupDetailData]);
1295
- const backMainFeed = React.useCallback((lastFeed, themeTag, hashTag) => {
1296
- bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
1297
- eventInfo: {
1298
- lastFeed,
1299
- themeTags: themeTag ? `[${themeTag}]` : '',
1300
- hashTags: hashTag ? `[${hashTag}]` : '',
1301
- eventSubject: 'backMainFeed',
1302
- eventDescription: 'back Main Feed'
1303
- }
1304
- });
1301
+ const backMainFeed = React.useCallback((lastFeed, selectTag, themeTag, hashTag) => {
1302
+ if (selectTag && selectTag === DEFAULT_TAG) {
1303
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
1304
+ eventInfo: {
1305
+ lastFeed,
1306
+ themeTags: themeTag ? `['${themeTag}']` : '',
1307
+ hashTags: hashTag ? `['${hashTag}']` : '',
1308
+ eventSubject: 'backMainFeed',
1309
+ eventDescription: 'back Main Feed'
1310
+ }
1311
+ });
1312
+ }
1305
1313
  }, [bffEventReport]);
1306
1314
  return {
1307
1315
  jumpToWeb,
@@ -1388,7 +1396,7 @@
1388
1396
  React.createElement("div", { className: 'pb-appoint-form-container' },
1389
1397
  React.createElement(proComponents.BetaSchemaForm, { columns: columnsData, submitter: false, layout: layoutType, autoFocusFirstInput: false, size: 'large', formRef: formRef, className: 'panel-reset' }))),
1390
1398
  React.createElement("div", { className: 'pb-appoint-form-btn-wrapper' },
1391
- React.createElement("button", { onClick: handleSubmit, className: 'pb-appoint-form-btn', style: Object.assign({ color: submitColor, background: submitBgColor }, submitButtonStyle) }, loading ? React.createElement(React.Fragment, null, "loading...") : submitText))));
1399
+ React.createElement("button", { "aria-label": submitText, onClick: handleSubmit, className: 'pb-appoint-form-btn', style: Object.assign({ color: submitColor, background: submitBgColor }, submitButtonStyle) }, loading ? React.createElement(React.Fragment, null, "loading...") : submitText))));
1392
1400
  };
1393
1401
  var AppointFormComponent = React.memo(AppointForm$1);
1394
1402
 
@@ -8580,7 +8588,7 @@
8580
8588
  * @Author: binruan@chatlabs.com
8581
8589
  * @Date: 2024-03-20 10:27:31
8582
8590
  * @LastEditors: binruan@chatlabs.com
8583
- * @LastEditTime: 2024-05-27 09:47:19
8591
+ * @LastEditTime: 2024-06-19 16:25:46
8584
8592
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\FormatImage.tsx
8585
8593
  *
8586
8594
  */
@@ -8630,9 +8638,9 @@
8630
8638
  React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
8631
8639
  React.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
8632
8640
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
8633
- } }))) : (React.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
8641
+ }, alt: 'image' }))) : (React.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
8634
8642
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
8635
- } }))));
8643
+ }, alt: 'image' }))));
8636
8644
  });
8637
8645
  var FormatImage$1 = React.memo(FormatImage);
8638
8646
 
@@ -8700,8 +8708,8 @@
8700
8708
  18-karat gold, this necklace is embellished with hand-set diamonds.`, maxStr: 79, className: 'pb-commondity-content-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info }))));
8701
8709
  };
8702
8710
  const renderBtn = () => {
8703
- var _a;
8704
- return (React.createElement(React.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle }, (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website'))));
8711
+ var _a, _b;
8712
+ return (React.createElement(React.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle }, (_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website'))));
8705
8713
  };
8706
8714
  const getStyle = React.useCallback((style) => {
8707
8715
  if (style === null || style === void 0 ? void 0 : style.lineClamp) {
@@ -8747,7 +8755,7 @@
8747
8755
  top: 0,
8748
8756
  objectFit: 'cover',
8749
8757
  width: '100%'
8750
- }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
8758
+ }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: 'pdp image' }))),
8751
8759
  React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
8752
8760
  renderBtn(),
8753
8761
  React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
@@ -8951,9 +8959,9 @@
8951
8959
  };
8952
8960
  return (React.createElement("div", Object.assign({ className: `pb-prompt ${css.css(Object.assign({}, style))}` }, props),
8953
8961
  React.createElement("div", { className: 'pb-prompt-icon' },
8954
- React.createElement("img", { width: '100%', src: iconSrc !== null && iconSrc !== void 0 ? iconSrc : img$2 })),
8962
+ React.createElement("img", { width: '100%', src: iconSrc !== null && iconSrc !== void 0 ? iconSrc : img$2, alt: 'success image' })),
8955
8963
  React.createElement("div", { className: 'pb-prompt-content' }, content),
8956
- React.createElement("button", { className: 'pb-prompt-btn', style: submitButtonStyle, onClick: handleOk }, btnText)));
8964
+ React.createElement("button", { "aria-label": btnText, className: 'pb-prompt-btn', style: submitButtonStyle, onClick: handleOk }, btnText)));
8957
8965
  };
8958
8966
  var PromptComponent = React.memo(Prompt$1);
8959
8967
 
@@ -9177,7 +9185,7 @@
9177
9185
  ];
9178
9186
 
9179
9187
  const CommodityDetailDiroNew$1 = (_a) => {
9180
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
9188
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
9181
9189
  var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index"]);
9182
9190
  React.useState(true);
9183
9191
  const { sxpParameter } = useSxpDataSource();
@@ -9283,7 +9291,7 @@ Made in Italy` })));
9283
9291
  top: 0,
9284
9292
  objectFit: 'cover',
9285
9293
  width: '100%'
9286
- }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
9294
+ }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: 'pdp image' }))),
9287
9295
  React.createElement("div", { className: 'pb-commondityDiroNew-content' },
9288
9296
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
9289
9297
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
@@ -9292,7 +9300,7 @@ Made in Italy` })));
9292
9300
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
9293
9301
  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) }, priceText),
9294
9302
  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) }, (_m = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _m !== void 0 ? _m : '税费'))),
9295
- (!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (_o = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _o !== void 0 ? _o : 'Shop now')),
9303
+ (!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_o = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _o !== void 0 ? _o : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (_p = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _p !== void 0 ? _p : 'Shop now')),
9296
9304
  productInfoText({ isPost }))),
9297
9305
  React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
9298
9306
  };
@@ -9784,7 +9792,7 @@ Made in Italy` })));
9784
9792
  const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
9785
9793
  return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props),
9786
9794
  React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
9787
- React.createElement("img", { className: css.css({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), src: (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, alt: '' })),
9795
+ React.createElement("img", { className: css.css({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), src: (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, alt: 'cta image' })),
9788
9796
  React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_e = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _e !== void 0 ? _e : 'Product Name')));
9789
9797
  };
9790
9798
  var AppointComponent = React.memo(Appoint$1);
@@ -10702,7 +10710,7 @@ Made in Italy` })));
10702
10710
  var _a;
10703
10711
  const { waterFallData, setOpenHashtag } = useSxpDataSource();
10704
10712
  return (React.createElement("div", { className: 'clc-sxp-nav', style: styles },
10705
- React.createElement("img", { className: 'clc-sxp-nav-left', src: icon, alt: '', onClick: onClose }),
10713
+ React.createElement("img", { className: 'clc-sxp-nav-left', src: icon, alt: 'back button', onClick: onClose }),
10706
10714
  React.createElement("div", { className: 'clc-sxp-nav-title', style: textStyle }, `#${(_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag) !== null && _a !== void 0 ? _a : '标题'}`)));
10707
10715
  };
10708
10716
  var Navbar$1 = React.memo(Navbar);
@@ -11994,15 +12002,15 @@ Made in Italy` })));
11994
12002
  const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
11995
12003
  const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = useSxpDataSource();
11996
12004
  const [showVideo, setShowVideo] = React.useState(false);
11997
- const [isLoading, setIsLoading] = React.useState(false);
11998
- const [imgInfo, setImgInfo] = React.useState({
12005
+ React.useState(false);
12006
+ React.useState({
11999
12007
  height: 1,
12000
12008
  width: 1
12001
12009
  });
12002
12010
  const imgDom = React.useRef(null);
12003
12011
  const ref = React.useRef(null);
12004
- const videoDom = React.useRef(null);
12005
- const canvasRef = React.useRef(null);
12012
+ React.useRef(null);
12013
+ React.useRef(null);
12006
12014
  const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
12007
12015
  const src = React.useMemo(() => {
12008
12016
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
@@ -12032,7 +12040,7 @@ Made in Italy` })));
12032
12040
  return y;
12033
12041
  }, [style]);
12034
12042
  /** 是否加载图片 */
12035
- const isImgShow = React.useMemo(() => {
12043
+ React.useMemo(() => {
12036
12044
  if (top === undefined) {
12037
12045
  return false;
12038
12046
  }
@@ -12058,58 +12066,25 @@ Made in Italy` })));
12058
12066
  if (imgDom.current === null || src === '') {
12059
12067
  return;
12060
12068
  }
12061
- const img = new Image();
12069
+ let imgSrc = null;
12062
12070
  if (showVideo && firstFrameSrc) {
12063
- img.src = firstFrameSrc;
12071
+ imgSrc = firstFrameSrc;
12064
12072
  }
12065
12073
  else {
12066
- img.src = src;
12074
+ imgSrc = src;
12067
12075
  }
12068
- img.onload = () => {
12069
- setImgInfo({
12070
- height: img.height,
12071
- width: img.width
12072
- });
12073
- setIsLoading(true);
12074
- };
12075
- imgDom.current.setSrc(img.src);
12076
- }, [src, showVideo, firstFrameSrc, isImgShow]);
12077
- React.useEffect(() => {
12078
- // 通过宽度比例获取图片高度
12079
- const height = imgInfo.height * (unitWidth / imgInfo.width);
12080
- if (isLoading) {
12076
+ if (imgSrc)
12077
+ imgDom.current.setSrc(imgSrc);
12078
+ }, [src, showVideo, firstFrameSrc]);
12079
+ const pictRef = React.useRef();
12080
+ const imgLoad = React.useCallback((img) => {
12081
+ setTimeout(() => {
12082
+ var _a;
12083
+ const height = (_a = pictRef === null || pictRef === void 0 ? void 0 : pictRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight;
12081
12084
  // 加56是因为下方文字部分高度为56,可以自己设置
12082
12085
  sizeChange(height + 56 + space, index);
12083
- }
12084
- }, [imgInfo, index, unitWidth, isLoading, space]); /* 增加sizeChange依赖项会导致在admin预览编辑时无限刷新 */
12085
- const calculateHeightForWidth = (videoWidth, videoHeight, targetWidth) => {
12086
- const aspectRatio = videoWidth / videoHeight;
12087
- const targetHeight = targetWidth / aspectRatio;
12088
- return targetHeight;
12089
- };
12090
- React.useEffect(() => {
12091
- const video = videoDom === null || videoDom === void 0 ? void 0 : videoDom.current;
12092
- if (video === null || src === '' || !showVideo) {
12093
- return;
12094
- }
12095
- video.src = src;
12096
- video.currentTime = 1;
12097
- video.crossOrigin = 'anonymous';
12098
- video.onloadeddata = () => {
12099
- const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
12100
- if (!canvas)
12101
- return;
12102
- const ctx = canvas.getContext('2d');
12103
- const targetWidth = (window === null || window === void 0 ? void 0 : window.innerWidth) / 2;
12104
- const targetHeight = calculateHeightForWidth(video.videoWidth, video.videoHeight, targetWidth);
12105
- canvas.height = targetHeight;
12106
- canvas.width = targetWidth;
12107
- ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
12108
- setFirstFrameSrc(canvas.toDataURL());
12109
- video.remove();
12110
- canvas.remove();
12111
- };
12112
- }, [src, showVideo]);
12086
+ }, 0);
12087
+ }, [space, sizeChange, index, unitWidth, pictRef]);
12113
12088
  const handleClickToDetail = () => {
12114
12089
  reportTagsView();
12115
12090
  setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(list);
@@ -12120,17 +12095,14 @@ Made in Italy` })));
12120
12095
  }, 0);
12121
12096
  };
12122
12097
  return (React.createElement("div", { ref: ref, style: Object.assign({}, style), className: 'waterFallList-content-listItem', key: index, onClick: handleClickToDetail },
12123
- React.createElement("div", { className: 'waterFallList-content-listItem-picture' },
12124
- showVideo && (React.createElement("div", { style: { display: 'none' } },
12125
- React.createElement("video", { ref: videoDom, src: src, crossOrigin: 'anonymous', className: 'waterFallList-content-listItem-picture-img' }),
12126
- React.createElement("canvas", { ref: canvasRef }))),
12127
- React.createElement(FormatImage$1, { loading: 'lazy', className: 'waterFallList-content-listItem-picture-img', ref: imgDom })),
12098
+ React.createElement("div", { className: 'waterFallList-content-listItem-picture', ref: pictRef },
12099
+ React.createElement(FormatImage$1, { loading: 'lazy', className: 'waterFallList-content-listItem-picture-img', onLoad: imgLoad, ref: imgDom })),
12128
12100
  React.createElement("div", { className: 'waterFallList-content-listItem-info' },
12129
12101
  React.createElement("div", { className: `${'waterFallList-content-listItem-info-title'} ${priceText ? 'waterFallList-content-listItem-info-nowrap' : ''}`, style: Object.assign({}, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title) }, title && title),
12130
12102
  React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price }, priceText))));
12131
12103
  };
12132
12104
  function WaterfallList$1(_a) {
12133
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
12105
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
12134
12106
  var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
12135
12107
  const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
12136
12108
  /** 滚动的父元素 */
@@ -12182,7 +12154,6 @@ Made in Italy` })));
12182
12154
  for (let i = 0; i < (list === null || list === void 0 ? void 0 : list.length); i++) {
12183
12155
  // 原本应对应的行数
12184
12156
  const currentRow = Math.floor(i / rowsNum);
12185
- //
12186
12157
  const remainder = (i % rowsNum) + 1;
12187
12158
  // 最低item下标
12188
12159
  let minHeightInd = 0;
@@ -12359,7 +12330,7 @@ Made in Italy` })));
12359
12330
  } }))),
12360
12331
  React.createElement("div", { className: 'waterFallList-bottom', hidden: !((_t = data === null || data === void 0 ? void 0 : data.tag) === null || _t === void 0 ? void 0 : _t.link), style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
12361
12332
  React.createElement("div", { ref: buttonRef, hidden: !((_u = data === null || data === void 0 ? void 0 : data.tag) === null || _u === void 0 ? void 0 : _u.link), className: 'waterFallList-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
12362
- React.createElement("button", { className: 'waterFallList-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_v = data === null || data === void 0 ? void 0 : data.tag) === null || _v === void 0 ? void 0 : _v.linkTitle) || 'Shop the collection'))))));
12333
+ React.createElement("button", { "aria-label": ((_v = data === null || data === void 0 ? void 0 : data.tag) === null || _v === void 0 ? void 0 : _v.linkTitle) || 'Shop the collection', className: 'waterFallList-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_w = data === null || data === void 0 ? void 0 : data.tag) === null || _w === void 0 ? void 0 : _w.linkTitle) || 'Shop the collection'))))));
12363
12334
  }
12364
12335
 
12365
12336
  var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAaZJREFUeF7t2jFKBEEQRuG3mSJeQTARURDMTL2EqXfwAnoKD6FHMDEzNVIw2tzQC2gFggyDrExX1V92T7wz9PumFnqbXdH5teq8nwEwJqBzgfEVKDYAW8Ae8NZq3ZUm4Aa4AnaBR+C8BUIVAIu/ngSfAs9LESoAWLgB/LzWwP7SeLtfHWAu3tZ9Adz/dwD3eOUJCIlXBQiLVwQIjVcDCI9XAkiJVwFIi1cASI3PBpjb3jbd5GyyUcraCUrEZ02ATHwGgFR8NIBcfCSAZHwUgGx8BIB0vDeAfLwnQIl4L4Ay8R4ApeJbA2wD78DOZA/e7ABzk739Xz/T8rfAIfA6WYCd3BqA7NUSwCKfgLNKCK0BjoC7rzP74yoIrQGsuxSCB0ApBC+AMgieACUQvAHkESIApBGiAGQRIgEkEaIB5BAyAKQQsgBkEDIBJBCyAdIRFABSEVQA0hCUAFIQ1ADCERQBQhFUAcIQlAFCENQBfkOwg9eXpeftFQDmEOzv8ifARy8A3wiXwAHwANwujbf7q0xAi9bZZwwAN9oiDx4TUORFuS2z+wn4BAiAaEHnKChjAAAAAElFTkSuQmCC";
@@ -12488,7 +12459,7 @@ Made in Italy` })));
12488
12459
  React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText }, priceText))));
12489
12460
  };
12490
12461
  function WaterfallList(_a) {
12491
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
12462
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
12492
12463
  var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
12493
12464
  const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
12494
12465
  const [list, setList] = React.useState();
@@ -12577,20 +12548,20 @@ Made in Italy` })));
12577
12548
  } })),
12578
12549
  React.createElement("div", { className: 'list-bottom', hidden: !((_o = data === null || data === void 0 ? void 0 : data.tag) === null || _o === void 0 ? void 0 : _o.link), style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
12579
12550
  React.createElement("div", { hidden: !((_p = data === null || data === void 0 ? void 0 : data.tag) === null || _p === void 0 ? void 0 : _p.link), className: 'list-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
12580
- React.createElement("button", { className: 'list-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_q = data === null || data === void 0 ? void 0 : data.tag) === null || _q === void 0 ? void 0 : _q.linkTitle) || 'Shop the collection'))))));
12551
+ React.createElement("button", { "aria-label": ((_q = data === null || data === void 0 ? void 0 : data.tag) === null || _q === void 0 ? void 0 : _q.linkTitle) || 'Shop the collection', className: 'list-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_r = data === null || data === void 0 ? void 0 : data.tag) === null || _r === void 0 ? void 0 : _r.linkTitle) || 'Shop the collection'))))));
12581
12552
  }
12582
12553
 
12583
12554
  /*
12584
12555
  * @Author: binruan@chatlabs.com
12585
12556
  * @Date: 2024-01-10 10:58:24
12586
12557
  * @LastEditors: binruan@chatlabs.com
12587
- * @LastEditTime: 2024-06-12 14:18:56
12558
+ * @LastEditTime: 2024-06-20 12:45:26
12588
12559
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
12589
12560
  *
12590
12561
  */
12591
12562
  const WaterFall = (props) => {
12592
12563
  var _a;
12593
- const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag } = useSxpDataSource();
12564
+ const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag } = useSxpDataSource();
12594
12565
  const { backMainFeed } = useEventReport();
12595
12566
  React.useRef(null);
12596
12567
  const modalEleRef = React.useRef(null);
@@ -12612,9 +12583,7 @@ Made in Italy` })));
12612
12583
  if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
12613
12584
  setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
12614
12585
  }
12615
- if (!(themeTag === null || themeTag === void 0 ? void 0 : themeTag.current)) {
12616
- backMainFeed('branch', themeTag === null || themeTag === void 0 ? void 0 : themeTag.current, waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag);
12617
- }
12586
+ backMainFeed('branch', selectTag, undefined, waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag);
12618
12587
  reportTagsView();
12619
12588
  setWaterFallData === null || setWaterFallData === void 0 ? void 0 : setWaterFallData(undefined);
12620
12589
  setIsFromHashtag === null || setIsFromHashtag === void 0 ? void 0 : setIsFromHashtag(false);
@@ -12926,7 +12895,7 @@ Made in Italy` })));
12926
12895
  }
12927
12896
  }
12928
12897
  }), 200);
12929
- return (React.createElement("button", Object.assign({}, props, { onClick: handleClick }),
12898
+ return (React.createElement("button", Object.assign({}, props, { "aria-label": 'like', onClick: handleClick }),
12930
12899
  React.createElement("img", { style: { width: '100%', height: '100%', objectFit: 'contain' }, src: state ? activeIcon || likeIcon : unActicveIcon || unlikeIcon, alt: 'icon' })));
12931
12900
  };
12932
12901
  var LikeButton$1 = React.memo(LikeButton);
@@ -13185,7 +13154,7 @@ Made in Italy` })));
13185
13154
  if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
13186
13155
  return null;
13187
13156
  }
13188
- return (React.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image }));
13157
+ return (React.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'placeholder image' }));
13189
13158
  }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
13190
13159
  React.useEffect(() => {
13191
13160
  if (!videoRef)
@@ -13218,7 +13187,7 @@ Made in Italy` })));
13218
13187
  } },
13219
13188
  React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
13220
13189
  React.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
13221
- React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
13190
+ React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', alt: 'pause', src: PAUSE_ICON }))),
13222
13191
  renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, style: {
13223
13192
  position: 'relative',
13224
13193
  width: '100%',
@@ -13227,7 +13196,7 @@ Made in Italy` })));
13227
13196
  }, onClick: handleClickVideo() },
13228
13197
  React.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
13229
13198
  renderPoster,
13230
- React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
13199
+ React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON, alt: 'pause' })))));
13231
13200
  };
13232
13201
  var VideoWidget$3 = React.memo(VideoWidget$2);
13233
13202
 
@@ -13247,8 +13216,8 @@ Made in Italy` })));
13247
13216
  setIsTure(result);
13248
13217
  onChange === null || onChange === void 0 ? void 0 : onChange(result);
13249
13218
  };
13250
- return (React.createElement("button", { style: style, className: 'pb-toggle-button', onClick: handleClick },
13251
- React.createElement("img", { className: 'pb-toggle-button-icon', src: isTrue ? activeIcon : unactiveIcon })));
13219
+ return (React.createElement("button", { style: style, "aria-label": 'toggle button', className: 'pb-toggle-button', onClick: handleClick },
13220
+ React.createElement("img", { className: 'pb-toggle-button-icon', alt: 'toggle image', src: isTrue ? activeIcon : unactiveIcon })));
13252
13221
  };
13253
13222
  var ToggleButton$1 = React.memo(ToggleButton);
13254
13223
 
@@ -13273,7 +13242,7 @@ Made in Italy` })));
13273
13242
  return show ? 'pb-fadeIn' : 'pb-fadeOut';
13274
13243
  }, [show]);
13275
13244
  return (React.createElement("div", { hidden: !show, className: `pb-finger-wrap ${animationCls}`, style: style },
13276
- React.createElement("img", { src: imageUrl || FINGER_SWIPE_ICON })));
13245
+ React.createElement("img", { src: imageUrl || FINGER_SWIPE_ICON, alt: 'finger swiper' })));
13277
13246
  };
13278
13247
 
13279
13248
  /*
@@ -13535,7 +13504,7 @@ Made in Italy` })));
13535
13504
  backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
13536
13505
  borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
13537
13506
  } },
13538
- (nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover', flexShrink: 0 } }) : null,
13507
+ (nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? (React.createElement("img", { src: nudge.icon, alt: 'nudge icon', style: { height: '100%', objectFit: 'cover', flexShrink: 0 } })) : null,
13539
13508
  React.createElement("p", { style: Object.assign(Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle), { textWrap: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', flex: 1, marginBottom: 0 }) }, (_g = nudge === null || nudge === void 0 ? void 0 : nudge.content) !== null && _g !== void 0 ? _g : '')))));
13540
13509
  };
13541
13510
 
@@ -13543,14 +13512,12 @@ Made in Italy` })));
13543
13512
  * @Author: binruan@chatlabs.com
13544
13513
  * @Date: 2024-04-29 16:32:21
13545
13514
  * @LastEditors: binruan@chatlabs.com
13546
- * @LastEditTime: 2024-06-12 11:01:48
13515
+ * @LastEditTime: 2024-06-20 10:53:08
13547
13516
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Tagbar.tsx
13548
13517
  *
13549
13518
  */
13550
- const DEFAULT_TAG = 'FOR U';
13551
13519
  const Tagbar = ({ tagList = [], setActiveIndex }) => {
13552
- const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
13553
- const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef, waterFallData, bffEventReport } = useSxpDataSource();
13520
+ const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef, waterFallData, bffEventReport, selectTag, setSelectTag } = useSxpDataSource();
13554
13521
  const { backMainFeed } = useEventReport();
13555
13522
  const realTagList = React.useMemo(() => {
13556
13523
  return [DEFAULT_TAG, ...tagList];
@@ -13563,12 +13530,12 @@ Made in Italy` })));
13563
13530
  eventInfo: {
13564
13531
  eventSubject: 'clickThemeTagsViewContents',
13565
13532
  eventDescription: 'click Theme Tags View Contents',
13566
- themeTags: `[${tag}]`
13533
+ themeTags: `['${tag}']`
13567
13534
  }
13568
13535
  });
13569
13536
  }
13570
13537
  else {
13571
- backMainFeed('theme', selectTag);
13538
+ backMainFeed('theme', tag, selectTag);
13572
13539
  }
13573
13540
  let themeTag;
13574
13541
  if (tag !== DEFAULT_TAG) {
@@ -13586,7 +13553,7 @@ Made in Italy` })));
13586
13553
  }).finally(() => {
13587
13554
  setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
13588
13555
  });
13589
- setSelectTag(tag);
13556
+ setSelectTag === null || setSelectTag === void 0 ? void 0 : setSelectTag(tag);
13590
13557
  };
13591
13558
  if (waterFallData || tagList.length <= 0)
13592
13559
  return null;
@@ -13601,7 +13568,7 @@ Made in Italy` })));
13601
13568
  * @Author: binruan@chatlabs.com
13602
13569
  * @Date: 2024-01-15 19:03:09
13603
13570
  * @LastEditors: binruan@chatlabs.com
13604
- * @LastEditTime: 2024-06-18 11:50:31
13571
+ * @LastEditTime: 2024-06-20 15:54:53
13605
13572
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
13606
13573
  *
13607
13574
  */
@@ -13610,12 +13577,12 @@ Made in Italy` })));
13610
13577
  const { schema } = useEditor();
13611
13578
  const [activeIndex, setActiveIndex] = React.useState(0);
13612
13579
  const viewImageStartTime = React.useRef(0);
13613
- const [isInit, setIsInit] = React.useState(false);
13580
+ React.useState(false);
13614
13581
  const [isMuted, setIsMuted] = React.useState(true);
13615
13582
  const viewTime = React.useRef();
13616
13583
  const [isLoadMore, setIsLoadMore] = React.useState(false);
13617
13584
  const [isShowMore, setIsShowMore] = React.useState(false);
13618
- const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink } = useSxpDataSource();
13585
+ const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag } = useSxpDataSource();
13619
13586
  const { backMainFeed } = useEventReport();
13620
13587
  const [videoRef, setVideoRef] = React.useState(null);
13621
13588
  const playerRef = React.useRef();
@@ -13623,21 +13590,29 @@ Made in Italy` })));
13623
13590
  const isShowFingerTip = React.useMemo(() => {
13624
13591
  return data.length > 0 && !loading && getFeUserId();
13625
13592
  }, [data, loading]);
13626
- const handleH5EnterLink = React.useCallback(() => {
13627
- if (data.length <= 0) {
13628
- return;
13593
+ React.useEffect(() => {
13594
+ refreshFeSessionId();
13595
+ }, []);
13596
+ React.useEffect(() => {
13597
+ if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
13598
+ const now = new Date();
13599
+ viewTime.current = now;
13600
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
13601
+ eventName: 'PageView'
13602
+ });
13629
13603
  }
13604
+ }, [data === null || data === void 0 ? void 0 : data.length]);
13605
+ const handleH5EnterLink = React.useCallback(() => {
13630
13606
  refreshFeSessionId();
13631
- const now = new Date();
13632
- viewTime.current = now;
13633
- if (isInit) {
13634
- h5EnterLink === null || h5EnterLink === void 0 ? void 0 : h5EnterLink();
13607
+ h5EnterLink === null || h5EnterLink === void 0 ? void 0 : h5EnterLink();
13608
+ if (data.length > 0) {
13609
+ const now = new Date();
13610
+ viewTime.current = now;
13611
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
13612
+ eventName: 'PageView'
13613
+ });
13635
13614
  }
13636
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
13637
- eventName: 'PageView'
13638
- });
13639
- setIsInit(true);
13640
- }, [data.length, bffFbReport, h5EnterLink, isInit]);
13615
+ }, [data.length, bffFbReport, h5EnterLink]);
13641
13616
  const firstRef = React.useRef();
13642
13617
  React.useEffect(() => {
13643
13618
  var _a, _b, _c, _d;
@@ -13665,10 +13640,6 @@ Made in Italy` })));
13665
13640
  });
13666
13641
  }
13667
13642
  }, [videoRef, licenseUrl, data]);
13668
- React.useEffect(() => {
13669
- if (!isInit)
13670
- handleH5EnterLink();
13671
- }, [handleH5EnterLink, isInit]);
13672
13643
  React.useEffect(() => {
13673
13644
  var _a;
13674
13645
  const index = (data === null || data === void 0 ? void 0 : data.findIndex((item) => {
@@ -13689,10 +13660,11 @@ Made in Italy` })));
13689
13660
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
13690
13661
  const visibleChange = () => {
13691
13662
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
13663
+ const repCond = !openHashtag && !isShowConsent;
13692
13664
  if (document.visibilityState === 'hidden') {
13693
13665
  // 当用户导航到新页面、切换标签页、关闭标签页、最小化或关闭浏览器、刷新原页面(即离开原页面时),或者在移动设备上从浏览器切换到不同的应用程序时
13694
13666
  // 移动端h5直接杀掉浏览器或宿主app时不会触发,pc端直接杀掉标签页时能触发
13695
- if (!openHashtag) {
13667
+ if (repCond) {
13696
13668
  SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_HIDE, item);
13697
13669
  handleReportViewImageEnd(item);
13698
13670
  handleReportProductView(item);
@@ -13733,11 +13705,11 @@ Made in Italy` })));
13733
13705
  else if (document.visibilityState === 'visible') {
13734
13706
  // 页面可见时触发,注意页面初始化时不会触发
13735
13707
  handleH5EnterLink();
13736
- if (!openHashtag) {
13708
+ if (repCond) {
13737
13709
  handleViewImageStartEvent(activeIndex);
13738
13710
  SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
13711
+ backMainFeed('external', selectTag);
13739
13712
  }
13740
- backMainFeed('external');
13741
13713
  }
13742
13714
  };
13743
13715
  document.addEventListener('visibilitychange', visibleChange);
@@ -13754,17 +13726,10 @@ Made in Italy` })));
13754
13726
  tempMap,
13755
13727
  curTime,
13756
13728
  backMainFeed,
13757
- openHashtag
13729
+ openHashtag,
13730
+ isShowConsent,
13731
+ selectTag
13758
13732
  ]);
13759
- React.useEffect(() => {
13760
- const initTime = () => {
13761
- backMainFeed('external');
13762
- };
13763
- window.addEventListener('pageshow', initTime);
13764
- return () => {
13765
- window.removeEventListener('pageshow', initTime);
13766
- };
13767
- }, []);
13768
13733
  const tagHeight = React.useMemo(() => {
13769
13734
  let h = 0;
13770
13735
  if (tagList.length > 0) {
@@ -14037,24 +14002,7 @@ Made in Italy` })));
14037
14002
  });
14038
14003
  }
14039
14004
  }
14040
- },
14041
- // style={{
14042
- // pointerEvents: canSwiper ? 'auto' : 'none'
14043
- // }}
14044
- // onReachEnd={() => {
14045
- // // 由hashtaglist跳转过来时不执行下面的方法
14046
- // if (waterFallData) return;
14047
- // if (!isLoadMore) {
14048
- // console.log('trigger load 2');
14049
- // setIsLoadMore(true);
14050
- // loadVideos?.(Math.ceil(activeIndex / 10) + 1).then(() => {
14051
- // setIsLoadMore(false);
14052
- // });
14053
- // }
14054
- // }}
14055
- // modules={[Virtual]}
14056
- // virtual={{ enabled: true, cache: true }}
14057
- direction: 'vertical', height: height },
14005
+ }, direction: 'vertical', height: height },
14058
14006
  React.createElement(ToggleButton$1, { style: {
14059
14007
  position: 'fixed',
14060
14008
  visibility: ((_c = (_b = data === null || data === void 0 ? void 0 : data[activeIndex]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.url) ? 'visible' : 'hidden',
@@ -14253,7 +14201,7 @@ Made in Italy` })));
14253
14201
  if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
14254
14202
  return null;
14255
14203
  }
14256
- return (React.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image }));
14204
+ return (React.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'video poster' }));
14257
14205
  }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
14258
14206
  React.useEffect(() => {
14259
14207
  const handleBeforeUnload = () => {
@@ -14302,7 +14250,7 @@ Made in Italy` })));
14302
14250
  height,
14303
14251
  objectFit: 'contain'
14304
14252
  } }),
14305
- React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
14253
+ React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON, alt: 'video pause image' }))),
14306
14254
  renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, onClick: handleClickVideo(), style: {
14307
14255
  position: 'relative',
14308
14256
  width,
@@ -14311,7 +14259,7 @@ Made in Italy` })));
14311
14259
  } },
14312
14260
  React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', style: { width: '100%' }, ref: videoRef, crossOrigin: 'anonymous', muted: true, autoPlay: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
14313
14261
  renderPoster,
14314
- React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
14262
+ React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON, alt: 'video pause image' })))));
14315
14263
  };
14316
14264
  var VideoWidget$1 = React.memo(VideoWidget);
14317
14265
 
@@ -14602,4 +14550,3 @@ Made in Italy` })));
14602
14550
  Object.defineProperty(exports, '__esModule', { value: true });
14603
14551
 
14604
14552
  }));
14605
- //# sourceMappingURL=pb-ui.js.map