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.cjs CHANGED
@@ -11,6 +11,7 @@ var css = require('@emotion/css');
11
11
  var proComponents = require('@ant-design/pro-components');
12
12
  var ReactDOM = require('react-dom');
13
13
  var EventEmitter = require('eventemitter3');
14
+ var Hls = require('hls.js');
14
15
 
15
16
  function _interopNamespaceDefault(e) {
16
17
  var n = Object.create(null);
@@ -430,7 +431,8 @@ function useIconLink(path, domain) {
430
431
  }
431
432
 
432
433
  const SxpDataSourceContext = React.createContext({
433
- rtcList: []
434
+ rtcList: [],
435
+ tagList: []
434
436
  });
435
437
  var DataSourceType;
436
438
  (function (DataSourceType) {
@@ -439,6 +441,7 @@ var DataSourceType;
439
441
  const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
440
442
  const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false }) => {
441
443
  const [rtcList, setRtcList] = React.useState([]);
444
+ const [tagList, setTagList] = React.useState([]);
442
445
  const [loading, setLoading] = React.useState(false);
443
446
  const [curReqInfo, setCurReqInfo] = React.useState({ rtc: '', requestId: '' });
444
447
  const swiperRef = React.useRef(null);
@@ -562,6 +565,19 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
562
565
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
563
566
  return res === null || res === void 0 ? void 0 : res.success;
564
567
  }), [bffFetch]);
568
+ // 获取 Tag
569
+ const bffGetTagList = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
570
+ var _g, _h;
571
+ if (!utmVal)
572
+ return;
573
+ try {
574
+ const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: utmVal } }));
575
+ 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 : []);
576
+ }
577
+ catch (e) {
578
+ console.log('e', e);
579
+ }
580
+ }), [bffFetch, utmVal]);
565
581
  const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
566
582
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
567
583
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
@@ -577,11 +593,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
577
593
  fromKName = 'imagePage';
578
594
  }
579
595
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
580
- 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 })
596
+ 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 })
581
597
  });
582
598
  }, [bffEventReport, isFromHashtag]);
583
599
  React.useEffect(() => {
584
600
  setLoading(true);
601
+ bffGetTagList();
585
602
  getRecommendVideos()
586
603
  .then((data) => {
587
604
  var _a, _b;
@@ -597,6 +614,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
597
614
  if (!isInit.current)
598
615
  return;
599
616
  setLoading(true);
617
+ bffGetTagList();
600
618
  getRecommendVideos()
601
619
  .then((data) => {
602
620
  var _a, _b;
@@ -606,7 +624,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
606
624
  .finally(() => {
607
625
  setLoading(false);
608
626
  });
609
- }, [getRecommendVideos]);
627
+ }, [getRecommendVideos, bffGetTagList]);
610
628
  const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
611
629
  return (React.createElement(SxpDataSourceContext.Provider, { value: {
612
630
  rtcList,
@@ -638,8 +656,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
638
656
  appDomain,
639
657
  hashTagSize,
640
658
  loadingImage: loadingImage !== null && loadingImage !== void 0 ? loadingImage : defaultLoadingImage,
641
- isOpenHashTag
642
- } }, render({ rtcList, mutateLike: bffMutateLike, mutateUnlike: bffMutateUnlike, submitForm: bffSubmitForm })));
659
+ isOpenHashTag,
660
+ tagList,
661
+ setLoading
662
+ } }, render({
663
+ rtcList,
664
+ mutateLike: bffMutateLike,
665
+ mutateUnlike: bffMutateUnlike,
666
+ submitForm: bffSubmitForm,
667
+ tagList
668
+ })));
643
669
  };
644
670
  var SxpDataSourceProvider$1 = React.memo(SxpDataSourceProvider);
645
671
 
