pb-sxp-ui 1.0.42 → 1.0.43

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 (60) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +111 -111
  3. package/dist/index.cjs +237 -600
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.css +4 -54
  6. package/dist/index.js +237 -599
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.min.cjs +3 -4
  9. package/dist/index.min.cjs.map +1 -1
  10. package/dist/index.min.js +3 -4
  11. package/dist/index.min.js.map +1 -1
  12. package/dist/pb-ui.js +241 -603
  13. package/dist/pb-ui.js.map +1 -1
  14. package/dist/pb-ui.min.js +3 -4
  15. package/dist/pb-ui.min.js.map +1 -1
  16. package/es/core/components/SxpPageCore/index.js +2 -2
  17. package/es/core/components/SxpPageRender/Nudge/index.js +5 -6
  18. package/es/core/components/SxpPageRender/VideoWidget/index.d.ts +1 -0
  19. package/es/core/components/SxpPageRender/VideoWidget/index.js +119 -88
  20. package/es/core/components/SxpPageRender/WaterFall/index.js +1 -1
  21. package/es/core/components/SxpPageRender/index.d.ts +0 -2
  22. package/es/core/components/SxpPageRender/index.js +63 -25
  23. package/es/core/context/SxpDataSourceProvider.d.ts +2 -3
  24. package/es/core/context/SxpDataSourceProvider.js +7 -28
  25. package/es/core/hooks/useEventReport.js +4 -4
  26. package/es/index.d.ts +0 -1
  27. package/es/index.js +0 -1
  28. package/es/materials/sxp/popup/CommodityDetail/index.js +10 -10
  29. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +10 -10
  30. package/lib/core/components/SxpPageCore/index.js +2 -2
  31. package/lib/core/components/SxpPageRender/Nudge/index.js +5 -6
  32. package/lib/core/components/SxpPageRender/VideoWidget/index.d.ts +1 -0
  33. package/lib/core/components/SxpPageRender/VideoWidget/index.js +119 -88
  34. package/lib/core/components/SxpPageRender/WaterFall/index.js +1 -1
  35. package/lib/core/components/SxpPageRender/index.d.ts +0 -2
  36. package/lib/core/components/SxpPageRender/index.js +63 -25
  37. package/lib/core/context/SxpDataSourceProvider.d.ts +2 -3
  38. package/lib/core/context/SxpDataSourceProvider.js +7 -28
  39. package/lib/core/hooks/useEventReport.js +4 -4
  40. package/lib/index.d.ts +0 -1
  41. package/lib/index.js +1 -3
  42. package/lib/materials/sxp/popup/CommodityDetail/index.js +10 -10
  43. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +10 -10
  44. package/package.json +114 -115
  45. package/es/core/components/DiyPortalPreview/PictureGroup.d.ts +0 -13
  46. package/es/core/components/DiyPortalPreview/PictureGroup.js +0 -11
  47. package/es/core/components/DiyPortalPreview/VideoWidget.d.ts +0 -15
  48. package/es/core/components/DiyPortalPreview/VideoWidget.js +0 -236
  49. package/es/core/components/DiyPortalPreview/index.d.ts +0 -6
  50. package/es/core/components/DiyPortalPreview/index.js +0 -127
  51. package/es/core/components/SxpPageRender/Tagbar.d.ts +0 -7
  52. package/es/core/components/SxpPageRender/Tagbar.js +0 -37
  53. package/lib/core/components/DiyPortalPreview/PictureGroup.d.ts +0 -13
  54. package/lib/core/components/DiyPortalPreview/PictureGroup.js +0 -14
  55. package/lib/core/components/DiyPortalPreview/VideoWidget.d.ts +0 -15
  56. package/lib/core/components/DiyPortalPreview/VideoWidget.js +0 -239
  57. package/lib/core/components/DiyPortalPreview/index.d.ts +0 -6
  58. package/lib/core/components/DiyPortalPreview/index.js +0 -130
  59. package/lib/core/components/SxpPageRender/Tagbar.d.ts +0 -7
  60. package/lib/core/components/SxpPageRender/Tagbar.js +0 -40
package/dist/index.js CHANGED
@@ -7,7 +7,6 @@ import { css } from '@emotion/css';
7
7
  import { BetaSchemaForm } from '@ant-design/pro-components';
8
8
  import * as ReactDOM from 'react-dom';
9
9
  import EventEmitter from 'eventemitter3';
10
- import Hls from 'hls.js';
11
10
 
12
11
  /******************************************************************************
13
12
  Copyright (c) Microsoft Corporation.
@@ -408,8 +407,7 @@ function useIconLink(path, domain) {
408
407
  }
409
408
 
410
409
  const SxpDataSourceContext = createContext({
411
- rtcList: [],
412
- tagList: []
410
+ rtcList: []
413
411
  });
414
412
  var DataSourceType;
415
413
  (function (DataSourceType) {
@@ -418,7 +416,6 @@ var DataSourceType;
418
416
  const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
419
417
  const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false }) => {
420
418
  const [rtcList, setRtcList] = useState([]);
421
- const [tagList, setTagList] = useState([]);
422
419
  const [loading, setLoading] = useState(false);
423
420
  const [curReqInfo, setCurReqInfo] = useState({ rtc: '', requestId: '' });
424
421
  const swiperRef = useRef(null);
@@ -430,6 +427,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
430
427
  const [cacheRtcList, setCacheRtcList] = useState([]);
431
428
  const [cacheActiveIndex, setCacheActiveIndex] = useState(0);
432
429
  const [isFromHashtag, setIsFromHashtag] = useState(false);
430
+ const [videoRef, setVideoRef] = useState(null);
433
431
  useEffect(() => {
434
432
  setOpenHashtag(isOpenHashTag);
435
433
  }, [isOpenHashTag]);
@@ -542,19 +540,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
542
540
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
543
541
  return res === null || res === void 0 ? void 0 : res.success;
544
542
  }), [bffFetch]);
545
- // 获取 Tag
546
- const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
547
- var _g, _h;
548
- if (!utmVal)
549
- return;
550
- try {
551
- const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: utmVal } }));
552
- setTagList((_h = (_g = result === null || result === void 0 ? void 0 : result.data) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []);
553
- }
554
- catch (e) {
555
- console.log('e', e);
556
- }
557
- }), [bffFetch, utmVal]);
558
543
  const ctaEvent = useCallback((eventInfo, rec, product, position) => {
559
544
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
560
545
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
@@ -570,12 +555,11 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
570
555
  fromKName = 'imagePage';
571
556
  }
572
557
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
573
- eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : '', fromKName })
558
+ eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', relatedContentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', relatedProductId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : '', fromKName })
574
559
  });
575
560
  }, [bffEventReport, isFromHashtag]);
576
561
  useEffect(() => {
577
562
  setLoading(true);
578
- bffGetTagList();
579
563
  getRecommendVideos()
580
564
  .then((data) => {
581
565
  var _a, _b;
@@ -591,7 +575,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
591
575
  if (!isInit.current)
592
576
  return;
593
577
  setLoading(true);
594
- bffGetTagList();
595
578
  getRecommendVideos()
596
579
  .then((data) => {
597
580
  var _a, _b;
@@ -601,7 +584,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
601
584
  .finally(() => {
602
585
  setLoading(false);
603
586
  });
604
- }, [getRecommendVideos, bffGetTagList]);
587
+ }, [getRecommendVideos]);
605
588
  const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
606
589
  return (React.createElement(SxpDataSourceContext.Provider, { value: {
607
590
  rtcList,
@@ -634,15 +617,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
634
617
  hashTagSize,
635
618
  loadingImage: loadingImage !== null && loadingImage !== void 0 ? loadingImage : defaultLoadingImage,
636
619
  isOpenHashTag,
637
- tagList,
638
- setLoading
639
- } }, render({
640
- rtcList,
641
- mutateLike: bffMutateLike,
642
- mutateUnlike: bffMutateUnlike,
643
- submitForm: bffSubmitForm,
644
- tagList
645
- })));
620
+ videoRef,
621
+ setVideoRef
622
+ } }, render({ rtcList, mutateLike: bffMutateLike, mutateUnlike: bffMutateUnlike, submitForm: bffSubmitForm })));
646
623
  };
647
624
  var SxpDataSourceProvider$1 = memo(SxpDataSourceProvider);
648
625
 
@@ -867,7 +844,7 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
867
844
  React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
868
845
  });
869
846
 
870
- var index$2 = /*#__PURE__*/Object.freeze({
847
+ var index$1 = /*#__PURE__*/Object.freeze({
871
848
  __proto__: null,
872
849
  EditorCore: EditorCore
873
850
  });
@@ -8153,8 +8130,8 @@ function useEventReport() {
8153
8130
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
8154
8131
  contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
8155
8132
  position: position + '',
8156
- contentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
8157
- ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
8133
+ relatedContentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
8134
+ relatedCtatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
8158
8135
  traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
8159
8136
  }
8160
8137
  });
