pb-sxp-ui 1.0.40 → 1.0.42

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 +560 -156
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.css +56 -4
  6. package/dist/index.js +559 -156
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.min.cjs +3 -3
  9. package/dist/index.min.cjs.map +1 -1
  10. package/dist/index.min.js +3 -3
  11. package/dist/index.min.js.map +1 -1
  12. package/dist/pb-ui.js +563 -160
  13. package/dist/pb-ui.js.map +1 -1
  14. package/dist/pb-ui.min.js +3 -3
  15. package/dist/pb-ui.min.js.map +1 -1
  16. package/es/core/components/DiyPortalPreview/PictureGroup.d.ts +13 -0
  17. package/es/core/components/DiyPortalPreview/PictureGroup.js +11 -0
  18. package/es/core/components/DiyPortalPreview/VideoWidget.d.ts +15 -0
  19. package/es/core/components/DiyPortalPreview/VideoWidget.js +236 -0
  20. package/es/core/components/DiyPortalPreview/index.d.ts +6 -0
  21. package/es/core/components/DiyPortalPreview/index.js +127 -0
  22. package/es/core/components/SxpPageCore/index.js +2 -2
  23. package/es/core/components/SxpPageRender/Nudge/index.js +6 -5
  24. package/es/core/components/SxpPageRender/PictureGroup/Picture.js +1 -0
  25. package/es/core/components/SxpPageRender/Tagbar.d.ts +7 -0
  26. package/es/core/components/SxpPageRender/Tagbar.js +37 -0
  27. package/es/core/components/SxpPageRender/VideoWidget/index.js +46 -79
  28. package/es/core/components/SxpPageRender/WaterFall/index.js +1 -1
  29. package/es/core/components/SxpPageRender/index.d.ts +2 -0
  30. package/es/core/components/SxpPageRender/index.js +22 -18
  31. package/es/core/context/SxpDataSourceProvider.d.ts +3 -0
  32. package/es/core/context/SxpDataSourceProvider.js +29 -5
  33. package/es/core/hooks/useEventReport.js +4 -4
  34. package/es/index.d.ts +1 -0
  35. package/es/index.js +1 -0
  36. package/es/materials/sxp/popup/CommodityDetail/index.js +10 -10
  37. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +10 -10
  38. package/lib/core/components/DiyPortalPreview/PictureGroup.d.ts +13 -0
  39. package/lib/core/components/DiyPortalPreview/PictureGroup.js +14 -0
  40. package/lib/core/components/DiyPortalPreview/VideoWidget.d.ts +15 -0
  41. package/lib/core/components/DiyPortalPreview/VideoWidget.js +239 -0
  42. package/lib/core/components/DiyPortalPreview/index.d.ts +6 -0
  43. package/lib/core/components/DiyPortalPreview/index.js +130 -0
  44. package/lib/core/components/SxpPageCore/index.js +2 -2
  45. package/lib/core/components/SxpPageRender/Nudge/index.js +6 -5
  46. package/lib/core/components/SxpPageRender/PictureGroup/Picture.js +1 -0
  47. package/lib/core/components/SxpPageRender/Tagbar.d.ts +7 -0
  48. package/lib/core/components/SxpPageRender/Tagbar.js +40 -0
  49. package/lib/core/components/SxpPageRender/VideoWidget/index.js +46 -79
  50. package/lib/core/components/SxpPageRender/WaterFall/index.js +1 -1
  51. package/lib/core/components/SxpPageRender/index.d.ts +2 -0
  52. package/lib/core/components/SxpPageRender/index.js +22 -18
  53. package/lib/core/context/SxpDataSourceProvider.d.ts +3 -0
  54. package/lib/core/context/SxpDataSourceProvider.js +29 -5
  55. package/lib/core/hooks/useEventReport.js +4 -4
  56. package/lib/index.d.ts +1 -0
  57. package/lib/index.js +3 -1
  58. package/lib/materials/sxp/popup/CommodityDetail/index.js +10 -10
  59. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +10 -10
  60. package/package.json +115 -114
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ 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';
10
11
 