@@ -864,7 +890,7 @@ const EditorCore = React.forwardRef(({ children, resolver, isSsr, schema, enable
864
890
  React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
865
891
  });
866
892
 
867
- var index$1 = /*#__PURE__*/Object.freeze({
893
+ var index$2 = /*#__PURE__*/Object.freeze({
868
894
  __proto__: null,
869
895
  EditorCore: EditorCore
870
896
  });
@@ -8150,8 +8176,8 @@ function useEventReport() {
8150
8176
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
8151
8177
  contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
8152
8178
  position: position + '',
8153
- 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 : '',
8154
- relatedCtatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
8179
+ 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 : '',
8180
+ ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
8155
8181
  traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
8156
8182
  }
8157
8183
  });
@@ -8175,8 +8201,8 @@ function useEventReport() {
8175
8201
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
8176
8202
  contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
8177
8203
  position: position + '',
8178
- relatedContentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
8179
- relatedCtatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
8204
+ contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
8205
+ ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
8180
8206
  traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
8181
8207
  timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
8182
8208
  eventSubject: 'productView',
@@ -8339,7 +8365,7 @@ const FormatImage = React.forwardRef((props, ref) => {
8339
8365
  var FormatImage$1 = React.memo(FormatImage);
8340
8366
 
8341
8367
  const CommodityDetail$1 = (_a) => {
8342
- var _b, _c, _d, _e, _f, _g, _h, _j;
8368
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k;
8343
8369
  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"]);
8344
8370
  const { sxpParameter } = useSxpDataSource();
8345
8371
  const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
@@ -8380,7 +8406,7 @@ const CommodityDetail$1 = (_a) => {
8380
8406
  return '$7,000';
8381
8407
  }
8382
8408
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
8383
- const width = isPreview ? 375 : window.innerWidth;
8409
+ const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
8384
8410
  const renderContent = ({ isPost }) => {
8385
8411
  var _a, _b, _c;
8386
8412
  return (React.createElement("div", null,
@@ -8388,10 +8414,10 @@ const CommodityDetail$1 = (_a) => {
8388
8414
  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'),
8389
8415
  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),
8390
8416
  React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
8391
- 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
8392
- bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
8393
- collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
8394
- necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
8417
+ 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
8418
+ bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
8419
+ collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
8420
+ necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
8395
8421
  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 }))));
8396
8422
  };
8397
8423
  const renderBtn = () => {
@@ -8400,7 +8426,7 @@ const CommodityDetail$1 = (_a) => {
8400
8426
  };
8401
8427
  return (React.createElement("div", { className: 'pb-commondity' },
8402
8428
  React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
8403
- 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: {
8429
+ 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: {
8404
8430
  clickable: true,
8405
8431
  bulletActiveClass: 'swipe-item-active-bullet',
8406
8432
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -8408,7 +8434,7 @@ const CommodityDetail$1 = (_a) => {
8408
8434
  : 'commondityDetail-swiper-clickable-center'
8409
8435
  }, loop: true, autoplay: {
8410
8436
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
8411
- } }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
8437
+ } }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
8412
8438
  return (React.createElement(SwiperSlide, { key: src },
8413
8439
  React.createElement("div", { style: {
8414
8440
  overflow: 'hidden',
@@ -8417,7 +8443,7 @@ const CommodityDetail$1 = (_a) => {
8417
8443
  } },
8418
8444
  React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
8419
8445
  }))),
8420
- !((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css.css({
8446
+ !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css.css({
8421
8447
  position: 'relative',
8422
8448
  height: 0,
8423
8449
  width: '100%',
@@ -8430,7 +8456,7 @@ const CommodityDetail$1 = (_a) => {
8430
8456
  top: 0,
8431
8457
  objectFit: 'cover',
8432
8458
  width: '100%'
8433
- }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
8459
+ }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
8434
8460
  React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
8435
8461
  renderBtn(),
8436
8462
  React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
@@ -8790,7 +8816,7 @@ var settingRender$2 = [
8790
8816
  ];
8791
8817
 
8792
8818
  const CommodityDetailDiroNew$1 = (_a) => {
8793
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
8819
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
8794
8820
  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"]);
8795
8821
  React.useState(true);
8796
8822
  const { sxpParameter } = useSxpDataSource();
@@ -8838,16 +8864,16 @@ const CommodityDetailDiroNew$1 = (_a) => {
8838
8864
  return '£102,300.00';
8839
8865
  }
8840
8866
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
8841
- const width = isPreview ? 375 : window.innerWidth;
8867
+ const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
8842
8868
  const productInfoText = ({ isPost }) => {
8843
8869
  return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
8844
8870
  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) ||
8845
- `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
8871
+ `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
8846
8872
  Made in Italy` })));
8847
8873
  };
8848
8874
  return (React.createElement("div", { className: 'pb-commondityDiroNew' },
8849
8875
  React.createElement("div", Object.assign({ ref: scrollRef, className: css.css(Object.assign({}, style)) }, props),
8850
- 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: {
8876
+ 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: {
8851
8877
  clickable: true,
8852
8878
  bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
8853
8879
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -8855,7 +8881,7 @@ Made in Italy` })));
8855
8881
  : 'commondityDiroNew-swiper-clickable-center'
8856
8882
  }, loop: true, autoplay: {
8857
8883
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
8858
- } }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
8884
+ } }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
8859
8885
  return (React.createElement(SwiperSlide, { key: src },
8860
8886
  React.createElement("div", { style: {
8861
8887
  overflow: 'hidden',
@@ -8864,7 +8890,7 @@ Made in Italy` })));
8864
8890
  } },
8865
8891
  React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
8866
8892
  }))),
8867
- !((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css.css({
8893
+ !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css.css({
8868
8894
  position: 'relative',
8869
8895
  height: 0,
8870
8896
  width: '100%',
@@ -8877,16 +8903,16 @@ Made in Italy` })));
8877
8903
  top: 0,
8878
8904
  objectFit: 'cover',
8879
8905
  width: '100%'
8880
- }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
8906
+ }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
8881
8907
  React.createElement("div", { className: 'pb-commondityDiroNew-content' },
8882
8908
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
8883
8909
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
8884
- 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'),
8910
+ 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'),
8885
8911
  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')),
8886
8912
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
8887
8913
  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),
8888
- 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 : '税费'))),
8889
- (!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')),
8914
+ 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 : '税费'))),
8915
+ (!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')),
8890
8916
  productInfoText({ isPost }))),
8891
8917
  React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
8892
8918
  };
@@ -11794,7 +11820,7 @@ const WaterFall = (props) => {
11794
11820
  }