@@ -8178,8 +8155,8 @@ function useEventReport() {
8178
8155
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
8179
8156
  contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
8180
8157
  position: position + '',
8181
- contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
8182
- ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
8158
+ relatedContentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
8159
+ relatedCtatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
8183
8160
  traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
8184
8161
  timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
8185
8162
  eventSubject: 'productView',
@@ -8342,7 +8319,7 @@ const FormatImage = forwardRef((props, ref) => {
8342
8319
  var FormatImage$1 = memo(FormatImage);
8343
8320
 
8344
8321
  const CommodityDetail$1 = (_a) => {
8345
- var _b, _c, _d, _e, _f, _g, _h, _j, _k;
8322
+ var _b, _c, _d, _e, _f, _g, _h, _j;
8346
8323
  var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index"]);
8347
8324
  const { sxpParameter } = useSxpDataSource();
8348
8325
  const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
@@ -8383,7 +8360,7 @@ const CommodityDetail$1 = (_a) => {
8383
8360
  return '$7,000';
8384
8361
  }
8385
8362
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
8386
- const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
8363
+ const width = isPreview ? 375 : window.innerWidth;
8387
8364
  const renderContent = ({ isPost }) => {
8388
8365
  var _a, _b, _c;
8389
8366
  return (React.createElement("div", null,
@@ -8391,10 +8368,10 @@ const CommodityDetail$1 = (_a) => {
8391
8368
  React.createElement("div", { className: 'pb-commondity-content-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.title) }, (_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium'),
8392
8369
  React.createElement("div", { className: 'pb-commondity-content-price', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price) }, priceText),
8393
8370
  React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
8394
- React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
8395
- bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
8396
- collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
8397
- necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
8371
+ React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
8372
+ bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
8373
+ collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
8374
+ necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
8398
8375
  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 }))));
8399
8376
  };
8400
8377
  const renderBtn = () => {
@@ -8403,7 +8380,7 @@ const CommodityDetail$1 = (_a) => {
8403
8380
  };
8404
8381
  return (React.createElement("div", { className: 'pb-commondity' },
8405
8382
  React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
8406
- product && ((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
8383
+ product && ((_f = product === null || product === void 0 ? void 0 : product.homePage) === null || _f === void 0 ? void 0 : _f.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
8407
8384
  clickable: true,
8408
8385
  bulletActiveClass: 'swipe-item-active-bullet',
8409
8386
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -8411,7 +8388,7 @@ const CommodityDetail$1 = (_a) => {
8411
8388
  : 'commondityDetail-swiper-clickable-center'
8412
8389
  }, loop: true, autoplay: {
8413
8390
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
8414
- } }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
8391
+ } }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
8415
8392
  return (React.createElement(SwiperSlide, { key: src },
8416
8393
  React.createElement("div", { style: {
8417
8394
  overflow: 'hidden',
@@ -8420,7 +8397,7 @@ const CommodityDetail$1 = (_a) => {
8420
8397
  } },
8421
8398
  React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
8422
8399
  }))),
8423
- !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css({
8400
+ !((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css({
8424
8401
  position: 'relative',
8425
8402
  height: 0,
8426
8403
  width: '100%',
@@ -8433,7 +8410,7 @@ const CommodityDetail$1 = (_a) => {
8433
8410
  top: 0,
8434
8411
  objectFit: 'cover',
8435
8412
  width: '100%'
8436
- }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
8413
+ }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
8437
8414
  React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
8438
8415
  renderBtn(),
8439
8416
  React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
@@ -8793,7 +8770,7 @@ var settingRender$2 = [
8793
8770
  ];
8794
8771
 
8795
8772
  const CommodityDetailDiroNew$1 = (_a) => {
8796
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
8773
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
8797
8774
  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"]);
8798
8775
  useState(true);
8799
8776
  const { sxpParameter } = useSxpDataSource();
@@ -8841,16 +8818,16 @@ const CommodityDetailDiroNew$1 = (_a) => {
8841
8818
  return '£102,300.00';
8842
8819
  }
8843
8820
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
8844
- const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
8821
+ const width = isPreview ? 375 : window.innerWidth;
8845
8822
  const productInfoText = ({ isPost }) => {
8846
8823
  return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
8847
8824
  React.createElement(ExpandableText$1, { isPost: isPost, onClick: () => setShowModal(true), className: 'pb-commondityDiroNew-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (product === null || product === void 0 ? void 0 : product.info) ||
8848
- `Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
8825
+ `Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
8849
8826
  Made in Italy` })));
8850
8827
  };
8851
8828
  return (React.createElement("div", { className: 'pb-commondityDiroNew' },
8852
8829
  React.createElement("div", Object.assign({ ref: scrollRef, className: css(Object.assign({}, style)) }, props),
8853
- product && ((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
8830
+ product && ((_f = product === null || product === void 0 ? void 0 : product.homePage) === null || _f === void 0 ? void 0 : _f.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
8854
8831
  clickable: true,
8855
8832
  bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
8856
8833
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -8858,7 +8835,7 @@ Made in Italy` })));
8858
8835
  : 'commondityDiroNew-swiper-clickable-center'
8859
8836
  }, loop: true, autoplay: {
8860
8837
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
8861
- } }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
8838
+ } }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
8862
8839
  return (React.createElement(SwiperSlide, { key: src },
8863
8840
  React.createElement("div", { style: {
8864
8841
  overflow: 'hidden',
@@ -8867,7 +8844,7 @@ Made in Italy` })));
8867
8844
  } },
8868
8845
  React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
8869
8846
  }))),
8870
- !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css({
8847
+ !((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css({
8871
8848
  position: 'relative',
8872
8849
  height: 0,
8873
8850
  width: '100%',
@@ -8880,16 +8857,16 @@ Made in Italy` })));
8880
8857
  top: 0,
8881
8858
  objectFit: 'cover',
8882
8859
  width: '100%'
8883
- }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
8860
+ }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
8884
8861
  React.createElement("div", { className: 'pb-commondityDiroNew-content' },
8885
8862
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
8886
8863
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
8887
- React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (_l = product === null || product === void 0 ? void 0 : product.title) !== null && _l !== void 0 ? _l : 'Large Dior Toujours Bag'),
8864
+ React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (_k = product === null || product === void 0 ? void 0 : product.title) !== null && _k !== void 0 ? _k : 'Large Dior Toujours Bag'),
8888
8865
  React.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection }, (product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage Calfskin')),
8889
8866
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
8890
8867
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price }, priceText),
8891
- React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo }, (_m = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _m !== void 0 ? _m : '税费'))),
8892
- (!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')),
8868
+ React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo }, (_l = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _l !== void 0 ? _l : '税费'))),
8869
+ (!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (_m = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _m !== void 0 ? _m : 'Shop now')),
8893
8870
  productInfoText({ isPost }))),