11
12
  /******************************************************************************
12
13
  Copyright (c) Microsoft Corporation.
@@ -407,7 +408,8 @@ function useIconLink(path, domain) {
407
408
  }
408
409
 
409
410
  const SxpDataSourceContext = createContext({
410
- rtcList: []
411
+ rtcList: [],
412
+ tagList: []
411
413
  });
412
414
  var DataSourceType;
413
415
  (function (DataSourceType) {
@@ -416,6 +418,7 @@ var DataSourceType;
416
418
  const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
417
419
  const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false }) => {
418
420
  const [rtcList, setRtcList] = useState([]);
421
+ const [tagList, setTagList] = useState([]);
419
422
  const [loading, setLoading] = useState(false);
420
423
  const [curReqInfo, setCurReqInfo] = useState({ rtc: '', requestId: '' });
421
424
  const swiperRef = useRef(null);
@@ -539,6 +542,19 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
539
542
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
540
543
  return res === null || res === void 0 ? void 0 : res.success;
541
544
  }), [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]);
542
558
  const ctaEvent = useCallback((eventInfo, rec, product, position) => {
543
559
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
544
560
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
@@ -554,11 +570,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
554
570
  fromKName = 'imagePage';
555
571
  }
556
572
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
557
- 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 })
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
574
  });
559
575
  }, [bffEventReport, isFromHashtag]);
560
576
  useEffect(() => {
561
577
  setLoading(true);
578
+ bffGetTagList();
562
579
  getRecommendVideos()
563
580
  .then((data) => {
564
581
  var _a, _b;
@@ -574,6 +591,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
574
591
  if (!isInit.current)
575
592
  return;
576
593
  setLoading(true);
594
+ bffGetTagList();
577
595
  getRecommendVideos()
578
596
  .then((data) => {
579
597
  var _a, _b;
@@ -583,7 +601,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
583
601
  .finally(() => {
584
602
  setLoading(false);
585
603
  });
586
- }, [getRecommendVideos]);
604
+ }, [getRecommendVideos, bffGetTagList]);
587
605
  const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
588
606
  return (React.createElement(SxpDataSourceContext.Provider, { value: {
589
607
  rtcList,
@@ -615,8 +633,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
615
633
  appDomain,
616
634
  hashTagSize,
617
635
  loadingImage: loadingImage !== null && loadingImage !== void 0 ? loadingImage : defaultLoadingImage,
618
- isOpenHashTag
619
- } }, render({ rtcList, mutateLike: bffMutateLike, mutateUnlike: bffMutateUnlike, submitForm: bffSubmitForm })));
636
+ isOpenHashTag,
637
+ tagList,
638
+ setLoading
639
+ } }, render({
640
+ rtcList,
641
+ mutateLike: bffMutateLike,
642
+ mutateUnlike: bffMutateUnlike,
643
+ submitForm: bffSubmitForm,
644
+ tagList
645
+ })));
620
646
  };
621
647
  var SxpDataSourceProvider$1 = memo(SxpDataSourceProvider);
622
648
 
@@ -841,7 +867,7 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
841
867
  React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
842
868
  });
843
869
 
844
- var index$1 = /*#__PURE__*/Object.freeze({
870
+ var index$2 = /*#__PURE__*/Object.freeze({
845
871
  __proto__: null,
846
872
  EditorCore: EditorCore
847
873
  });
@@ -8127,8 +8153,8 @@ function useEventReport() {
8127
8153
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
8128
8154
  contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
8129
8155
  position: position + '',
8130
- 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 : '',
8131
- relatedCtatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
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 : '',
8132
8158
  traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
8133
8159
  }
8134
8160
  });