11795
11821
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
11796
11822
  eventInfo: {
11797
- relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
11823
+ contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
11798
11824
  position: cacheActiveIndex + '',
11799
11825
  contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
11800
11826
  traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
@@ -11927,14 +11953,14 @@ var _materials_ = /*#__PURE__*/Object.freeze({
11927
11953
  Prompt: Prompt
11928
11954
  });
11929
11955
 
11930
- const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
11931
- const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
11956
+ const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
11957
+ const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
11932
11958
  const LikeButton = (_a) => {
11933
11959
  var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
11934
11960
  const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
11935
11961
  const [state, setState] = React.useState(active);
11936
- const likeIcon = useIconLink(defaultLikeIconPath);
11937
- const unlikeIcon = useIconLink(defaultUnLikeIconPath);
11962
+ const likeIcon = useIconLink(defaultLikeIconPath$1);
11963
+ const unlikeIcon = useIconLink(defaultUnLikeIconPath$1);
11938
11964
  const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
11939
11965
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
11940
11966
  if (state) {
@@ -11990,7 +12016,7 @@ var SXP_EVENT_TYPE;
11990
12016
  SXP_EVENT_TYPE["PAGE_DID_HIDE"] = "pageDidHide";
11991
12017
  })(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
11992
12018
 
11993
- const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig }) => {
12019
+ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig }) => {
11994
12020
  const [isPauseVideo, setIsPauseVideo] = React.useState(false);
11995
12021
  const videoRef = React.useRef(null);
11996
12022
  const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
@@ -12000,13 +12026,12 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12000
12026
  const { isActive } = useSwiperSlide();
12001
12027
  const canvasRef = React.useRef(null);
12002
12028
  const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
12003
- const videoId = `pb-video-${index}`;
12004
12029
  React.useEffect(() => {
12005
12030
  if (!videoRef.current)
12006
12031
  return;
12007
- videoRef.current.muted(muted);
12032
+ videoRef.current.muted = muted;
12008
12033
  }, [muted]);
12009
- const handleEnded = React.useCallback(() => {
12034
+ const handleVideoStart = React.useCallback(() => {
12010
12035
  var _a;
12011
12036
  (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
12012
12037
  }, []);
@@ -12015,10 +12040,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12015
12040
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
12016
12041
  setIsPauseVideo(false);
12017
12042
  const item = data[index];
12018
- if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration())) {
12019
- videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime()) || 0;
12020
- const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration()) !== null && _d !== void 0 ? _d : 0).toFixed(2);
12021
- const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime()) !== null && _f !== void 0 ? _f : 0).toFixed(2);
12043
+ if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
12044
+ videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
12045
+ const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
12046
+ const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
12022
12047
  const playType = isFirstPlay ? '0' : '1';
12023
12048
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
12024
12049
  eventInfo: {
@@ -12038,15 +12063,14 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12038
12063
  setIsFirstPlay(false);
12039
12064
  }
12040
12065
  }, [bffEventReport, data, index, isFirstPlay]);
12041
- const handleCanplay = React.useCallback(() => {
12042
- handLoadeddata();
12066
+ const handleLoadedMetadata = React.useCallback(() => {
12043
12067
  setIsLoadFinish(true);
12044
12068
  }, []);
12045
12069
  const handleClickVideo = React.useCallback((type) => () => {
12046
12070
  var _a, _b, _c, _d, _e;
12047
12071
  if (!isLoadFinish)
12048
12072
  return;
12049
- const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused();
12073
+ const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
12050
12074
  switch (type) {
12051
12075
  case 'start':
12052
12076
  if (!isPause)
@@ -12071,13 +12095,13 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12071
12095
  break;
12072
12096
  }
12073
12097
  }, [isLoadFinish]);
12074
- const handlePause = React.useCallback(() => {
12098
+ const onPause = React.useCallback(() => {
12075
12099
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
12076
12100
  const item = data[index];
12077
- const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration()) !== null && _b !== void 0 ? _b : 0).toFixed(2);
12078
- const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime()) !== null && _d !== void 0 ? _d : 0).toFixed(2);
12079
- if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration()) {
12080
- const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime()) - videoStartTime.current).toFixed(2);
12101
+ const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
12102
+ const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
12103
+ if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
12104
+ const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
12081
12105
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
12082
12106
  eventInfo: {
12083
12107
  eventSubject: 'playOverVideo',
@@ -12109,66 +12133,56 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12109
12133
  return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
12110
12134
  }, [firstFrameSrc, rec]);
12111
12135
  const handLoadeddata = React.useCallback(() => {
12112
- var _a;
12113
- const videoDomRef = document.getElementById(`${videoId}_html5_api`);
12114
- if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
12136
+ if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
12115
12137
  return;
12116
- const setFrameImg = () => {
12117
- const video = videoDomRef;
12118
- const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
12119
- const ctx = canvas.getContext('2d');
12120
- const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
12121
- const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
12122
- canvas.height = targetHeight;
12123
- canvas.width = targetWidth;
12124
- ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
12125
- setFirstFrameSrc(canvas.toDataURL());
12126
- };
12127
- setFrameImg();
12128
- setTimeout(() => {
12129
- setFrameImg();
12130
- }, 500);
12138
+ const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
12139
+ const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
12140
+ const ctx = canvas.getContext('2d');
12141
+ const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
12142
+ const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
12143
+ canvas.height = targetHeight;
12144
+ canvas.width = targetWidth;
12145
+ ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
12146
+ setFirstFrameSrc(canvas.toDataURL());
12131
12147
  }, []);