8894
8871
  React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
8895
8872
  };
@@ -11797,7 +11774,7 @@ const WaterFall = (props) => {
11797
11774
  }
11798
11775
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
11799
11776
  eventInfo: {
11800
- contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
11777
+ relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
11801
11778
  position: cacheActiveIndex + '',
11802
11779
  contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
11803
11780
  traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
@@ -11930,14 +11907,14 @@ var _materials_ = /*#__PURE__*/Object.freeze({
11930
11907
  Prompt: Prompt
11931
11908
  });
11932
11909
 
11933
- const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
11934
- const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
11910
+ const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
11911
+ const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
11935
11912
  const LikeButton = (_a) => {
11936
11913
  var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
11937
11914
  const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
11938
11915
  const [state, setState] = useState(active);
11939
- const likeIcon = useIconLink(defaultLikeIconPath$1);
11940
- const unlikeIcon = useIconLink(defaultUnLikeIconPath$1);
11916
+ const likeIcon = useIconLink(defaultLikeIconPath);
11917
+ const unlikeIcon = useIconLink(defaultUnLikeIconPath);
11941
11918
  const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
11942
11919
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
11943
11920
  if (state) {
@@ -11993,9 +11970,8 @@ var SXP_EVENT_TYPE;
11993
11970
  SXP_EVENT_TYPE["PAGE_DID_HIDE"] = "pageDidHide";
11994
11971
  })(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
11995
11972
 
11996
- const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig }) => {
11973
+ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef }) => {
11997
11974
  const [isPauseVideo, setIsPauseVideo] = useState(false);
11998
- const videoRef = useRef(null);
11999
11975
  const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
12000
11976
  const videoStartTime = useRef(0);
12001
11977
  const [isLoadFinish, setIsLoadFinish] = useState(false);
@@ -12003,99 +11979,118 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
12003
11979
  const { isActive } = useSwiperSlide();
12004
11980
  const canvasRef = useRef(null);
12005
11981
  const [firstFrameSrc, setFirstFrameSrc] = useState('');
11982
+ const videoId = `pb-cache-video-${index}`;
11983
+ const videoEleRef = useRef(null);
12006
11984
  useEffect(() => {
12007
- if (!videoRef.current)
11985
+ if (!videoRef)
12008
11986
  return;
12009
- videoRef.current.muted = muted;
12010
- }, [muted]);
12011
- const handleVideoStart = useCallback(() => {
12012
- var _a;
12013
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
12014
- }, []);
11987
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.muted(muted);
11988
+ }, [muted, videoRef]);
11989
+ const handleEnded = useCallback(() => {
11990
+ if (!videoRef)
11991
+ return;
11992
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
11993
+ }, [videoRef]);
12015
11994
  const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
12016
11995
  const handlePlaying = useCallback(() => {
12017
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
11996
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
11997
+ if (!videoRef)
11998
+ return;
12018
11999
  setIsPauseVideo(false);
12019
12000
  const item = data[index];
12020
- if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
12021
- videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
12022
- const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
12023
- const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
12001
+ if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration())) {
12002
+ videoStartTime.current = (videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime()) || 0;
12003
+ const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration()) !== null && _a !== void 0 ? _a : 0).toFixed(2);
12004
+ const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime()) !== null && _b !== void 0 ? _b : 0).toFixed(2);
12024
12005
  const playType = isFirstPlay ? '0' : '1';
12025
12006
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
12026
12007
  eventInfo: {
12027
12008
  eventSubject: 'playVideo',
12028
12009
  eventDescription: 'User played the video',
12029
- contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
12030
- contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
12010
+ contentId: (_d = (_c = item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
12011
+ contentName: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : '',
12031
12012
  playType,
12032
12013
  startTime: videoCurrentTime,
12033
12014
  videoDuration,
12034
- contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
12015
+ contentTags: JSON.stringify((_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []),
12035
12016
  position: index + '',
12036
12017
  contentFormat: 'video',
12037
- traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
12018
+ traceInfo: (_j = item.video) === null || _j === void 0 ? void 0 : _j.traceInfo
12038
12019
  }
12039
12020
  });
12040
12021
  setIsFirstPlay(false);
12041
12022
  }
12042
- }, [bffEventReport, data, index, isFirstPlay]);
12043
- const handleLoadedMetadata = useCallback(() => {
12023
+ }, [bffEventReport, data, index, isFirstPlay, videoRef]);
12024
+ const handleLoadedmetadata = useCallback(() => {
12025
+ if (!videoRef)
12026
+ return;
12027
+ if (activeIndex !== index) {
12028
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
12029
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
12030
+ }
12031
+ setIsLoadFinish(true);
12032
+ }, [activeIndex, index, videoRef]);
12033
+ const handleCanplay = useCallback(() => {
12044
12034
  setIsLoadFinish(true);
12045
12035
  }, []);