@@ -8152,8 +8178,8 @@ function useEventReport() {
8152
8178
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
8153
8179
  contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
8154
8180
  position: position + '',
8155
- relatedContentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
8156
- relatedCtatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
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,
8157
8183
  traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
8158
8184
  timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
8159
8185
  eventSubject: 'productView',
@@ -8316,7 +8342,7 @@ const FormatImage = forwardRef((props, ref) => {
8316
8342
  var FormatImage$1 = memo(FormatImage);
8317
8343
 
8318
8344
  const CommodityDetail$1 = (_a) => {
8319
- var _b, _c, _d, _e, _f, _g, _h, _j;
8345
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k;
8320
8346
  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"]);
8321
8347
  const { sxpParameter } = useSxpDataSource();
8322
8348
  const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
@@ -8357,7 +8383,7 @@ const CommodityDetail$1 = (_a) => {
8357
8383
  return '$7,000';
8358
8384
  }
8359
8385
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
8360
- const width = isPreview ? 375 : window.innerWidth;
8386
+ const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
8361
8387
  const renderContent = ({ isPost }) => {
8362
8388
  var _a, _b, _c;
8363
8389
  return (React.createElement("div", null,
@@ -8365,10 +8391,10 @@ const CommodityDetail$1 = (_a) => {
8365
8391
  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'),
8366
8392
  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),
8367
8393
  React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
8368
- 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
8369
- bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
8370
- collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
8371
- necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
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
8372
8398
  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 }))));
8373
8399
  };
8374
8400
  const renderBtn = () => {
@@ -8377,7 +8403,7 @@ const CommodityDetail$1 = (_a) => {
8377
8403
  };
8378
8404
  return (React.createElement("div", { className: 'pb-commondity' },
8379
8405
  React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
8380
- 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: {
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: {
8381
8407
  clickable: true,
8382
8408
  bulletActiveClass: 'swipe-item-active-bullet',
8383
8409
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -8385,7 +8411,7 @@ const CommodityDetail$1 = (_a) => {
8385
8411
  : 'commondityDetail-swiper-clickable-center'
8386
8412
  }, loop: true, autoplay: {
8387
8413
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
8388
- } }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
8414
+ } }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
8389
8415
  return (React.createElement(SwiperSlide, { key: src },
8390
8416
  React.createElement("div", { style: {
8391
8417
  overflow: 'hidden',
@@ -8394,7 +8420,7 @@ const CommodityDetail$1 = (_a) => {
8394
8420
  } },
8395
8421
  React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
8396
8422
  }))),
8397
- !((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css({
8423
+ !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css({
8398
8424
  position: 'relative',
8399
8425
  height: 0,
8400
8426
  width: '100%',
@@ -8407,7 +8433,7 @@ const CommodityDetail$1 = (_a) => {
8407
8433
  top: 0,
8408
8434
  objectFit: 'cover',
8409
8435
  width: '100%'
8410
- }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
8436
+ }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
8411
8437
  React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
8412
8438
  renderBtn(),
8413
8439
  React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
@@ -8767,7 +8793,7 @@ var settingRender$2 = [
8767
8793
  ];
8768
8794
 
8769
8795
  const CommodityDetailDiroNew$1 = (_a) => {
8770
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
8796
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
8771
8797
  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"]);
8772
8798
  useState(true);
8773
8799
  const { sxpParameter } = useSxpDataSource();
@@ -8815,16 +8841,16 @@ const CommodityDetailDiroNew$1 = (_a) => {
8815
8841
  return '£102,300.00';
8816
8842
  }
8817
8843
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
8818
- const width = isPreview ? 375 : window.innerWidth;
8844
+ const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
8819
8845
  const productInfoText = ({ isPost }) => {
8820
8846
  return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
8821
8847
  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) ||
8822
- `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
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
8823
8849
  Made in Italy` })));
8824
8850
  };
8825
8851
  return (React.createElement("div", { className: 'pb-commondityDiroNew' },
8826
8852
  React.createElement("div", Object.assign({ ref: scrollRef, className: css(Object.assign({}, style)) }, props),
8827
- 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: {
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: {
8828
8854
  clickable: true,
8829
8855
  bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
8830
8856
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -8832,7 +8858,7 @@ Made in Italy` })));
8832
8858
  : 'commondityDiroNew-swiper-clickable-center'
8833
8859
  }, loop: true, autoplay: {
8834
8860
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
8835
- } }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
8861
+ } }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
8836
8862
  return (React.createElement(SwiperSlide, { key: src },
8837
8863
  React.createElement("div", { style: {
8838
8864
  overflow: 'hidden',
@@ -8841,7 +8867,7 @@ Made in Italy` })));
8841
8867
  } },
8842
8868
  React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
8843
8869
  }))),