12132
12148
  React.useEffect(() => {
12133
- var _a, _b, _c, _d, _e;
12149
+ var _a, _b, _c, _d;
12150
+ if (!videoRef.current)
12151
+ return;
12134
12152
  setIsPauseVideo(false);
12135
- const videoSrc = rec.video.url;
12136
- if (videoSrc && typeof TCPlayer === 'function') {
12137
- videoRef.current = TCPlayer(videoId, {
12138
- sources: [
12139
- {
12140
- src: videoSrc // 播放地址
12141
- }
12142
- ],
12143
- licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1325816236_1/v_cube.license', // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
12144
- controls: false,
12145
- autoplay: false,
12146
- loop: false,
12147
- muted: true,
12148
- preload: 'auto',
12149
- posterImage: false,
12150
- bigPlayButton: true
12151
- });
12152
- videoRef.current.play();
12153
- videoRef.current.pause();
12154
- }
12155
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.on('loadedmetadata', handleCanplay);
12156
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.on('canplay', handleCanplay);
12157
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.on('playing', handlePlaying);
12158
- // videoRef.current?.on('loadeddata', handLoadeddata);
12159
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.on('pause', handlePause);
12160
- (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.on('ended', handleEnded);
12153
+ if (!videoRef.current.src) {
12154
+ const videoSrc = rec.video.url;
12155
+ // if (videoSrc.includes('.m3u8')) {
12156
+ // if (Hls.isSupported()) {
12157
+ // const hls = new Hls();
12158
+ // hls.loadSource(videoSrc);
12159
+ // hls.attachMedia(videoRef.current);
12160
+ // hls.on(Hls.Events.MANIFEST_PARSED, function () {
12161
+ // videoRef?.current?.play();
12162
+ // });
12163
+ // } else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
12164
+ // videoRef.current.src = videoSrc;
12165
+ // } else {
12166
+ // videoRef.current.src = videoSrc;
12167
+ // }
12168
+ // } else {
12169
+ videoRef.current.src = videoSrc;
12170
+ // }
12171
+ videoRef.current.setAttribute('x5-playsinline', 'true');
12172
+ videoRef.current.setAttribute('webkit-playsinline', 'true');
12173
+ }
12174
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
12175
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
12176
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
12177
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
12161
12178
  return () => {
12162
- var _a, _b, _c, _d, _e;
12163
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.off('loadedmetadata', handleCanplay);
12164
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.off('canplay', handleCanplay);
12165
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.off('playing', handlePlaying);
12166
- // videoRef.current?.off('loadeddata', handLoadeddata);
12167
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.off('pause', handlePause);
12168
- (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.off('ended', handleEnded);
12169
- videoRef.current.dispose();
12179
+ var _a, _b, _c, _d;
12180
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
12181
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
12182
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
12183
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
12170
12184
  };
12171
- }, []);
12185
+ }, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
12172
12186
  React.useEffect(() => {
12173
12187
  var _a;
12174
12188
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
@@ -12254,31 +12268,23 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12254
12268
  right: 0
12255
12269
  } },
12256
12270
  React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
12257
- React.createElement("video", { id: `pb-video-${index}`, playsInline: true, crossOrigin: 'anonymous', style: {
12271
+ 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: {
12258
12272
  width: '100%',
12259
12273
  height: '100%',
12260
- objectFit: 'contain',
12261
- backgroundColor: 'transparent',
12262
- pointerEvents: 'none'
12274
+ objectFit: 'contain'
12263
12275
  } }),
12264
12276
  React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
12265
- renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, style: {
12277
+ renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
12266
12278
  position: 'relative',
12267
12279
  width: '100%',
12268
12280
  height,
12269
12281
  overflow: 'hidden'
12270
- }, onClick: handleClickVideo() },
12271
- React.createElement("video", { id: `pb-video-${index}`, playsInline: true, crossOrigin: 'anonymous', style: {
12272
- backgroundColor: 'transparent',
12273
- width: '100%',
12274
- height: '100%',
12275
- objectFit: 'cover',
12276
- pointerEvents: 'none'
12277
- } }),
12282
+ } },
12283
+ 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 }),
12278
12284
  renderPoster,
12279
12285
  React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
12280
12286
  };
12281
- var VideoWidget$1 = React.memo(VideoWidget);
12287
+ var VideoWidget$3 = React.memo(VideoWidget$2);
12282
12288
 
12283
12289
  /*
12284
12290
  * @Author: binruan@chatlabs.com
@@ -12329,7 +12335,7 @@ const FingerSwipeTip = ({ imageUrl }) => {
12329
12335
  * @Author: binruan@chatlabs.com
12330
12336
  * @Date: 2024-03-20 10:27:31
12331
12337
  * @LastEditors: binruan@chatlabs.com
12332
- * @LastEditTime: 2024-04-22 14:04:00
12338
+ * @LastEditTime: 2024-04-26 14:33:25
12333
12339
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\Picture.tsx
12334
12340
  *
12335
12341
  */
@@ -12361,6 +12367,7 @@ const Picture = (props) => {
12361
12367
  React.createElement(FormatImage$1, { src: src, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) }),
12362
12368
  blur && (React.createElement(FormatImage$1, { src: src, style: {
12363
12369
  width: '100%',
12370
+ height: '100%',
12364
12371
  objectFit: 'contain',
12365
12372
  position: 'absolute',
12366
12373
  top: '50%',
@@ -12377,7 +12384,7 @@ const Picture = (props) => {
12377
12384
  * @LastEditTime: 2024-04-18 19:56:22
12378
12385
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
12379
12386
  */
12380
- const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
12387
+ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
12381
12388
  var _a;
12382
12389
  const ref = React.useRef();
12383
12390
  const { isActive } = useSwiperSlide();
@@ -12406,7 +12413,7 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd
12406
12413
  React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
12407
12414
  })));
12408
12415
  };