12046
12036
  const handleClickVideo = useCallback((type) => () => {
12047
- var _a, _b, _c, _d, _e;
12037
+ if (!videoRef)
12038
+ return;
12048
12039
  if (!isLoadFinish)
12049
12040
  return;
12050
- const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
12041
+ const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused();
12051
12042
  switch (type) {
12052
12043
  case 'start':
12053
12044
  if (!isPause)
12054
12045
  return;
12055
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
12046
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
12056
12047
  setIsPauseVideo(false);
12057
12048
  break;
12058
12049
  case 'pause':
12059
12050
  if (isPause)
12060
12051
  return;
12061
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
12052
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
12062
12053
  setIsPauseVideo(true);
12063
12054
  break;
12064
12055
  default:
12065
12056
  if (isPause) {
12066
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
12057
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
12067
12058
  }
12068
12059
  else {
12069
- (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
12060
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
12070
12061
  }
12071
12062
  setIsPauseVideo(!isPause);
12072
12063
  break;
12073
12064
  }
12074
- }, [isLoadFinish]);
12075
- const onPause = useCallback(() => {
12076
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
12065
+ }, [isLoadFinish, videoRef]);
12066
+ const handlePause = useCallback(() => {
12067
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
12068
+ if (!videoRef)
12069
+ return;
12070
+ if (activeIndex !== index)
12071
+ return;
12077
12072
  const item = data[index];
12078
- const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
12079
- const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
12080
- if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
12081
- const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
12073
+ const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration()) !== null && _a !== void 0 ? _a : 0).toFixed(2);
12074
+ const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime()) !== null && _b !== void 0 ? _b : 0).toFixed(2);
12075
+ if (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration()) {
12076
+ const playDuration = ((videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime()) - videoStartTime.current).toFixed(2);
12082
12077
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
12083
12078
  eventInfo: {
12084
12079
  eventSubject: 'playOverVideo',
12085
12080
  eventDescription: 'User finished playing the video',
12086
- contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
12087
- contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
12081
+ contentId: (_d = (_c = item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
12082
+ contentName: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : '',
12088
12083
  endTime: videoCurrentTime,
12089
12084
  videoDuration,
12090
12085
  playDuration,
12091
- contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
12086
+ contentTags: JSON.stringify((_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []),
12092
12087
  position: index + '',
12093
12088
  contentFormat: 'video',
12094
- traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
12089
+ traceInfo: (_j = item.video) === null || _j === void 0 ? void 0 : _j.traceInfo
12095
12090
  }
12096
12091
  });
12097
12092
  }
12098
- }, [data, index, bffEventReport]);
12093
+ }, [data, index, bffEventReport, videoRef]);
12099
12094
  const blur = useMemo(() => {
12100
12095
  return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
12101
12096
  }, [videoPostConfig]);
@@ -12110,82 +12105,82 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
12110
12105
  return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
12111
12106
  }, [firstFrameSrc, rec]);
12112
12107
  const handLoadeddata = useCallback(() => {
12113
- if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
12108
+ var _a;
12109
+ if (!videoRef)
12114
12110
  return;
12115
- const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
12116
- const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
12117
- const ctx = canvas.getContext('2d');
12118
- const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
12119
- const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
12120
- canvas.height = targetHeight;
12121
- canvas.width = targetWidth;
12122
- ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
12123
- setFirstFrameSrc(canvas.toDataURL());
12124
- }, []);
12111
+ const videoDomRef = document.getElementById(`${videoId}_html5_api`);
12112
+ if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
12113
+ return;
12114
+ const setFrameImg = () => {
12115
+ const video = videoDomRef;
12116
+ const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
12117
+ const ctx = canvas.getContext('2d');
12118
+ const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
12119
+ const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
12120
+ canvas.height = targetHeight;
12121
+ canvas.width = targetWidth;
12122
+ ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
12123
+ setFirstFrameSrc(canvas.toDataURL());
12124
+ };
12125
+ setFrameImg();
12126
+ setTimeout(() => {
12127
+ setFrameImg();
12128
+ }, 500);
12129
+ }, [videoRef]);
12125
12130
  useEffect(() => {
12126
- var _a, _b, _c, _d;
12127
- if (!videoRef.current)
12131
+ if (!isActive || !videoRef)
12132
+ return;
12133
+ const videoSrc = rec.video.url;
12134
+ if (!videoSrc)
12128
12135
  return;
12129
12136
  setIsPauseVideo(false);
12130
- if (!videoRef.current.src) {
12131
- const videoSrc = rec.video.url;
12132
- // if (videoSrc.includes('.m3u8')) {
12133
- // if (Hls.isSupported()) {
12134
- // const hls = new Hls();
12135
- // hls.loadSource(videoSrc);
12136
- // hls.attachMedia(videoRef.current);
12137
- // hls.on(Hls.Events.MANIFEST_PARSED, function () {
12138
- // videoRef?.current?.play();
12139
- // });
12140
- // } else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
12141
- // videoRef.current.src = videoSrc;
12142
- // } else {
12143
- // videoRef.current.src = videoSrc;
12144
- // }
12145
- // } else {
12146
- videoRef.current.src = videoSrc;
12147
- // }
12148
- videoRef.current.setAttribute('x5-playsinline', 'true');
12149
- videoRef.current.setAttribute('webkit-playsinline', 'true');
12150
- }
12151
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
12152
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
12153
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
12154
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
12137
+ const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
12138
+ const dom = document.querySelector('#player-container-id');
12139
+ const dom2 = document.querySelector('#player-container-id-copy');
12140
+ if (!dom && !dom2)
12141
+ return;
12142
+ videoPlayerWrapperNode === null || videoPlayerWrapperNode === void 0 ? void 0 : videoPlayerWrapperNode.appendChild(dom || dom2);
12143
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.src(videoSrc);
12144
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadedmetadata', handleLoadedmetadata);
12145
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadeddata', handLoadeddata);
12146
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('canplay', handleCanplay);
12147
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('playing', handlePlaying);
12148
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('pause', handlePause);
12149
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('ended', handleEnded);
12155
12150
  return () => {
12156
- var _a, _b, _c, _d;
12157
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
12158
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
12159
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
12160
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
12151
+ dom2 === null || dom2 === void 0 ? void 0 : dom2.appendChild(dom);
12152
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('loadedmetadata', handleLoadedmetadata);
12153
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('loadeddata', handLoadeddata);
12154
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('canplay', handleCanplay);
12155
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('playing', handlePlaying);
12156
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('pause', handlePause);
12157
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('ended', handleEnded);
12161
12158
  };
12162
- }, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
12159
+ }, [isActive, videoId, rec, videoRef]);
12163
12160
  useEffect(() => {
12164
- var _a;
12165
- if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
12161
+ if (!videoRef || !isLoadFinish)
12166
12162
  return;
12167
12163
  if (isActive) {
12168
- videoRef.current.play();
12164
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
12169
12165
  }
12170
12166
  else {
12171
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
12167
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
12172
12168
  }
12173
- }, [isActive, isLoadFinish]);
12169
+ }, [isActive, isLoadFinish, videoRef]);
12174
12170
  /*
12175
12171
  打开/关闭hashtag暂停/播放视频
12176
12172
  */
12177
12173
  useEffect(() => {
12178
- var _a, _b, _c;
12179
- if (!isActive || !(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
12174
+ if (!isActive || !videoRef)
12180
12175
  return;
12181
- const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
12176
+ const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused();
12182
12177
  if (!isPause && openHashtag) {
12183
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.pause();
12178
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
12184
12179
  }
12185
12180
  else if (!openHashtag) {
12186
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
12181
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
12187
12182
  }
12188
- }, [openHashtag, isActive]);
12183
+ }, [openHashtag, isActive, videoRef]);
12189
12184
  useEffect(() => {
12190
12185
  if (!isActive)
12191
12186
  return;
@@ -12205,9 +12200,11 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
12205
12200
  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 }));