8844
- !((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css({
8870
+ !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css({
8845
8871
  position: 'relative',
8846
8872
  height: 0,
8847
8873
  width: '100%',
@@ -8854,16 +8880,16 @@ Made in Italy` })));
8854
8880
  top: 0,
8855
8881
  objectFit: 'cover',
8856
8882
  width: '100%'
8857
- }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
8883
+ }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
8858
8884
  React.createElement("div", { className: 'pb-commondityDiroNew-content' },
8859
8885
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
8860
8886
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
8861
- 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'),
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'),
8862
8888
  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')),
8863
8889
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
8864
8890
  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),
8865
- 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 : '税费'))),
8866
- (!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')),
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')),
8867
8893
  productInfoText({ isPost }))),
8868
8894
  React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
8869
8895
  };
@@ -11771,7 +11797,7 @@ const WaterFall = (props) => {
11771
11797
  }
11772
11798
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
11773
11799
  eventInfo: {
11774
- relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
11800
+ contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
11775
11801
  position: cacheActiveIndex + '',
11776
11802
  contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
11777
11803
  traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
@@ -11904,14 +11930,14 @@ var _materials_ = /*#__PURE__*/Object.freeze({
11904
11930
  Prompt: Prompt
11905
11931
  });
11906
11932
 
11907
- const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
11908
- const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
11933
+ const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
11934
+ const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
11909
11935
  const LikeButton = (_a) => {
11910
11936
  var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
11911
11937
  const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
11912
11938
  const [state, setState] = useState(active);
11913
- const likeIcon = useIconLink(defaultLikeIconPath);
11914
- const unlikeIcon = useIconLink(defaultUnLikeIconPath);
11939
+ const likeIcon = useIconLink(defaultLikeIconPath$1);
11940
+ const unlikeIcon = useIconLink(defaultUnLikeIconPath$1);
11915
11941
  const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
11916
11942
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
11917
11943
  if (state) {
@@ -11967,7 +11993,7 @@ var SXP_EVENT_TYPE;
11967
11993
  SXP_EVENT_TYPE["PAGE_DID_HIDE"] = "pageDidHide";
11968
11994
  })(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
11969
11995
 
11970
- const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig }) => {
11996
+ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig }) => {
11971
11997
  const [isPauseVideo, setIsPauseVideo] = useState(false);
11972
11998
  const videoRef = useRef(null);
11973
11999
  const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
@@ -11977,13 +12003,12 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
11977
12003
  const { isActive } = useSwiperSlide();
11978
12004
  const canvasRef = useRef(null);
11979
12005
  const [firstFrameSrc, setFirstFrameSrc] = useState('');
11980
- const videoId = `pb-video-${index}`;
11981
12006
  useEffect(() => {
11982
12007
  if (!videoRef.current)
11983
12008
  return;
11984
- videoRef.current.muted(muted);
12009
+ videoRef.current.muted = muted;
11985
12010
  }, [muted]);
11986
- const handleEnded = useCallback(() => {
12011
+ const handleVideoStart = useCallback(() => {
11987
12012
  var _a;
11988
12013
  (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
11989
12014
  }, []);
@@ -11992,10 +12017,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
11992
12017
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
11993
12018
  setIsPauseVideo(false);
11994
12019
  const item = data[index];
11995
- if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration())) {
11996
- videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime()) || 0;
11997
- const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration()) !== null && _d !== void 0 ? _d : 0).toFixed(2);
11998
- const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime()) !== null && _f !== void 0 ? _f : 0).toFixed(2);
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);
11999
12024
  const playType = isFirstPlay ? '0' : '1';
12000
12025
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
12001
12026
  eventInfo: {
@@ -12015,15 +12040,14 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12015
12040
  setIsFirstPlay(false);
12016
12041
  }
12017
12042
  }, [bffEventReport, data, index, isFirstPlay]);
12018
- const handleCanplay = useCallback(() => {
12019
- handLoadeddata();
12043
+ const handleLoadedMetadata = useCallback(() => {
12020
12044
  setIsLoadFinish(true);
12021
12045
  }, []);
12022
12046
  const handleClickVideo = useCallback((type) => () => {
12023
12047
  var _a, _b, _c, _d, _e;
12024
12048
  if (!isLoadFinish)
12025
12049
  return;
12026
- const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused();
12050
+ const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
12027
12051
  switch (type) {
12028
12052
  case 'start':
12029
12053
  if (!isPause)
@@ -12048,13 +12072,13 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12048
12072
  break;
12049
12073
  }
12050
12074
  }, [isLoadFinish]);
12051
- const handlePause = useCallback(() => {
12075
+ const onPause = useCallback(() => {
12052
12076
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
12053
12077
  const item = data[index];
12054
- const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration()) !== null && _b !== void 0 ? _b : 0).toFixed(2);
12055
- const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime()) !== null && _d !== void 0 ? _d : 0).toFixed(2);
12056
- if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration()) {
12057
- const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime()) - videoStartTime.current).toFixed(2);
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);
12058
12082
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
12059
12083
  eventInfo: {
12060
12084
  eventSubject: 'playOverVideo',
@@ -12086,66 +12110,56 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12086
12110
  return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
12087
12111
  }, [firstFrameSrc, rec]);
12088
12112
  const handLoadeddata = useCallback(() => {
12089
- var _a;
12090
- const videoDomRef = document.getElementById(`${videoId}_html5_api`);
12091
- if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
12113
+ if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
12092
12114
  return;
12093
- const setFrameImg = () => {
12094
- const video = videoDomRef;
12095
- const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
12096
- const ctx = canvas.getContext('2d');
12097
- const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
12098
- const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
12099
- canvas.height = targetHeight;
12100
- canvas.width = targetWidth;
12101
- ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
12102
- setFirstFrameSrc(canvas.toDataURL());
12103
- };
12104
- setFrameImg();
12105
- setTimeout(() => {
12106
- setFrameImg();
12107
- }, 500);
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());
12108
12124
  }, []);
12109
12125
  useEffect(() => {
12110
- var _a, _b, _c, _d, _e;
12126
+ var _a, _b, _c, _d;
12127
+ if (!videoRef.current)
12128
+ return;
12111
12129
  setIsPauseVideo(false);
12112
- const videoSrc = rec.video.url;
12113
- if (videoSrc && typeof TCPlayer === 'function') {
12114
- videoRef.current = TCPlayer(videoId, {
12115
- sources: [
12116
- {
12117
- src: videoSrc // 播放地址
12118
- }
12119
- ],
12120
- licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1325816236_1/v_cube.license', // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
12121
- controls: false,
12122
- autoplay: false,
12123
- loop: false,
12124
- muted: true,
12125
- preload: 'auto',
12126
- posterImage: false,
12127
- bigPlayButton: true
12128
- });
12129
- videoRef.current.play();
12130
- videoRef.current.pause();
12131
- }
12132
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.on('loadedmetadata', handleCanplay);
12133
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.on('canplay', handleCanplay);
12134
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.on('playing', handlePlaying);
12135
- // videoRef.current?.on('loadeddata', handLoadeddata);
12136
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.on('pause', handlePause);
12137
- (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.on('ended', handleEnded);
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);
12138
12155
  return () => {
12139
- var _a, _b, _c, _d, _e;
12140
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.off('loadedmetadata', handleCanplay);
12141
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.off('canplay', handleCanplay);
12142
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.off('playing', handlePlaying);
12143
- // videoRef.current?.off('loadeddata', handLoadeddata);
12144
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.off('pause', handlePause);
12145
- (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.off('ended', handleEnded);
12146
- videoRef.current.dispose();
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);
12147
12161
  };
12148
- }, []);
12162
+ }, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
12149
12163
  useEffect(() => {
12150
12164
  var _a;
12151
12165
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
@@ -12231,31 +12245,23 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12231
12245
  right: 0
12232
12246
  } },
12233
12247
  React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
12234
- React.createElement("video", { id: `pb-video-${index}`, playsInline: true, crossOrigin: 'anonymous', style: {
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: {
12235
12249
  width: '100%',
12236
12250
  height: '100%',
12237
- objectFit: 'contain',
12238
- backgroundColor: 'transparent',
12239
- pointerEvents: 'none'
12251
+ objectFit: 'contain'
12240
12252
  } }),
12241
12253
  React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
12242
- renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, style: {
12254
+ renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
12243
12255
  position: 'relative',
12244
12256
  width: '100%',
12245
12257
  height,
12246
12258
  overflow: 'hidden'
12247
- }, onClick: handleClickVideo() },
12248
- React.createElement("video", { id: `pb-video-${index}`, playsInline: true, crossOrigin: 'anonymous', style: {
12249
- backgroundColor: 'transparent',
12250
- width: '100%',
12251
- height: '100%',
12252
- objectFit: 'cover',
12253
- pointerEvents: 'none'
12254
- } }),
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 }),
12255
12261
  renderPoster,
12256
12262
  React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
12257
12263
  };
12258
- var VideoWidget$1 = memo(VideoWidget);
12264
+ var VideoWidget$3 = memo(VideoWidget$2);
12259
12265
 
12260
12266
  /*
12261
12267
  * @Author: binruan@chatlabs.com
@@ -12306,7 +12312,7 @@ const FingerSwipeTip = ({ imageUrl }) => {
12306
12312
  * @Author: binruan@chatlabs.com
12307
12313
  * @Date: 2024-03-20 10:27:31
12308
12314
  * @LastEditors: binruan@chatlabs.com
12309
- * @LastEditTime: 2024-04-22 14:04:00
12315
+ * @LastEditTime: 2024-04-26 14:33:25
12310
12316
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\Picture.tsx
12311
12317
  *
12312
12318
  */
@@ -12338,6 +12344,7 @@ const Picture = (props) => {
12338
12344
  React.createElement(FormatImage$1, { src: src, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) }),
12339
12345
  blur && (React.createElement(FormatImage$1, { src: src, style: {
12340
12346
  width: '100%',
12347
+ height: '100%',
12341
12348
  objectFit: 'contain',
12342
12349
  position: 'absolute',
12343
12350
  top: '50%',
@@ -12354,7 +12361,7 @@ const Picture = (props) => {
12354
12361
  * @LastEditTime: 2024-04-18 19:56:22
12355
12362
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
12356
12363
  */
12357
- const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
12364
+ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
12358
12365
  var _a;
12359
12366
  const ref = useRef();
12360
12367
  const { isActive } = useSwiperSlide();
@@ -12383,7 +12390,7 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd
12383
12390
  React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
12384
12391
  })));
12385
12392
  };
12386
- var PictureGroup$1 = memo(PictureGroup);
12393
+ var PictureGroup$3 = memo(PictureGroup$2);
12387
12394
 
12388
12395
  /*
12389
12396
  * @Author: binruan@chatlabs.com
@@ -12547,26 +12554,63 @@ var RenderCard$1 = memo(RenderCard);
12547
12554
  *
12548
12555
  */
12549
12556
  const Nudge = ({ nudge }) => {
12557
+ var _a, _b, _c, _d, _e, _f, _g;
12550
12558
  return (React.createElement(React.Fragment, null, (nudge === null || nudge === void 0 ? void 0 : nudge.isOpen) && (React.createElement("div", { className: 'clc-sxp-bottom-nudge', style: {
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,
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,
12554
12562
  backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
12555
- borderRadius: nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius
12563
+ borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
12556
12564
  } },
12557
12565
  (nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover' } }) : null,
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)))));
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 : '')))));
12559
12567
  };
12560
12568
 
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
+
12561
12605
  /*
12562
12606
  * @Author: binruan@chatlabs.com
12563
12607
  * @Date: 2024-01-15 19:03:09
12564
12608
  * @LastEditors: binruan@chatlabs.com
12565
- * @LastEditTime: 2024-04-25 17:03:41
12609
+ * @LastEditTime: 2024-04-23 15:48:32
12566
12610
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12567
12611
  *
12568
12612
  */
12569
- const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle }) => {
12613
+ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [] }) => {
12570
12614
  var _a, _b, _c, _d, _e, _f, _g;
12571
12615
  const { schema } = useEditor();
12572
12616
  const [activeIndex, setActiveIndex] = useState(0);
@@ -12644,8 +12688,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12644
12688
  // sessionDuration: Math.floor(((new Date() as any) - curTime) / 1000) + '',
12645
12689
  // eventSubject: 'sessionCompleted',
12646
12690
  // eventDescription: 'Session completed',
12647
- // relatedContentId: item?.video?.itemId,
12648
- // relatedProductId: item?.product?.itemId,
12691
+ // contentId: item?.video?.itemId,
12692
+ // productId: item?.product?.itemId,
12649
12693
  // position: item?.position
12650
12694
  // }
12651
12695
  // });
@@ -12689,12 +12733,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12689
12733
  sessionDuration: Math.floor((new Date() - curTime.current) / 1000) + '',
12690
12734
  eventSubject: 'sessionCompleted',
12691
12735
  eventDescription: 'Session completed',
12692
- relatedContentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
12693
- relatedProductId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
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,
12694
12738
  position: activeIndex + '',
12695
12739
  fromKName,
12696
12740
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
12697
- 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 : ''
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 : ''
12698
12742
  }
12699
12743
  });
12700
12744
  }
@@ -12711,8 +12755,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12711
12755
  };
12712
12756
  }, [activeIndex, bffEventReport, curTime, data, handleH5EnterLink, popupDetailData, isFromHashtag, tempMap]);
12713
12757
  const height = useMemo(() => {
12714
- return (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo) ? containerHeight - 45 : containerHeight;
12715
- }, [globalConfig, containerHeight]);
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]);
12716
12767
  const renderLogo = useMemo(() => {
12717
12768
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
12718
12769
  return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
@@ -12723,10 +12774,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12723
12774
  const renderContent = useCallback((rec, index) => {
12724
12775
  var _a, _b, _c, _d;
12725
12776
  if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
12726
- 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 }));
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 }));
12727
12778
  }
12728
12779
  if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
12729
- 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 }));
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 }));
12730
12781
  }
12731
12782
  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) {
12732
12783
  return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
@@ -12760,8 +12811,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12760
12811
  ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
12761
12812
  React.createElement("div", { className: 'clc-sxp-bottom' },
12762
12813
  React.createElement(Nudge, { nudge: nudge }),
12763
- React.createElement("div", { className: 'clc-sxp-bottom-card' },
12764
- React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
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,
12765
12816
  React.createElement("div", null,
12766
12817
  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 }),
12767
12818
  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 })))));
@@ -12828,8 +12879,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12828
12879
  eventInfo: {
12829
12880
  eventSubject: 'scrollDown',
12830
12881
  eventDescription: 'User scroll down',
12831
- relatedContentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
12832
- relatedProductId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
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 : '',
12833
12884
  requestId: null
12834
12885
  }
12835
12886
  });
@@ -12841,8 +12892,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12841
12892
  eventInfo: {
12842
12893
  eventSubject: 'scrollUp',
12843
12894
  eventDescription: 'User scroll up',
12844
- relatedContentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
12845
- relatedProductId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
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 : '',
12846
12897
  requestId: null
12847
12898
  }
12848
12899
  });
@@ -12922,13 +12973,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12922
12973
  setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
12923
12974
  } })),
12924
12975
  renderLogo,
12976
+ React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex }),
12925
12977
  isShowFingerTip ? React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
12926
- React.createElement(Swiper, { ref: swiperRef, onSlideChange: () => {
12927
- swiperRef.current.swiper.allowTouchMove = false;
12928
- setTimeout(() => {
12929
- swiperRef.current.swiper.allowTouchMove = true;
12930
- }, 500);
12931
- }, onActiveIndexChange: (swiper) => {
12978
+ React.createElement(Swiper, { ref: swiperRef, onActiveIndexChange: (swiper) => {
12932
12979
  setActiveIndex(swiper.activeIndex);
12933
12980
  if (openHashtag)
12934
12981
  return;
@@ -12945,9 +12992,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12945
12992
  }
12946
12993
  }
12947
12994
  },
12948
- // style={{
12949
- // pointerEvents: canSwiper ? 'auto' : 'none'
12950
- // }}
12951
12995
  // onReachEnd={() => {
12952
12996
  // // 由hashtaglist跳转过来时不执行下面的方法
12953
12997
  // if (waterFallData) return;
@@ -12973,6 +13017,365 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12973
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))));
12974
13018
  };
12975
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
+ })));
13376
+ };
13377
+ var index$1 = memo(DiyPortalPreview);
13378
+
12976
13379
  /*
12977
13380
  * @Author: binruan@chatlabs.com
12978
13381
  * @Date: 2023-10-31 10:56:01
@@ -13066,10 +13469,10 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
13066
13469
  return searchParams;
13067
13470
  }, []);
13068
13471
  return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
13069
- 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 }) => {
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 }) => {
13070
13473
  var _a;
13071
13474
  return (React.createElement(React.Fragment, null,
13072
- 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 })),
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 })),
13073
13476
  React.createElement(Popup, null)));
13074
13477
  } })));
13075
13478
  };
@@ -13113,5 +13516,5 @@ function useEditorDataProvider() {
13113
13516
  * @FilePath: \pb-sxp-ui\src\index.ts
13114
13517
  */
13115
13518
 
13116
- 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 };
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 };
13117
13520
  //# sourceMappingURL=index.js.map