12409
- var PictureGroup$1 = React.memo(PictureGroup);
12416
+ var PictureGroup$3 = React.memo(PictureGroup$2);
12410
12417
 
12411
12418
  /*
12412
12419
  * @Author: binruan@chatlabs.com
@@ -12570,26 +12577,63 @@ var RenderCard$1 = React.memo(RenderCard);
12570
12577
  *
12571
12578
  */
12572
12579
  const Nudge = ({ nudge }) => {
12580
+ var _a, _b, _c, _d, _e, _f, _g;
12573
12581
  return (React.createElement(React.Fragment, null, (nudge === null || nudge === void 0 ? void 0 : nudge.isOpen) && (React.createElement("div", { className: 'clc-sxp-bottom-nudge', style: {
12574
- marginBottom: nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom,
12575
- width: nudge === null || nudge === void 0 ? void 0 : nudge.size.width,
12576
- height: nudge === null || nudge === void 0 ? void 0 : nudge.size.height,
12582
+ marginBottom: (_a = nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom) !== null && _a !== void 0 ? _a : 5,
12583
+ 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,
12584
+ 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,
12577
12585
  backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
12578
- borderRadius: nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius
12586
+ borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
12579
12587
  } },
12580
12588
  (nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover' } }) : null,
12581
- React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, nudge === null || nudge === void 0 ? void 0 : nudge.content)))));
12589
+ 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 : '')))));
12582
12590
  };
12583
12591
 
12592
+ const DEFAULT_TAG = 'FOR U';
12593
+ const Tagbar = ({ tagList = [], setActiveIndex }) => {
12594
+ const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
12595
+ const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = useSxpDataSource();
12596
+ const realTagList = React.useMemo(() => {
12597
+ return [DEFAULT_TAG, ...tagList];
12598
+ }, [tagList]);
12599
+ const handleSelectTag = (tag) => () => {
12600
+ if (tag === selectTag)
12601
+ return;
12602
+ let hashTag;
12603
+ if (tag !== DEFAULT_TAG) {
12604
+ hashTag = tag;
12605
+ }
12606
+ setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
12607
+ getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ hashTag }).then((res) => {
12608
+ var _a, _b, _c, _d;
12609
+ setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
12610
+ setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
12611
+ setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
12612
+ setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(0);
12613
+ (_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);
12614
+ }).finally(() => {
12615
+ setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
12616
+ });
12617
+ setSelectTag(tag);
12618
+ };
12619
+ if (tagList.length <= 0)
12620
+ return null;
12621
+ return (React.createElement("div", { className: 'clc-sxp-tagbar', style: { height: 45 } },
12622
+ React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
12623
+ return (React.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
12624
+ }))));
12625
+ };
12626
+ var Tagbar$1 = React.memo(Tagbar);
12627
+
12584
12628
  /*
12585
12629
  * @Author: binruan@chatlabs.com
12586
12630
  * @Date: 2024-01-15 19:03:09
12587
12631
  * @LastEditors: binruan@chatlabs.com
12588
- * @LastEditTime: 2024-04-25 17:03:41
12632
+ * @LastEditTime: 2024-04-23 15:48:32
12589
12633
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12590
12634
  *
12591
12635
  */
12592
- const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle }) => {
12636
+ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [] }) => {
12593
12637
  var _a, _b, _c, _d, _e, _f, _g;
12594
12638
  const { schema } = useEditor();
12595
12639
  const [activeIndex, setActiveIndex] = React.useState(0);
@@ -12667,8 +12711,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12667
12711
  // sessionDuration: Math.floor(((new Date() as any) - curTime) / 1000) + '',
12668
12712
  // eventSubject: 'sessionCompleted',
12669
12713
  // eventDescription: 'Session completed',
12670
- // relatedContentId: item?.video?.itemId,
12671
- // relatedProductId: item?.product?.itemId,
12714
+ // contentId: item?.video?.itemId,
12715
+ // productId: item?.product?.itemId,
12672
12716
  // position: item?.position
12673
12717
  // }
12674
12718
  // });
@@ -12712,12 +12756,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12712
12756
  sessionDuration: Math.floor((new Date() - curTime.current) / 1000) + '',
12713
12757
  eventSubject: 'sessionCompleted',
12714
12758
  eventDescription: 'Session completed',
12715
- relatedContentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
12716
- relatedProductId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
12759
+ contentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
12760
+ productId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
12717
12761
  position: activeIndex + '',
12718
12762
  fromKName,
12719
12763
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
12720
- 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 : ''
12764
+ 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 : ''
12721
12765
  }
12722
12766
  });
12723
12767
  }
@@ -12734,8 +12778,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12734
12778
  };
12735
12779
  }, [activeIndex, bffEventReport, curTime, data, handleH5EnterLink, popupDetailData, isFromHashtag, tempMap]);
12736
12780
  const height = React.useMemo(() => {
12737
- return (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo) ? containerHeight - 45 : containerHeight;
12738
- }, [globalConfig, containerHeight]);
12781
+ let minusHeight = 0;
12782
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
12783
+ minusHeight += 45;
12784
+ }
12785
+ if (tagList.length > 0) {
12786
+ minusHeight += 45;
12787
+ }
12788
+ return containerHeight - minusHeight;
12789
+ }, [globalConfig, containerHeight, tagList]);
12739
12790
  const renderLogo = React.useMemo(() => {
12740
12791
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
12741
12792
  return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
@@ -12746,10 +12797,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12746
12797
  const renderContent = React.useCallback((rec, index) => {
12747
12798
  var _a, _b, _c, _d;
12748
12799
  if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
12749
- 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 }));
12800
+ 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 }));
12750
12801
  }