12206
12201
  }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
12207
12202
  useEffect(() => {
12203
+ if (!videoRef)
12204
+ return;
12208
12205
  const handleBeforeUnload = () => {
12209
- var _a, _b;
12210
- if (activeIndex === index && ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.src) && !isPauseVideo) {
12206
+ var _a;
12207
+ if (activeIndex === index && ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) && videoRef && !isPauseVideo) {
12211
12208
  handleClickVideo('pause')();
12212
12209
  }
12213
12210
  };
@@ -12245,23 +12242,19 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
12245
12242
  right: 0
12246
12243
  } },
12247
12244
  React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
12248
- React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart, style: {
12249
- width: '100%',
12250
- height: '100%',
12251
- objectFit: 'contain'
12252
- } }),
12245
+ React.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
12253
12246
  React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
12254
- renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
12247
+ renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, style: {
12255
12248
  position: 'relative',
12256
12249
  width: '100%',
12257
12250
  height,
12258
12251
  overflow: 'hidden'
12259
- } },
12260
- React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
12252
+ }, onClick: handleClickVideo() },
12253
+ React.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
12261
12254
  renderPoster,
12262
12255
  React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
12263
12256
  };
12264
- var VideoWidget$3 = memo(VideoWidget$2);
12257
+ var VideoWidget$1 = memo(VideoWidget);
12265
12258
 
12266
12259
  /*
12267
12260
  * @Author: binruan@chatlabs.com
@@ -12361,7 +12354,7 @@ const Picture = (props) => {
12361
12354
  * @LastEditTime: 2024-04-18 19:56:22
12362
12355
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
12363
12356
  */
12364
- const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
12357
+ const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
12365
12358
  var _a;
12366
12359
  const ref = useRef();
12367
12360
  const { isActive } = useSwiperSlide();
@@ -12390,7 +12383,7 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageE
12390
12383
  React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
12391
12384
  })));
12392
12385
  };
12393
- var PictureGroup$3 = memo(PictureGroup$2);
12386
+ var PictureGroup$1 = memo(PictureGroup);
12394
12387
 
12395
12388
  /*
12396
12389
  * @Author: binruan@chatlabs.com
@@ -12554,63 +12547,26 @@ var RenderCard$1 = memo(RenderCard);
12554
12547
  *
12555
12548
  */
12556
12549
  const Nudge = ({ nudge }) => {
12557
- var _a, _b, _c, _d, _e, _f, _g;
12558
12550
  return (React.createElement(React.Fragment, null, (nudge === null || nudge === void 0 ? void 0 : nudge.isOpen) && (React.createElement("div", { className: 'clc-sxp-bottom-nudge', style: {
12559
- marginBottom: (_a = nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom) !== null && _a !== void 0 ? _a : 5,
12560
- width: (_c = (_b = nudge === null || nudge === void 0 ? void 0 : nudge.size) === null || _b === void 0 ? void 0 : _b.width) !== null && _c !== void 0 ? _c : 212,
12561
- height: (_e = (_d = nudge === null || nudge === void 0 ? void 0 : nudge.size) === null || _d === void 0 ? void 0 : _d.height) !== null && _e !== void 0 ? _e : 38,
12551
+ marginBottom: nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom,
12552
+ width: nudge === null || nudge === void 0 ? void 0 : nudge.size.width,
12553
+ height: nudge === null || nudge === void 0 ? void 0 : nudge.size.height,
12562
12554
  backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
12563
- borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
12555
+ borderRadius: nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius
12564
12556
  } },
12565
12557
  (nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover' } }) : null,
12566
- React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, (_g = nudge === null || nudge === void 0 ? void 0 : nudge.content) !== null && _g !== void 0 ? _g : '')))));
12558
+ React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, nudge === null || nudge === void 0 ? void 0 : nudge.content)))));
12567
12559
  };
12568
12560
 
12569
- const DEFAULT_TAG = 'FOR U';
12570
- const Tagbar = ({ tagList = [], setActiveIndex }) => {
12571
- const [selectTag, setSelectTag] = useState(DEFAULT_TAG);
12572
- const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = useSxpDataSource();
12573
- const realTagList = useMemo(() => {
12574
- return [DEFAULT_TAG, ...tagList];
12575
- }, [tagList]);
12576
- const handleSelectTag = (tag) => () => {
12577
- if (tag === selectTag)
12578
- return;
12579
- let hashTag;
12580
- if (tag !== DEFAULT_TAG) {
12581
- hashTag = tag;
12582
- }
12583
- setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
12584
- getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ hashTag }).then((res) => {
12585
- var _a, _b, _c, _d;
12586
- setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
12587
- setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
12588
- setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
12589
- setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(0);
12590
- (_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slideTo(0);
12591
- }).finally(() => {
12592
- setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
12593
- });
12594
- setSelectTag(tag);
12595
- };
12596
- if (tagList.length <= 0)
12597
- return null;
12598
- return (React.createElement("div", { className: 'clc-sxp-tagbar', style: { height: 45 } },
12599
- React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
12600
- return (React.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
12601
- }))));
12602
- };
12603
- var Tagbar$1 = memo(Tagbar);
12604
-
12605
12561
  /*
12606
12562
  * @Author: binruan@chatlabs.com
12607
12563
  * @Date: 2024-01-15 19:03:09
12608
12564
  * @LastEditors: binruan@chatlabs.com
12609
- * @LastEditTime: 2024-04-23 15:48:32
12565
+ * @LastEditTime: 2024-04-29 15:48:42
12610
12566
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12611
12567
  *
12612
12568
  */
12613
- const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [] }) => {
12569
+ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle }) => {
12614
12570
  var _a, _b, _c, _d, _e, _f, _g;
12615
12571
  const { schema } = useEditor();
12616
12572
  const [activeIndex, setActiveIndex] = useState(0);
@@ -12622,6 +12578,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12622
12578
  const [isLoadMore, setIsLoadMore] = useState(false);
12623
12579
  const [isShowMore, setIsShowMore] = useState(false);
12624
12580
  const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData } = useSxpDataSource();
12581
+ const [videoRef, setVideoRef] = useState(null);
12582
+ const playerRef = useRef();
12625
12583
  const { productView } = useEventReport();