12751
12802
  if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
12752
- 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 }));
12803
+ 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 }));
12753
12804
  }
12754
12805
  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) {
12755
12806
  return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
@@ -12783,8 +12834,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12783
12834
  ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
12784
12835
  React.createElement("div", { className: 'clc-sxp-bottom' },
12785
12836
  React.createElement(Nudge, { nudge: nudge }),
12786
- React.createElement("div", { className: 'clc-sxp-bottom-card' },
12787
- React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
12837
+ (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' },
12838
+ React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver }))) : null,
12788
12839
  React.createElement("div", null,
12789
12840
  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 }),
12790
12841
  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 })))));
@@ -12851,8 +12902,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12851
12902
  eventInfo: {
12852
12903
  eventSubject: 'scrollDown',
12853
12904
  eventDescription: 'User scroll down',
12854
- relatedContentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
12855
- relatedProductId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
12905
+ contentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
12906
+ productId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
12856
12907
  requestId: null
12857
12908
  }
12858
12909
  });
@@ -12864,8 +12915,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12864
12915
  eventInfo: {
12865
12916
  eventSubject: 'scrollUp',
12866
12917
  eventDescription: 'User scroll up',
12867
- relatedContentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
12868
- relatedProductId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
12918
+ contentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
12919
+ productId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
12869
12920
  requestId: null
12870
12921
  }
12871
12922
  });
@@ -12945,13 +12996,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12945
12996
  setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
12946
12997
  } })),
12947
12998
  renderLogo,
12999
+ React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex }),
12948
13000
  isShowFingerTip ? React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
12949
- React.createElement(Swiper, { ref: swiperRef, onSlideChange: () => {
12950
- swiperRef.current.swiper.allowTouchMove = false;
12951
- setTimeout(() => {
12952
- swiperRef.current.swiper.allowTouchMove = true;
12953
- }, 500);
12954
- }, onActiveIndexChange: (swiper) => {
13001
+ React.createElement(Swiper, { ref: swiperRef, onActiveIndexChange: (swiper) => {
12955
13002
  setActiveIndex(swiper.activeIndex);
12956
13003
  if (openHashtag)
12957
13004
  return;
@@ -12968,9 +13015,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12968
13015
  }
12969
13016
  }
12970
13017
  },
12971
- // style={{
12972
- // pointerEvents: canSwiper ? 'auto' : 'none'
12973
- // }}
12974
13018
  // onReachEnd={() => {
12975
13019
  // // 由hashtaglist跳转过来时不执行下面的方法
12976
13020
  // if (waterFallData) return;
@@ -12996,6 +13040,365 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12996
13040
  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))));
12997
13041
  };
12998
13042
 