12626
12584
  const isShowFingerTip = useMemo(() => {
12627
12585
  return data.length > 0 && !loading && getFeUserId();
@@ -12659,6 +12617,25 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12659
12617
  viewTime.current = new Date();
12660
12618
  refreshFeSessionId();
12661
12619
  };
12620
+ const firstRef = useRef();
12621
+ useEffect(() => {
12622
+ if (!firstRef.current && !videoRef) {
12623
+ firstRef.current = true;
12624
+ const player = TCPlayer('player-container-id', {
12625
+ licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1325816236_1/v_cube.license', // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
12626
+ controls: false,
12627
+ autoplay: false,
12628
+ loop: false,
12629
+ muted: true,
12630
+ preload: 'auto',
12631
+ posterImage: false,
12632
+ bigPlayButton: true
12633
+ });
12634
+ player === null || player === void 0 ? void 0 : player.ready(() => {
12635
+ setVideoRef(player);
12636
+ });
12637
+ }
12638
+ }, [videoRef]);
12662
12639
  useEffect(() => {
12663
12640
  if (!isInit)
12664
12641
  handleH5EnterLink();
@@ -12688,8 +12665,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12688
12665
  // sessionDuration: Math.floor(((new Date() as any) - curTime) / 1000) + '',
12689
12666
  // eventSubject: 'sessionCompleted',
12690
12667
  // eventDescription: 'Session completed',
12691
- // contentId: item?.video?.itemId,
12692
- // productId: item?.product?.itemId,
12668
+ // relatedContentId: item?.video?.itemId,
12669
+ // relatedProductId: item?.product?.itemId,
12693
12670
  // position: item?.position
12694
12671
  // }
12695
12672
  // });
@@ -12733,12 +12710,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12733
12710
  sessionDuration: Math.floor((new Date() - curTime.current) / 1000) + '',
12734
12711
  eventSubject: 'sessionCompleted',
12735
12712
  eventDescription: 'Session completed',
12736
- contentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
12737
- productId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
12713
+ relatedContentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
12714
+ relatedProductId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
12738
12715
  position: activeIndex + '',
12739
12716
  fromKName,
12740
12717
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
12741
- ctatId: (_q = (_p = (_o = item.video) === null || _o === void 0 ? void 0 : _o.bindCta) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : ''
12718
+ relatedCtatId: (_q = (_p = (_o = item.video) === null || _o === void 0 ? void 0 : _o.bindCta) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : ''
12742
12719
  }
12743
12720
  });
12744
12721
  }
@@ -12755,15 +12732,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12755
12732
  };
12756
12733
  }, [activeIndex, bffEventReport, curTime, data, handleH5EnterLink, popupDetailData, isFromHashtag, tempMap]);
12757
12734
  const height = useMemo(() => {
12758
- let minusHeight = 0;
12759
- if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
12760
- minusHeight += 45;
12761
- }
12762
- if (tagList.length > 0) {
12763
- minusHeight += 45;
12764
- }
12765
- return containerHeight - minusHeight;
12766
- }, [globalConfig, containerHeight, tagList]);
12735
+ return (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo) ? containerHeight - 45 : containerHeight;
12736
+ }, [globalConfig, containerHeight]);
12767
12737
  const renderLogo = useMemo(() => {
12768
12738
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
12769
12739
  return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
@@ -12774,10 +12744,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12774
12744
  const renderContent = useCallback((rec, index) => {
12775
12745
  var _a, _b, _c, _d;
12776
12746
  if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
12777
- return (React.createElement(VideoWidget$3, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost }));
12747
+ return (React.createElement(VideoWidget$1, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoRef: videoRef }));
12778
12748
  }
12779
12749
  if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
12780
- return (React.createElement(PictureGroup$3, { key: rec.video.itemId, imgUrls: rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
12750
+ return (React.createElement(PictureGroup$1, { key: rec.video.itemId, imgUrls: rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
12781
12751
  }
12782
12752
  if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.length) > 0) {
12783
12753
  return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
@@ -12789,7 +12759,19 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12789
12759
  });
12790
12760
  }
12791
12761
  return null;
12792
- }, [containerWidth, data, height, isMuted, activeIndex, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost, viewTime, tipText, resolver, schema]);
12762
+ }, [
12763
+ containerWidth,
12764
+ data,
12765
+ height,
12766
+ isMuted,
12767
+ activeIndex,
12768
+ globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost,
12769
+ viewTime,
12770
+ tipText,
12771
+ resolver,
12772
+ schema,
12773
+ videoRef
12774
+ ]);
12793
12775
  const onExpandableChange = useCallback((v) => {
12794
12776
  setIsShowMore(v);
12795
12777
  }, []);
@@ -12811,8 +12793,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12811
12793
  ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
12812
12794
  React.createElement("div", { className: 'clc-sxp-bottom' },
12813
12795
  React.createElement(Nudge, { nudge: nudge }),
12814
- (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
12815
- React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver }))) : null,
12796
+ React.createElement("div", { className: 'clc-sxp-bottom-card' },
12797
+ React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
12816
12798
  React.createElement("div", null,
12817
12799
  React.createElement(ExpandableText$1, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
12818
12800
  React.createElement(Hashtag$1, { index: activeIndex, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle })))));
@@ -12879,8 +12861,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12879
12861
  eventInfo: {
12880
12862
  eventSubject: 'scrollDown',
12881
12863
  eventDescription: 'User scroll down',
12882
- contentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
12883
- productId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
12864
+ relatedContentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
12865
+ relatedProductId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
12884
12866
  requestId: null
12885
12867
  }
12886
12868
  });
@@ -12892,8 +12874,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12892
12874
  eventInfo: {
12893
12875
  eventSubject: 'scrollUp',
12894
12876
  eventDescription: 'User scroll up',
12895
- contentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
12896
- productId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
12877
+ relatedContentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
12878
+ relatedProductId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
12897
12879
  requestId: null
12898
12880
  }
12899
12881
  });
@@ -12973,9 +12955,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12973
12955
  setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
12974
12956
  } })),
12975
12957
  renderLogo,
12976
- React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex }),
12977
12958
  isShowFingerTip ? React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
12978
- React.createElement(Swiper, { ref: swiperRef, onActiveIndexChange: (swiper) => {
12959
+ React.createElement(Swiper, { ref: swiperRef, onSlideChange: () => {
12960
+ swiperRef.current.swiper.allowTouchMove = false;
12961
+ setTimeout(() => {
12962
+ swiperRef.current.swiper.allowTouchMove = true;
12963
+ }, 500);
12964
+ }, onActiveIndexChange: (swiper) => {
12979
12965
  setActiveIndex(swiper.activeIndex);
12980
12966
  if (openHashtag)
12981
12967
  return;
@@ -12992,6 +12978,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12992
12978
  }
12993
12979
  }
12994
12980
  },
12981
+ // style={{
12982
+ // pointerEvents: canSwiper ? 'auto' : 'none'
12983
+ // }}
12995
12984
  // onReachEnd={() => {
12996
12985
  // // 由hashtaglist跳转过来时不执行下面的方法
12997
12986
  // if (waterFallData) return;
@@ -13014,367 +13003,17 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
13014
13003
  zIndex: 999
13015
13004
  }, defaultValue: isMuted, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon, onChange: setIsMuted }),
13016
13005
  renderView),
13017
- React.createElement(WaterFall$1, Object.assign({}, (_g = (_f = (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.item) === null || _g === void 0 ? void 0 : _g.props))));
13018
- };
13019
-
13020
- const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
13021
- return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, height: height, style: { width }, loop: true, autoplay: false }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url) => {
13022
- return (React.createElement(SwiperSlide, { key: url },
13023
- React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
13024
- })));
13025
- };
13026
- var PictureGroup$1 = memo(PictureGroup);
13027
-
13028
- const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width }) => {
13029
- const [isPauseVideo, setIsPauseVideo] = useState(false);
13030
- const videoRef = useRef(null);
13031
- const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
13032
- const videoStartTime = useRef(0);
13033
- const [isLoadFinish, setIsLoadFinish] = useState(false);
13034
- const [isFirstPlay, setIsFirstPlay] = useState(true);
13035
- const canvasRef = useRef(null);
13036
- const [firstFrameSrc, setFirstFrameSrc] = useState('');
13037
- useEffect(() => {
13038
- if (!videoRef.current)
13039
- return;
13040
- videoRef.current.muted = muted;
13041
- }, [muted]);
13042
- const handleVideoStart = useCallback(() => {
13043
- var _a;
13044
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
13045
- }, []);
13046
- const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
13047
- const handlePlaying = useCallback(() => {
13048
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
13049
- setIsPauseVideo(false);
13050
- const item = data[index];
13051
- if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
13052
- videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
13053
- const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
13054
- const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
13055
- const playType = isFirstPlay ? '0' : '1';
13056
- bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
13057
- eventInfo: {
13058
- eventSubject: 'playVideo',
13059
- eventDescription: 'User played the video',
13060
- contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
13061
- contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
13062
- playType,
13063
- startTime: videoCurrentTime,
13064
- videoDuration,
13065
- contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
13066
- position: index + '',
13067
- contentFormat: 'video',
13068
- traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
13069
- }
13070
- });
13071
- setIsFirstPlay(false);
13072
- }
13073
- }, [bffEventReport, data, index, isFirstPlay]);
13074
- const handleLoadedMetadata = useCallback(() => {
13075
- setIsLoadFinish(true);
13076
- }, []);
13077
- const handleClickVideo = useCallback((type) => () => {
13078
- var _a, _b, _c, _d, _e;
13079
- if (!isLoadFinish)
13080
- return;
13081
- const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
13082
- switch (type) {
13083
- case 'start':
13084
- if (!isPause)
13085
- return;
13086
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
13087
- setIsPauseVideo(false);
13088
- break;
13089
- case 'pause':
13090
- if (isPause)
13091
- return;
13092
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
13093
- setIsPauseVideo(true);
13094
- break;
13095
- default:
13096
- if (isPause) {
13097
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
13098
- }
13099
- else {
13100
- (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
13101
- }
13102
- setIsPauseVideo(!isPause);
13103
- break;
13104
- }
13105
- }, [isLoadFinish]);
13106
- const onPause = useCallback(() => {
13107
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
13108
- const item = data[index];
13109
- const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
13110
- const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
13111
- if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
13112
- const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
13113
- bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
13114
- eventInfo: {
13115
- eventSubject: 'playOverVideo',
13116
- eventDescription: 'User finished playing the video',
13117
- contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
13118
- contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
13119
- endTime: videoCurrentTime,
13120
- videoDuration,
13121
- playDuration,
13122
- contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
13123
- position: index + '',
13124
- contentFormat: 'video',
13125
- traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
13126
- }
13127
- });
13128
- }
13129
- }, [data, index, bffEventReport]);
13130
- const blur = useMemo(() => {
13131
- return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
13132
- }, [videoPostConfig]);
13133
- const translateY = useMemo(() => {
13134
- var _a;
13135
- return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
13136
- ? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
13137
- : 'translateY(-50%)';
13138
- }, [videoPostConfig]);
13139
- const blurBgSrc = useMemo(() => {
13140
- var _a;
13141
- return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
13142
- }, [firstFrameSrc, rec]);
13143
- const handLoadeddata = useCallback(() => {
13144
- if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
13145
- return;
13146
- const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
13147
- const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
13148
- const ctx = canvas.getContext('2d');
13149
- const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
13150
- const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
13151
- canvas.height = targetHeight;
13152
- canvas.width = targetWidth;
13153
- ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
13154
- setFirstFrameSrc(canvas.toDataURL());
13155
- }, []);
13156
- useEffect(() => {
13157
- var _a, _b, _c, _d;
13158
- if (!videoRef.current)
13159
- return;
13160
- setIsPauseVideo(false);
13161
- if (!videoRef.current.src) {
13162
- const videoSrc = rec.video.url;
13163
- if (videoSrc.includes('.m3u8')) {
13164
- if (Hls.isSupported()) {
13165
- const hls = new Hls();
13166
- hls.loadSource(videoSrc);
13167
- hls.attachMedia(videoRef.current);
13168
- }
13169
- else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
13170
- videoRef.current.src = videoSrc;
13171
- }
13172
- else {
13173
- videoRef.current.src = videoSrc;
13174
- }
13175
- }
13176
- else {
13177
- videoRef.current.src = videoSrc;
13178
- }
13179
- videoRef.current.setAttribute('x5-playsinline', 'true');
13180
- videoRef.current.setAttribute('webkit-playsinline', 'true');
13181
- }
13182
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
13183
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
13184
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
13185
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
13186
- return () => {
13187
- var _a, _b, _c, _d;
13188
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
13189
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
13190
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
13191
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
13192
- };
13193
- }, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
13194
- const renderPoster = useMemo(() => {
13195
- if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
13196
- return null;
13197
- }
13198
- 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 }));
13199
- }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
13200
- useEffect(() => {
13201
- const handleBeforeUnload = () => {
13202
- var _a, _b;
13203
- if (activeIndex === index && ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.src) && !isPauseVideo) {
13204
- handleClickVideo('pause')();
13205
- }
13206
- };
13207
- window.addEventListener('beforeunload', handleBeforeUnload);
13208
- return () => {
13209
- window.removeEventListener('beforeunload', handleBeforeUnload);
13210
- };
13211
- }, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
13212
- const blurStyle = useMemo(() => {
13213
- return blur
13214
- ? {
13215
- filter: 'blur(10px)',
13216
- transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
13217
- }
13218
- : {};
13219
- }, [blur]);
13220
- if (!rec.video) {
13221
- return null;
13222
- }
13223
- return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
13224
- position: 'relative',
13225
- width,
13226
- height,
13227
- overflow: 'hidden'
13228
- } },
13229
- React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height,
13230
- width, objectFit: 'cover' }, blurStyle) }),
13231
- React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
13232
- React.createElement("div", { style: {
13233
- position: 'absolute',
13234
- width,
13235
- height,
13236
- top: '50%',
13237
- transform: translateY,
13238
- left: 0,
13239
- right: 0
13240
- } },
13241
- React.createElement("div", { style: { position: 'relative', width, height: '100%' } },
13242
- React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart, style: {
13243
- width: '100%',
13244
- height,
13245
- objectFit: 'contain'
13246
- } }),
13247
- React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
13248
- renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
13249
- position: 'relative',
13250
- width,
13251
- height,
13252
- overflow: 'hidden'
13253
- } },
13254
- React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
13255
- renderPoster,
13256
- React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
13257
- };
13258
- var VideoWidget$1 = memo(VideoWidget);
13259
-
13260
- const RESOLVER$1 = {};
13261
- Object.values(_materials_).forEach((v) => {
13262
- RESOLVER$1[v.extend.type] = v;
13263
- });
13264
- const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
13265
- const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
13266
- const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [] }) => {
13267
- const height = useMemo(() => {
13268
- let minusHeight = 0;
13269
- if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
13270
- minusHeight += 45;
13271
- }
13272
- if (tagList.length > 0) {
13273
- minusHeight += 45;
13274
- }
13275
- return containerHeight - minusHeight;
13276
- }, [globalConfig, containerHeight, tagList]);
13277
- const renderContent = (rec, index) => {
13278
- var _a, _b, _c, _d;
13279
- if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
13280
- return (React.createElement(VideoWidget$1, { rec: rec, index: index, muted: true, width: containerWidth, data: data !== null && data !== void 0 ? data : [], height: height, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost }));
13281
- }
13282
- if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
13283
- return (React.createElement(PictureGroup$1, { key: rec.video.itemId, imgUrls: rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
13284
- }
13285
- if (rec.product) {
13286
- if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.length) > 0) {
13287
- return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
13288
- var _a, _b, _c, _d, _e, _f, _g, _h;
13289
- const t = RESOLVER$1[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
13290
- const Component = withBindDataSource(t);
13291
- const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
13292
- 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) || {},
13293
- // schema={schema}
13294
- id: value === null || value === void 0 ? void 0 : value.id,
13295
- // viewTime={viewTime.current}
13296
- 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), { width: containerWidth, height, overflow: 'auto' }), index: index })));
13297
- });
13298
- }
13299
- }
13300
- };
13301
- const renderLogo = useMemo(() => {
13302
- if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
13303
- return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
13304
- React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
13305
- }
13306
- return null;
13307
- }, [globalConfig]);
13308
- const CTA = (rec, index) => {
13309
- if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
13310
- return (React.createElement("div", { className: 'clc-sxp-bottom-card' },
13311
- React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1 })));
13312
- }
13313
- return null;
13314
- };
13315
- const renderBottom = (rec, index) => {
13316
- var _a, _b, _c, _d, _e, _f, _g;
13317
- if (rec.video) {
13318
- return (React.createElement(React.Fragment, null,
13319
- ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
13320
- React.createElement("div", { className: 'clc-sxp-bottom' },
13321
- React.createElement(Nudge, { nudge: nudge }),
13322
- CTA(rec, index),
13323
- React.createElement("div", null,
13324
- React.createElement(ExpandableText$1, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }) })),
13325
- React.createElement(Hashtag$1, { index: index, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))));
13326
- }
13327
- return null;
13328
- };
13329
- const likeIcon = useIconLink(defaultLikeIconPath, appDomain);
13330
- const unlikeIcon = useIconLink(defaultUnLikeIconPath, appDomain);
13331
- const renderLikeButton = (rec, index) => {
13332
- var _a, _b, _c, _d;
13333
- if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
13334
- return;
13335
- let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
13336
- if (top < 40) {
13337
- top += 40;
13338
- }
13339
- if (rec.video) {
13340
- return (React.createElement(LikeButton$1, { key: rec.position, activeIcon: (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIcon) !== null && _b !== void 0 ? _b : likeIcon, unActicveIcon: (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unlikeIcon) !== null && _c !== void 0 ? _c : unlikeIcon, position: index, active: rec.isCollected, recData: rec, className: 'clc-sxp-like-button', style: {
13341
- top,
13342
- right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0
13343
- } }));
13344
- }
13345
- return null;
13346
- };
13347
- const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png', appDomain);
13348
- const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png', appDomain);
13349
- const renderView = (rec, index) => {
13350
- var _a, _b, _c, _d;
13351
- return (React.createElement("div", { style: { position: 'relative', border: '1px solid #e1e1e1' } },
13352
- renderLogo,
13353
- React.createElement(Tagbar$1, { tagList: tagList }),
13354
- React.createElement(ToggleButton$1, { style: {
13355
- position: 'absolute',
13356
- right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
13357
- visibility: ((_c = (_b = data === null || data === void 0 ? void 0 : data[index]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.url) ? 'visible' : 'hidden',
13358
- bottom: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _d !== void 0 ? _d : 23,
13359
- zIndex: 999
13360
- }, defaultValue: true, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon }),
13361
- renderContent(rec, index),
13362
- renderBottom(rec, index),
13363
- renderLikeButton(rec, index)));
13364
- };
13365
- return (React.createElement("div", { style: {
13366
- width: '100%',
13367
- height: containerHeight,
13368
- display: 'flex',
13369
- boxSizing: 'border-box',
13370
- gap: 16,
13371
- pointerEvents: 'none',
13372
- userSelect: 'none'
13373
- } }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
13374
- return renderView(rec, index);
13375
- })));
13006
+ React.createElement(WaterFall$1, Object.assign({}, (_g = (_f = (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.item) === null || _g === void 0 ? void 0 : _g.props)),
13007
+ React.createElement("div", { style: { position: 'absolute', zIndex: -100 } },
13008
+ React.createElement("video", { ref: playerRef, id: 'player-container-id', playsInline: true, crossOrigin: 'anonymous', style: {
13009
+ backgroundColor: 'transparent',
13010
+ width: '100%',
13011
+ height: '100%',
13012
+ objectFit: 'cover',
13013
+ pointerEvents: 'none'
13014
+ } }),
13015
+ React.createElement("div", { id: 'player-container-id-copy' }))));
13376
13016
  };