13043
+ const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
13044
+ 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) => {
13045
+ return (React.createElement(SwiperSlide, { key: url },
13046
+ React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
13047
+ })));
13048
+ };
13049
+ var PictureGroup$1 = React.memo(PictureGroup);
13050
+
13051
+ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width }) => {
13052
+ const [isPauseVideo, setIsPauseVideo] = React.useState(false);
13053
+ const videoRef = React.useRef(null);
13054
+ const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
13055
+ const videoStartTime = React.useRef(0);
13056
+ const [isLoadFinish, setIsLoadFinish] = React.useState(false);
13057
+ const [isFirstPlay, setIsFirstPlay] = React.useState(true);
13058
+ const canvasRef = React.useRef(null);
13059
+ const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
13060
+ React.useEffect(() => {
13061
+ if (!videoRef.current)
13062
+ return;
13063
+ videoRef.current.muted = muted;
13064
+ }, [muted]);
13065
+ const handleVideoStart = React.useCallback(() => {
13066
+ var _a;
13067
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
13068
+ }, []);
13069
+ const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
13070
+ const handlePlaying = React.useCallback(() => {
13071
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
13072
+ setIsPauseVideo(false);
13073
+ const item = data[index];
13074
+ if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
13075
+ videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
13076
+ const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
13077
+ const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
13078
+ const playType = isFirstPlay ? '0' : '1';
13079
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
13080
+ eventInfo: {
13081
+ eventSubject: 'playVideo',
13082
+ eventDescription: 'User played the video',
13083
+ contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
13084
+ contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
13085
+ playType,
13086
+ startTime: videoCurrentTime,
13087
+ videoDuration,
13088
+ contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
13089
+ position: index + '',
13090
+ contentFormat: 'video',
13091
+ traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
13092
+ }
13093
+ });
13094
+ setIsFirstPlay(false);
13095
+ }
13096
+ }, [bffEventReport, data, index, isFirstPlay]);
13097
+ const handleLoadedMetadata = React.useCallback(() => {
13098
+ setIsLoadFinish(true);
13099
+ }, []);
13100
+ const handleClickVideo = React.useCallback((type) => () => {
13101
+ var _a, _b, _c, _d, _e;
13102
+ if (!isLoadFinish)
13103
+ return;
13104
+ const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
13105
+ switch (type) {
13106
+ case 'start':
13107
+ if (!isPause)
13108
+ return;
13109
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
13110
+ setIsPauseVideo(false);
13111
+ break;
13112
+ case 'pause':
13113
+ if (isPause)
13114
+ return;
13115
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
13116
+ setIsPauseVideo(true);
13117
+ break;
13118
+ default:
13119
+ if (isPause) {
13120
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
13121
+ }
13122
+ else {
13123
+ (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
13124
+ }
13125
+ setIsPauseVideo(!isPause);
13126
+ break;
13127
+ }
13128
+ }, [isLoadFinish]);
13129
+ const onPause = React.useCallback(() => {
13130
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
13131
+ const item = data[index];
13132
+ const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
13133
+ const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
13134
+ if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
13135
+ const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
13136
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
13137
+ eventInfo: {
13138
+ eventSubject: 'playOverVideo',
13139
+ eventDescription: 'User finished playing the video',
13140
+ contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
13141
+ contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
13142
+ endTime: videoCurrentTime,
13143
+ videoDuration,
13144
+ playDuration,
13145
+ contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
13146
+ position: index + '',
13147
+ contentFormat: 'video',
13148
+ traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
13149
+ }
13150
+ });
13151
+ }
13152
+ }, [data, index, bffEventReport]);
13153
+ const blur = React.useMemo(() => {
13154
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
13155
+ }, [videoPostConfig]);
13156
+ const translateY = React.useMemo(() => {
13157
+ var _a;
13158
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
13159
+ ? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
13160
+ : 'translateY(-50%)';
13161
+ }, [videoPostConfig]);
13162
+ const blurBgSrc = React.useMemo(() => {
13163
+ var _a;
13164
+ return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
13165
+ }, [firstFrameSrc, rec]);
13166
+ const handLoadeddata = React.useCallback(() => {
13167
+ if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
13168
+ return;
13169
+ const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
13170
+ const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
13171
+ const ctx = canvas.getContext('2d');
13172
+ const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
13173
+ const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
13174
+ canvas.height = targetHeight;
13175
+ canvas.width = targetWidth;
13176
+ ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
13177
+ setFirstFrameSrc(canvas.toDataURL());
13178
+ }, []);
13179
+ React.useEffect(() => {
13180
+ var _a, _b, _c, _d;
13181
+ if (!videoRef.current)
13182
+ return;
13183
+ setIsPauseVideo(false);
13184
+ if (!videoRef.current.src) {
13185
+ const videoSrc = rec.video.url;
13186
+ if (videoSrc.includes('.m3u8')) {
13187
+ if (Hls.isSupported()) {
13188
+ const hls = new Hls();
13189
+ hls.loadSource(videoSrc);
13190
+ hls.attachMedia(videoRef.current);
13191
+ }
13192
+ else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
13193
+ videoRef.current.src = videoSrc;
13194
+ }
13195
+ else {
13196
+ videoRef.current.src = videoSrc;
13197
+ }
13198
+ }
13199
+ else {
13200
+ videoRef.current.src = videoSrc;
13201
+ }
13202
+ videoRef.current.setAttribute('x5-playsinline', 'true');
13203
+ videoRef.current.setAttribute('webkit-playsinline', 'true');
13204
+ }
13205
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
13206
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
13207
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
13208
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
13209
+ return () => {
13210
+ var _a, _b, _c, _d;
13211
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
13212
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
13213
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
13214
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
13215
+ };
13216
+ }, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
13217
+ const renderPoster = React.useMemo(() => {
13218
+ if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
13219
+ return null;
13220
+ }
13221
+ 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 }));
13222
+ }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
13223
+ React.useEffect(() => {
13224
+ const handleBeforeUnload = () => {
13225
+ var _a, _b;
13226
+ 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) {
13227
+ handleClickVideo('pause')();
13228
+ }
13229
+ };
13230
+ window.addEventListener('beforeunload', handleBeforeUnload);
13231
+ return () => {
13232
+ window.removeEventListener('beforeunload', handleBeforeUnload);
13233
+ };
13234
+ }, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
13235
+ const blurStyle = React.useMemo(() => {
13236
+ return blur
13237
+ ? {
13238
+ filter: 'blur(10px)',
13239
+ transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
13240
+ }
13241
+ : {};
13242
+ }, [blur]);
13243
+ if (!rec.video) {
13244
+ return null;
13245
+ }
13246
+ return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
13247
+ position: 'relative',
13248
+ width,
13249
+ height,
13250
+ overflow: 'hidden'
13251
+ } },
13252
+ React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height,
13253
+ width, objectFit: 'cover' }, blurStyle) }),
13254
+ React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
13255
+ React.createElement("div", { style: {
13256
+ position: 'absolute',
13257
+ width,
13258
+ height,
13259
+ top: '50%',
13260
+ transform: translateY,
13261
+ left: 0,
13262
+ right: 0
13263
+ } },
13264
+ React.createElement("div", { style: { position: 'relative', width, height: '100%' } },
13265
+ 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: {
13266
+ width: '100%',
13267
+ height,
13268
+ objectFit: 'contain'
13269
+ } }),
13270
+ React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
13271
+ renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
13272
+ position: 'relative',
13273
+ width,
13274
+ height,
13275
+ overflow: 'hidden'
13276
+ } },
13277
+ 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 }),
13278
+ renderPoster,
13279
+ React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
13280
+ };
13281
+ var VideoWidget$1 = React.memo(VideoWidget);
13282
+
13283
+ const RESOLVER$1 = {};
13284
+ Object.values(_materials_).forEach((v) => {
13285
+ RESOLVER$1[v.extend.type] = v;
13286
+ });
13287
+ const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
13288
+ const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
13289
+ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [] }) => {
13290
+ const height = React.useMemo(() => {
13291
+ let minusHeight = 0;
13292
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
13293
+ minusHeight += 45;
13294
+ }
13295
+ if (tagList.length > 0) {
13296
+ minusHeight += 45;
13297
+ }
13298
+ return containerHeight - minusHeight;
13299
+ }, [globalConfig, containerHeight, tagList]);
13300
+ const renderContent = (rec, index) => {
13301
+ var _a, _b, _c, _d;
13302
+ if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
13303
+ 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 }));
13304
+ }
13305
+ if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
13306
+ 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 }));
13307
+ }
13308
+ if (rec.product) {
13309
+ 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) {
13310
+ return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
13311
+ var _a, _b, _c, _d, _e, _f, _g, _h;
13312
+ const t = RESOLVER$1[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
13313
+ const Component = withBindDataSource(t);
13314
+ const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
13315
+ 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) || {},
13316
+ // schema={schema}
13317
+ id: value === null || value === void 0 ? void 0 : value.id,
13318
+ // viewTime={viewTime.current}
13319
+ 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 })));
13320
+ });
13321
+ }
13322
+ }
13323
+ };
13324
+ const renderLogo = React.useMemo(() => {
13325
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
13326
+ return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
13327
+ React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
13328
+ }
13329
+ return null;
13330
+ }, [globalConfig]);
13331
+ const CTA = (rec, index) => {
13332
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
13333
+ return (React.createElement("div", { className: 'clc-sxp-bottom-card' },
13334
+ React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1 })));
13335
+ }
13336
+ return null;
13337
+ };
13338
+ const renderBottom = (rec, index) => {
13339
+ var _a, _b, _c, _d, _e, _f, _g;
13340
+ if (rec.video) {
13341
+ return (React.createElement(React.Fragment, null,
13342
+ ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
13343
+ React.createElement("div", { className: 'clc-sxp-bottom' },
13344
+ React.createElement(Nudge, { nudge: nudge }),
13345
+ CTA(rec, index),
13346
+ React.createElement("div", null,
13347
+ 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' }) })),
13348
+ 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 }))));
13349
+ }
13350
+ return null;
13351
+ };
13352
+ const likeIcon = useIconLink(defaultLikeIconPath, appDomain);
13353
+ const unlikeIcon = useIconLink(defaultUnLikeIconPath, appDomain);
13354
+ const renderLikeButton = (rec, index) => {
13355
+ var _a, _b, _c, _d;
13356
+ if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
13357
+ return;
13358
+ let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
13359
+ if (top < 40) {
13360
+ top += 40;
13361
+ }
13362
+ if (rec.video) {
13363
+ 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: {
13364
+ top,
13365
+ right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0
13366
+ } }));
13367
+ }
13368
+ return null;
13369
+ };
13370
+ const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png', appDomain);
13371
+ const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png', appDomain);
13372
+ const renderView = (rec, index) => {
13373
+ var _a, _b, _c, _d;
13374
+ return (React.createElement("div", { style: { position: 'relative', border: '1px solid #e1e1e1' } },
13375
+ renderLogo,
13376
+ React.createElement(Tagbar$1, { tagList: tagList }),
13377
+ React.createElement(ToggleButton$1, { style: {
13378
+ position: 'absolute',
13379
+ right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
13380
+ 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',
13381
+ bottom: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _d !== void 0 ? _d : 23,
13382
+ zIndex: 999
13383
+ }, 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 }),
13384
+ renderContent(rec, index),
13385
+ renderBottom(rec, index),
13386
+ renderLikeButton(rec, index)));
13387
+ };
13388
+ return (React.createElement("div", { style: {
13389
+ width: '100%',
13390
+ height: containerHeight,
13391
+ display: 'flex',
13392
+ boxSizing: 'border-box',
13393
+ gap: 16,
13394
+ pointerEvents: 'none',
13395
+ userSelect: 'none'
13396
+ } }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
13397
+ return renderView(rec, index);
13398
+ })));
13399
+ };
13400
+ var index$1 = React.memo(DiyPortalPreview);
13401
+
12999
13402
  /*
13000
13403
  * @Author: binruan@chatlabs.com
13001
13404
  * @Date: 2023-10-31 10:56:01
@@ -13089,10 +13492,10 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
13089
13492
  return searchParams;
13090
13493
  }, []);
13091
13494
  return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
13092
- 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 }) => {
13495
+ 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 }) => {
13093
13496
  var _a;
13094
13497
  return (React.createElement(React.Fragment, null,
13095
- 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 })),
13498
+ 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 })),
13096
13499
  React.createElement(Popup, null)));
13097
13500
  } })));
13098
13501
  };
@@ -13136,12 +13539,13 @@ function useEditorDataProvider() {
13136
13539
  * @FilePath: \pb-sxp-ui\src\index.ts
13137
13540
  */
13138
13541
 
13542
+ exports.DiyPortalPreview = index$1;
13139
13543
  exports.EditorDataProvider = EditorDataProvider;
13140
13544
  exports.Modal = Modal$1;
13141
13545
  exports.SxpDataSourceProvider = SxpDataSourceProvider$1;
13142
13546
  exports.SxpPageCore = index;
13143
13547
  exports.SxpPageRender = SxpPageRender;
13144
- exports.core = index$1;
13548
+ exports.core = index$2;
13145
13549
  exports.default = Pagebuilder;
13146
13550
  exports.defaultSetting = defaultSetting;
13147
13551
  exports.materials = _materials_;