13377
- var index$1 = memo(DiyPortalPreview);
13378
13017
 
13379
13018
  /*
13380
13019
  * @Author: binruan@chatlabs.com
@@ -13469,10 +13108,10 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
13469
13108
  return searchParams;
13470
13109
  }, []);
13471
13110
  return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
13472
- React.createElement(SxpDataSourceProvider$1, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, render: ({ rtcList, tagList }) => {
13111
+ React.createElement(SxpDataSourceProvider$1, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, render: ({ rtcList }) => {
13473
13112
  var _a;
13474
13113
  return (React.createElement(React.Fragment, null,
13475
- React.createElement(SxpPageRender, Object.assign({}, (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER })),
13114
+ React.createElement(SxpPageRender, Object.assign({}, (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { data: rtcList, resolver: RESOLVER })),
13476
13115
  React.createElement(Popup, null)));
13477
13116
  } })));
13478
13117
  };
@@ -13516,5 +13155,4 @@ function useEditorDataProvider() {
13516
13155
  * @FilePath: \pb-sxp-ui\src\index.ts
13517
13156
  */
13518
13157
 
13519
- export { index$1 as DiyPortalPreview, EditorDataProvider, Modal$1 as Modal, SxpDataSourceProvider$1 as SxpDataSourceProvider, index as SxpPageCore, SxpPageRender, index$2 as core, Pagebuilder as default, defaultSetting, _materials_ as materials, useEditorDataProvider };
13520
- //# sourceMappingURL=index.js.map
13158
+ export { EditorDataProvider, Modal$1 as Modal, SxpDataSourceProvider$1 as SxpDataSourceProvider, index as SxpPageCore, SxpPageRender, index$1 as core, Pagebuilder as default, defaultSetting, _materials_ as materials, useEditorDataProvider };