pb-sxp-ui 1.0.43 → 1.0.44

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 (54) hide show
  1. package/dist/index.cjs +490 -58
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +48 -4
  4. package/dist/index.js +489 -58
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +4 -3
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +4 -3
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +493 -62
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +4 -3
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/DiyPortalPreview/PictureGroup.d.ts +13 -0
  15. package/es/core/components/DiyPortalPreview/PictureGroup.js +11 -0
  16. package/es/core/components/DiyPortalPreview/VideoWidget.d.ts +15 -0
  17. package/es/core/components/DiyPortalPreview/VideoWidget.js +236 -0
  18. package/es/core/components/DiyPortalPreview/index.d.ts +6 -0
  19. package/es/core/components/DiyPortalPreview/index.js +127 -0
  20. package/es/core/components/SxpPageCore/index.js +2 -2
  21. package/es/core/components/SxpPageRender/Nudge/index.js +6 -5
  22. package/es/core/components/SxpPageRender/Tagbar.d.ts +7 -0
  23. package/es/core/components/SxpPageRender/Tagbar.js +37 -0
  24. package/es/core/components/SxpPageRender/WaterFall/index.js +1 -1
  25. package/es/core/components/SxpPageRender/index.d.ts +2 -0
  26. package/es/core/components/SxpPageRender/index.js +21 -12
  27. package/es/core/context/SxpDataSourceProvider.d.ts +3 -0
  28. package/es/core/context/SxpDataSourceProvider.js +28 -4
  29. package/es/core/hooks/useEventReport.js +4 -4
  30. package/es/index.d.ts +1 -0
  31. package/es/index.js +1 -0
  32. package/es/materials/sxp/popup/CommodityDetail/index.js +6 -6
  33. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +9 -9
  34. package/lib/core/components/DiyPortalPreview/PictureGroup.d.ts +13 -0
  35. package/lib/core/components/DiyPortalPreview/PictureGroup.js +14 -0
  36. package/lib/core/components/DiyPortalPreview/VideoWidget.d.ts +15 -0
  37. package/lib/core/components/DiyPortalPreview/VideoWidget.js +239 -0
  38. package/lib/core/components/DiyPortalPreview/index.d.ts +6 -0
  39. package/lib/core/components/DiyPortalPreview/index.js +130 -0
  40. package/lib/core/components/SxpPageCore/index.js +2 -2
  41. package/lib/core/components/SxpPageRender/Nudge/index.js +6 -5
  42. package/lib/core/components/SxpPageRender/Tagbar.d.ts +7 -0
  43. package/lib/core/components/SxpPageRender/Tagbar.js +40 -0
  44. package/lib/core/components/SxpPageRender/WaterFall/index.js +1 -1
  45. package/lib/core/components/SxpPageRender/index.d.ts +2 -0
  46. package/lib/core/components/SxpPageRender/index.js +21 -12
  47. package/lib/core/context/SxpDataSourceProvider.d.ts +3 -0
  48. package/lib/core/context/SxpDataSourceProvider.js +28 -4
  49. package/lib/core/hooks/useEventReport.js +4 -4
  50. package/lib/index.d.ts +1 -0
  51. package/lib/index.js +3 -1
  52. package/lib/materials/sxp/popup/CommodityDetail/index.js +6 -6
  53. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +9 -9
  54. package/package.json +2 -1
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);
@@ -563,6 +566,19 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
563
566
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
564
567
  return res === null || res === void 0 ? void 0 : res.success;
565
568
  }), [bffFetch]);
569
+ // 获取 Tag
570
+ const bffGetTagList = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
571
+ var _g, _h;
572
+ if (!utmVal)
573
+ return;
574
+ try {
575
+ const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: utmVal } }));
576
+ 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 : []);
577
+ }
578
+ catch (e) {
579
+ console.log('e', e);
580
+ }
581
+ }), [bffFetch, utmVal]);
566
582
  const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
567
583
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
568
584
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
@@ -578,11 +594,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
578
594
  fromKName = 'imagePage';
579
595
  }
580
596
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
581
- 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 })
597
+ 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 })
582
598
  });
583
599
  }, [bffEventReport, isFromHashtag]);
584
600
  React.useEffect(() => {
585
601
  setLoading(true);
602
+ bffGetTagList();
586
603
  getRecommendVideos()
587
604
  .then((data) => {
588
605
  var _a, _b;
@@ -598,6 +615,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
598
615
  if (!isInit.current)
599
616
  return;
600
617
  setLoading(true);
618
+ bffGetTagList();
601
619
  getRecommendVideos()
602
620
  .then((data) => {
603
621
  var _a, _b;
@@ -607,7 +625,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
607
625
  .finally(() => {
608
626
  setLoading(false);
609
627
  });
610
- }, [getRecommendVideos]);
628
+ }, [getRecommendVideos, bffGetTagList]);
611
629
  const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
612
630
  return (React.createElement(SxpDataSourceContext.Provider, { value: {
613
631
  rtcList,
@@ -640,9 +658,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
640
658
  hashTagSize,
641
659
  loadingImage: loadingImage !== null && loadingImage !== void 0 ? loadingImage : defaultLoadingImage,
642
660
  isOpenHashTag,
661
+ tagList,
662
+ setLoading,
643
663
  videoRef,
644
664
  setVideoRef
645
- } }, render({ rtcList, mutateLike: bffMutateLike, mutateUnlike: bffMutateUnlike, submitForm: bffSubmitForm })));
665
+ } }, render({
666
+ rtcList,
667
+ mutateLike: bffMutateLike,
668
+ mutateUnlike: bffMutateUnlike,
669
+ submitForm: bffSubmitForm,
670
+ tagList
671
+ })));
646
672
  };
647
673
  var SxpDataSourceProvider$1 = React.memo(SxpDataSourceProvider);
648
674
 
@@ -867,7 +893,7 @@ const EditorCore = React.forwardRef(({ children, resolver, isSsr, schema, enable
867
893
  React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
868
894
  });
869
895
 
870
- var index$1 = /*#__PURE__*/Object.freeze({
896
+ var index$2 = /*#__PURE__*/Object.freeze({
871
897
  __proto__: null,
872
898
  EditorCore: EditorCore
873
899
  });
@@ -8153,8 +8179,8 @@ function useEventReport() {
8153
8179
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
8154
8180
  contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
8155
8181
  position: position + '',
8156
- 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 : '',
8157
- relatedCtatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
8182
+ 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 : '',
8183
+ ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
8158
8184
  traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
8159
8185
  }
8160
8186
  });
@@ -8178,8 +8204,8 @@ function useEventReport() {
8178
8204
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
8179
8205
  contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
8180
8206
  position: position + '',
8181
- relatedContentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
8182
- relatedCtatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
8207
+ contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
8208
+ ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
8183
8209
  traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
8184
8210
  timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
8185
8211
  eventSubject: 'productView',
@@ -8342,7 +8368,7 @@ const FormatImage = React.forwardRef((props, ref) => {
8342
8368
  var FormatImage$1 = React.memo(FormatImage);
8343
8369
 
8344
8370
  const CommodityDetail$1 = (_a) => {
8345
- var _b, _c, _d, _e, _f, _g, _h, _j;
8371
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k;
8346
8372
  var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index"]);
8347
8373
  const { sxpParameter } = useSxpDataSource();
8348
8374
  const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
@@ -8383,7 +8409,7 @@ const CommodityDetail$1 = (_a) => {
8383
8409
  return '$7,000';
8384
8410
  }
8385
8411
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
8386
- const width = isPreview ? 375 : window.innerWidth;
8412
+ const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
8387
8413
  const renderContent = ({ isPost }) => {
8388
8414
  var _a, _b, _c;
8389
8415
  return (React.createElement("div", null,
@@ -8403,7 +8429,7 @@ const CommodityDetail$1 = (_a) => {
8403
8429
  };
8404
8430
  return (React.createElement("div", { className: 'pb-commondity' },
8405
8431
  React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
8406
- 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: {
8432
+ 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: {
8407
8433
  clickable: true,
8408
8434
  bulletActiveClass: 'swipe-item-active-bullet',
8409
8435
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -8411,7 +8437,7 @@ const CommodityDetail$1 = (_a) => {
8411
8437
  : 'commondityDetail-swiper-clickable-center'
8412
8438
  }, loop: true, autoplay: {
8413
8439
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
8414
- } }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
8440
+ } }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
8415
8441
  return (React.createElement(SwiperSlide, { key: src },
8416
8442
  React.createElement("div", { style: {
8417
8443
  overflow: 'hidden',
@@ -8420,7 +8446,7 @@ const CommodityDetail$1 = (_a) => {
8420
8446
  } },
8421
8447
  React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
8422
8448
  }))),
8423
- !((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css.css({
8449
+ !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css.css({
8424
8450
  position: 'relative',
8425
8451
  height: 0,
8426
8452
  width: '100%',
@@ -8433,7 +8459,7 @@ const CommodityDetail$1 = (_a) => {
8433
8459
  top: 0,
8434
8460
  objectFit: 'cover',
8435
8461
  width: '100%'
8436
- }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
8462
+ }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
8437
8463
  React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
8438
8464
  renderBtn(),
8439
8465
  React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
@@ -8793,7 +8819,7 @@ var settingRender$2 = [
8793
8819
  ];
8794
8820
 
8795
8821
  const CommodityDetailDiroNew$1 = (_a) => {
8796
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
8822
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
8797
8823
  var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index"]);
8798
8824
  React.useState(true);
8799
8825
  const { sxpParameter } = useSxpDataSource();
@@ -8841,7 +8867,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
8841
8867
  return '£102,300.00';
8842
8868
  }
8843
8869
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
8844
- const width = isPreview ? 375 : window.innerWidth;
8870
+ const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
8845
8871
  const productInfoText = ({ isPost }) => {
8846
8872
  return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
8847
8873
  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) ||
@@ -8850,7 +8876,7 @@ Made in Italy` })));
8850
8876
  };
8851
8877
  return (React.createElement("div", { className: 'pb-commondityDiroNew' },
8852
8878
  React.createElement("div", Object.assign({ ref: scrollRef, className: css.css(Object.assign({}, style)) }, props),
8853
- 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: {
8879
+ 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: {
8854
8880
  clickable: true,
8855
8881
  bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
8856
8882
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -8858,7 +8884,7 @@ Made in Italy` })));
8858
8884
  : 'commondityDiroNew-swiper-clickable-center'
8859
8885
  }, loop: true, autoplay: {
8860
8886
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
8861
- } }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
8887
+ } }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
8862
8888
  return (React.createElement(SwiperSlide, { key: src },
8863
8889
  React.createElement("div", { style: {
8864
8890
  overflow: 'hidden',
@@ -8867,7 +8893,7 @@ Made in Italy` })));
8867
8893
  } },
8868
8894
  React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
8869
8895
  }))),
8870
- !((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css.css({
8896
+ !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css.css({
8871
8897
  position: 'relative',
8872
8898
  height: 0,
8873
8899
  width: '100%',
@@ -8880,16 +8906,16 @@ Made in Italy` })));
8880
8906
  top: 0,
8881
8907
  objectFit: 'cover',
8882
8908
  width: '100%'
8883
- }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
8909
+ }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
8884
8910
  React.createElement("div", { className: 'pb-commondityDiroNew-content' },
8885
8911
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
8886
8912
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
8887
- React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (_k = product === null || product === void 0 ? void 0 : product.title) !== null && _k !== void 0 ? _k : 'Large Dior Toujours Bag'),
8913
+ 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'),
8888
8914
  React.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection }, (product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage Calfskin')),
8889
8915
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
8890
8916
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price }, priceText),
8891
- React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo }, (_l = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _l !== void 0 ? _l : '税费'))),
8892
- (!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')),
8917
+ 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 : '税费'))),
8918
+ (!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')),
8893
8919
  productInfoText({ isPost }))),
8894
8920
  React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
8895
8921
  };
@@ -11797,7 +11823,7 @@ const WaterFall = (props) => {
11797
11823
  }
11798
11824
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
11799
11825
  eventInfo: {
11800
- relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
11826
+ contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
11801
11827
  position: cacheActiveIndex + '',
11802
11828
  contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
11803
11829
  traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
@@ -11930,14 +11956,14 @@ var _materials_ = /*#__PURE__*/Object.freeze({
11930
11956
  Prompt: Prompt
11931
11957
  });
11932
11958
 
11933
- const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
11934
- const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
11959
+ const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
11960
+ const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
11935
11961
  const LikeButton = (_a) => {
11936
11962
  var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
11937
11963
  const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
11938
11964
  const [state, setState] = React.useState(active);
11939
- const likeIcon = useIconLink(defaultLikeIconPath);
11940
- const unlikeIcon = useIconLink(defaultUnLikeIconPath);
11965
+ const likeIcon = useIconLink(defaultLikeIconPath$1);
11966
+ const unlikeIcon = useIconLink(defaultUnLikeIconPath$1);
11941
11967
  const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
11942
11968
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
11943
11969
  if (state) {
@@ -11993,7 +12019,7 @@ var SXP_EVENT_TYPE;
11993
12019
  SXP_EVENT_TYPE["PAGE_DID_HIDE"] = "pageDidHide";
11994
12020
  })(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
11995
12021
 
11996
- const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef }) => {
12022
+ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef }) => {
11997
12023
  const [isPauseVideo, setIsPauseVideo] = React.useState(false);
11998
12024
  const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
11999
12025
  const videoStartTime = React.useRef(0);
@@ -12277,7 +12303,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12277
12303
  renderPoster,
12278
12304
  React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
12279
12305
  };
12280
- var VideoWidget$1 = React.memo(VideoWidget);
12306
+ var VideoWidget$3 = React.memo(VideoWidget$2);
12281
12307
 
12282
12308
  /*
12283
12309
  * @Author: binruan@chatlabs.com
@@ -12377,7 +12403,7 @@ const Picture = (props) => {
12377
12403
  * @LastEditTime: 2024-04-18 19:56:22
12378
12404
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
12379
12405
  */
12380
- const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
12406
+ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
12381
12407
  var _a;
12382
12408
  const ref = React.useRef();
12383
12409
  const { isActive } = useSwiperSlide();
@@ -12406,7 +12432,7 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd
12406
12432
  React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
12407
12433
  })));
12408
12434
  };
12409
- var PictureGroup$1 = React.memo(PictureGroup);
12435
+ var PictureGroup$3 = React.memo(PictureGroup$2);
12410
12436
 
12411
12437
  /*
12412
12438
  * @Author: binruan@chatlabs.com
@@ -12570,26 +12596,63 @@ var RenderCard$1 = React.memo(RenderCard);
12570
12596
  *
12571
12597
  */
12572
12598
  const Nudge = ({ nudge }) => {
12599
+ var _a, _b, _c, _d, _e, _f, _g;
12573
12600
  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,
12601
+ marginBottom: (_a = nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom) !== null && _a !== void 0 ? _a : 5,
12602
+ 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,
12603
+ 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
12604
  backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
12578
- borderRadius: nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius
12605
+ borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
12579
12606
  } },
12580
12607
  (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)))));
12608
+ 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
12609
  };
12583
12610
 
12611
+ const DEFAULT_TAG = 'FOR U';
12612
+ const Tagbar = ({ tagList = [], setActiveIndex }) => {
12613
+ const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
12614
+ const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = useSxpDataSource();
12615
+ const realTagList = React.useMemo(() => {
12616
+ return [DEFAULT_TAG, ...tagList];
12617
+ }, [tagList]);
12618
+ const handleSelectTag = (tag) => () => {
12619
+ if (tag === selectTag)
12620
+ return;
12621
+ let hashTag;
12622
+ if (tag !== DEFAULT_TAG) {
12623
+ hashTag = tag;
12624
+ }
12625
+ setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
12626
+ getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ hashTag }).then((res) => {
12627
+ var _a, _b, _c, _d;
12628
+ setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
12629
+ setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
12630
+ setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
12631
+ setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(0);
12632
+ (_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);
12633
+ }).finally(() => {
12634
+ setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
12635
+ });
12636
+ setSelectTag(tag);
12637
+ };
12638
+ if (tagList.length <= 0)
12639
+ return null;
12640
+ return (React.createElement("div", { className: 'clc-sxp-tagbar', style: { height: 45 } },
12641
+ React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
12642
+ return (React.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
12643
+ }))));
12644
+ };
12645
+ var Tagbar$1 = React.memo(Tagbar);
12646
+
12584
12647
  /*
12585
12648
  * @Author: binruan@chatlabs.com
12586
12649
  * @Date: 2024-01-15 19:03:09
12587
12650
  * @LastEditors: binruan@chatlabs.com
12588
- * @LastEditTime: 2024-04-29 15:48:42
12651
+ * @LastEditTime: 2024-04-29 16:33:53
12589
12652
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12590
12653
  *
12591
12654
  */
12592
- const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle }) => {
12655
+ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [] }) => {
12593
12656
  var _a, _b, _c, _d, _e, _f, _g;
12594
12657
  const { schema } = useEditor();
12595
12658
  const [activeIndex, setActiveIndex] = React.useState(0);
@@ -12688,8 +12751,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12688
12751
  // sessionDuration: Math.floor(((new Date() as any) - curTime) / 1000) + '',
12689
12752
  // eventSubject: 'sessionCompleted',
12690
12753
  // eventDescription: 'Session completed',
12691
- // relatedContentId: item?.video?.itemId,
12692
- // relatedProductId: item?.product?.itemId,
12754
+ // contentId: item?.video?.itemId,
12755
+ // productId: item?.product?.itemId,
12693
12756
  // position: item?.position
12694
12757
  // }
12695
12758
  // });
@@ -12733,12 +12796,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12733
12796
  sessionDuration: Math.floor((new Date() - curTime.current) / 1000) + '',
12734
12797
  eventSubject: 'sessionCompleted',
12735
12798
  eventDescription: 'Session completed',
12736
- relatedContentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
12737
- relatedProductId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
12799
+ contentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
12800
+ productId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
12738
12801
  position: activeIndex + '',
12739
12802
  fromKName,
12740
12803
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
12741
- 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 : ''
12804
+ 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 : ''
12742
12805
  }
12743
12806
  });
12744
12807
  }
@@ -12755,8 +12818,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12755
12818
  };
12756
12819
  }, [activeIndex, bffEventReport, curTime, data, handleH5EnterLink, popupDetailData, isFromHashtag, tempMap]);
12757
12820
  const height = React.useMemo(() => {
12758
- return (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo) ? containerHeight - 45 : containerHeight;
12759
- }, [globalConfig, containerHeight]);
12821
+ let minusHeight = 0;
12822
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
12823
+ minusHeight += 45;
12824
+ }
12825
+ if (tagList.length > 0) {
12826
+ minusHeight += 45;
12827
+ }
12828
+ return containerHeight - minusHeight;
12829
+ }, [globalConfig, containerHeight, tagList]);
12760
12830
  const renderLogo = React.useMemo(() => {
12761
12831
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
12762
12832
  return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
@@ -12767,10 +12837,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12767
12837
  const renderContent = React.useCallback((rec, index) => {
12768
12838
  var _a, _b, _c, _d;
12769
12839
  if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
12770
- return (React.createElement(VideoWidget$1, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoRef: videoRef }));
12840
+ 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, videoRef: videoRef }));
12771
12841
  }
12772
12842
  if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
12773
- 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 }));
12843
+ 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 }));
12774
12844
  }
12775
12845
  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) {
12776
12846
  return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
@@ -12816,8 +12886,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12816
12886
  ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
12817
12887
  React.createElement("div", { className: 'clc-sxp-bottom' },
12818
12888
  React.createElement(Nudge, { nudge: nudge }),
12819
- React.createElement("div", { className: 'clc-sxp-bottom-card' },
12820
- React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
12889
+ (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' },
12890
+ React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver }))) : null,
12821
12891
  React.createElement("div", null,
12822
12892
  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 }),
12823
12893
  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 })))));
@@ -12884,8 +12954,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12884
12954
  eventInfo: {
12885
12955
  eventSubject: 'scrollDown',
12886
12956
  eventDescription: 'User scroll down',
12887
- relatedContentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
12888
- relatedProductId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
12957
+ contentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
12958
+ productId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
12889
12959
  requestId: null
12890
12960
  }
12891
12961
  });
@@ -12897,8 +12967,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12897
12967
  eventInfo: {
12898
12968
  eventSubject: 'scrollUp',
12899
12969
  eventDescription: 'User scroll up',
12900
- relatedContentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
12901
- relatedProductId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
12970
+ contentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
12971
+ productId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
12902
12972
  requestId: null
12903
12973
  }
12904
12974
  });
@@ -12978,6 +13048,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
12978
13048
  setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
12979
13049
  } })),
12980
13050
  renderLogo,
13051
+ React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex }),
12981
13052
  isShowFingerTip ? React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
12982
13053
  React.createElement(Swiper, { ref: swiperRef, onSlideChange: () => {
12983
13054
  swiperRef.current.swiper.allowTouchMove = false;
@@ -13038,6 +13109,365 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
13038
13109
  React.createElement("div", { id: 'player-container-id-copy' }))));
13039
13110
  };
13040
13111
 
13112
+ const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
13113
+ 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) => {
13114
+ return (React.createElement(SwiperSlide, { key: url },
13115
+ React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
13116
+ })));
13117
+ };
13118
+ var PictureGroup$1 = React.memo(PictureGroup);
13119
+
13120
+ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width }) => {
13121
+ const [isPauseVideo, setIsPauseVideo] = React.useState(false);
13122
+ const videoRef = React.useRef(null);
13123
+ const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
13124
+ const videoStartTime = React.useRef(0);
13125
+ const [isLoadFinish, setIsLoadFinish] = React.useState(false);
13126
+ const [isFirstPlay, setIsFirstPlay] = React.useState(true);
13127
+ const canvasRef = React.useRef(null);
13128
+ const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
13129
+ React.useEffect(() => {
13130
+ if (!videoRef.current)
13131
+ return;
13132
+ videoRef.current.muted = muted;
13133
+ }, [muted]);
13134
+ const handleVideoStart = React.useCallback(() => {
13135
+ var _a;
13136
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
13137
+ }, []);
13138
+ const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
13139
+ const handlePlaying = React.useCallback(() => {
13140
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
13141
+ setIsPauseVideo(false);
13142
+ const item = data[index];
13143
+ if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
13144
+ videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
13145
+ const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
13146
+ const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
13147
+ const playType = isFirstPlay ? '0' : '1';
13148
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
13149
+ eventInfo: {
13150
+ eventSubject: 'playVideo',
13151
+ eventDescription: 'User played the video',
13152
+ contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
13153
+ contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
13154
+ playType,
13155
+ startTime: videoCurrentTime,
13156
+ videoDuration,
13157
+ contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
13158
+ position: index + '',
13159
+ contentFormat: 'video',
13160
+ traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
13161
+ }
13162
+ });
13163
+ setIsFirstPlay(false);
13164
+ }
13165
+ }, [bffEventReport, data, index, isFirstPlay]);
13166
+ const handleLoadedMetadata = React.useCallback(() => {
13167
+ setIsLoadFinish(true);
13168
+ }, []);
13169
+ const handleClickVideo = React.useCallback((type) => () => {
13170
+ var _a, _b, _c, _d, _e;
13171
+ if (!isLoadFinish)
13172
+ return;
13173
+ const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
13174
+ switch (type) {
13175
+ case 'start':
13176
+ if (!isPause)
13177
+ return;
13178
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
13179
+ setIsPauseVideo(false);
13180
+ break;
13181
+ case 'pause':
13182
+ if (isPause)
13183
+ return;
13184
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
13185
+ setIsPauseVideo(true);
13186
+ break;
13187
+ default:
13188
+ if (isPause) {
13189
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
13190
+ }
13191
+ else {
13192
+ (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
13193
+ }
13194
+ setIsPauseVideo(!isPause);
13195
+ break;
13196
+ }
13197
+ }, [isLoadFinish]);
13198
+ const onPause = React.useCallback(() => {
13199
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
13200
+ const item = data[index];
13201
+ const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
13202
+ const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
13203
+ if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
13204
+ const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
13205
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
13206
+ eventInfo: {
13207
+ eventSubject: 'playOverVideo',
13208
+ eventDescription: 'User finished playing the video',
13209
+ contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
13210
+ contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
13211
+ endTime: videoCurrentTime,
13212
+ videoDuration,
13213
+ playDuration,
13214
+ contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
13215
+ position: index + '',
13216
+ contentFormat: 'video',
13217
+ traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
13218
+ }
13219
+ });
13220
+ }
13221
+ }, [data, index, bffEventReport]);
13222
+ const blur = React.useMemo(() => {
13223
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
13224
+ }, [videoPostConfig]);
13225
+ const translateY = React.useMemo(() => {
13226
+ var _a;
13227
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
13228
+ ? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
13229
+ : 'translateY(-50%)';
13230
+ }, [videoPostConfig]);
13231
+ const blurBgSrc = React.useMemo(() => {
13232
+ var _a;
13233
+ return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
13234
+ }, [firstFrameSrc, rec]);
13235
+ const handLoadeddata = React.useCallback(() => {
13236
+ if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
13237
+ return;
13238
+ const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
13239
+ const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
13240
+ const ctx = canvas.getContext('2d');
13241
+ const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
13242
+ const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
13243
+ canvas.height = targetHeight;
13244
+ canvas.width = targetWidth;
13245
+ ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
13246
+ setFirstFrameSrc(canvas.toDataURL());
13247
+ }, []);
13248
+ React.useEffect(() => {
13249
+ var _a, _b, _c, _d;
13250
+ if (!videoRef.current)
13251
+ return;
13252
+ setIsPauseVideo(false);
13253
+ if (!videoRef.current.src) {
13254
+ const videoSrc = rec.video.url;
13255
+ if (videoSrc.includes('.m3u8')) {
13256
+ if (Hls.isSupported()) {
13257
+ const hls = new Hls();
13258
+ hls.loadSource(videoSrc);
13259
+ hls.attachMedia(videoRef.current);
13260
+ }
13261
+ else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
13262
+ videoRef.current.src = videoSrc;
13263
+ }
13264
+ else {
13265
+ videoRef.current.src = videoSrc;
13266
+ }
13267
+ }
13268
+ else {
13269
+ videoRef.current.src = videoSrc;
13270
+ }
13271
+ videoRef.current.setAttribute('x5-playsinline', 'true');
13272
+ videoRef.current.setAttribute('webkit-playsinline', 'true');
13273
+ }
13274
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
13275
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
13276
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
13277
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
13278
+ return () => {
13279
+ var _a, _b, _c, _d;
13280
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
13281
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
13282
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
13283
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
13284
+ };
13285
+ }, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
13286
+ const renderPoster = React.useMemo(() => {
13287
+ if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
13288
+ return null;
13289
+ }
13290
+ 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 }));
13291
+ }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
13292
+ React.useEffect(() => {
13293
+ const handleBeforeUnload = () => {
13294
+ var _a, _b;
13295
+ 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) {
13296
+ handleClickVideo('pause')();
13297
+ }
13298
+ };
13299
+ window.addEventListener('beforeunload', handleBeforeUnload);
13300
+ return () => {
13301
+ window.removeEventListener('beforeunload', handleBeforeUnload);
13302
+ };
13303
+ }, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
13304
+ const blurStyle = React.useMemo(() => {
13305
+ return blur
13306
+ ? {
13307
+ filter: 'blur(10px)',
13308
+ transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
13309
+ }
13310
+ : {};
13311
+ }, [blur]);
13312
+ if (!rec.video) {
13313
+ return null;
13314
+ }
13315
+ return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
13316
+ position: 'relative',
13317
+ width,
13318
+ height,
13319
+ overflow: 'hidden'
13320
+ } },
13321
+ React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height,
13322
+ width, objectFit: 'cover' }, blurStyle) }),
13323
+ React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
13324
+ React.createElement("div", { style: {
13325
+ position: 'absolute',
13326
+ width,
13327
+ height,
13328
+ top: '50%',
13329
+ transform: translateY,
13330
+ left: 0,
13331
+ right: 0
13332
+ } },
13333
+ React.createElement("div", { style: { position: 'relative', width, height: '100%' } },
13334
+ 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: {
13335
+ width: '100%',
13336
+ height,
13337
+ objectFit: 'contain'
13338
+ } }),
13339
+ React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
13340
+ renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
13341
+ position: 'relative',
13342
+ width,
13343
+ height,
13344
+ overflow: 'hidden'
13345
+ } },
13346
+ 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 }),
13347
+ renderPoster,
13348
+ React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
13349
+ };
13350
+ var VideoWidget$1 = React.memo(VideoWidget);
13351
+
13352
+ const RESOLVER$1 = {};
13353
+ Object.values(_materials_).forEach((v) => {
13354
+ RESOLVER$1[v.extend.type] = v;
13355
+ });
13356
+ const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
13357
+ const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
13358
+ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [] }) => {
13359
+ const height = React.useMemo(() => {
13360
+ let minusHeight = 0;
13361
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
13362
+ minusHeight += 45;
13363
+ }
13364
+ if (tagList.length > 0) {
13365
+ minusHeight += 45;
13366
+ }
13367
+ return containerHeight - minusHeight;
13368
+ }, [globalConfig, containerHeight, tagList]);
13369
+ const renderContent = (rec, index) => {
13370
+ var _a, _b, _c, _d;
13371
+ if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
13372
+ 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 }));
13373
+ }
13374
+ if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
13375
+ 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 }));
13376
+ }
13377
+ if (rec.product) {
13378
+ 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) {
13379
+ return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
13380
+ var _a, _b, _c, _d, _e, _f, _g, _h;
13381
+ const t = RESOLVER$1[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
13382
+ const Component = withBindDataSource(t);
13383
+ const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
13384
+ 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) || {},
13385
+ // schema={schema}
13386
+ id: value === null || value === void 0 ? void 0 : value.id,
13387
+ // viewTime={viewTime.current}
13388
+ 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 })));
13389
+ });
13390
+ }
13391
+ }
13392
+ };
13393
+ const renderLogo = React.useMemo(() => {
13394
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
13395
+ return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
13396
+ React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
13397
+ }
13398
+ return null;
13399
+ }, [globalConfig]);
13400
+ const CTA = (rec, index) => {
13401
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
13402
+ return (React.createElement("div", { className: 'clc-sxp-bottom-card' },
13403
+ React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1 })));
13404
+ }
13405
+ return null;
13406
+ };
13407
+ const renderBottom = (rec, index) => {
13408
+ var _a, _b, _c, _d, _e, _f, _g;
13409
+ if (rec.video) {
13410
+ return (React.createElement(React.Fragment, null,
13411
+ ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
13412
+ React.createElement("div", { className: 'clc-sxp-bottom' },
13413
+ React.createElement(Nudge, { nudge: nudge }),
13414
+ CTA(rec, index),
13415
+ React.createElement("div", null,
13416
+ 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' }) })),
13417
+ 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 }))));
13418
+ }
13419
+ return null;
13420
+ };
13421
+ const likeIcon = useIconLink(defaultLikeIconPath, appDomain);
13422
+ const unlikeIcon = useIconLink(defaultUnLikeIconPath, appDomain);
13423
+ const renderLikeButton = (rec, index) => {
13424
+ var _a, _b, _c, _d;
13425
+ if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
13426
+ return;
13427
+ let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
13428
+ if (top < 40) {
13429
+ top += 40;
13430
+ }
13431
+ if (rec.video) {
13432
+ 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: {
13433
+ top,
13434
+ right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0
13435
+ } }));
13436
+ }
13437
+ return null;
13438
+ };
13439
+ const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png', appDomain);
13440
+ const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png', appDomain);
13441
+ const renderView = (rec, index) => {
13442
+ var _a, _b, _c, _d;
13443
+ return (React.createElement("div", { style: { position: 'relative', border: '1px solid #e1e1e1' } },
13444
+ renderLogo,
13445
+ React.createElement(Tagbar$1, { tagList: tagList }),
13446
+ React.createElement(ToggleButton$1, { style: {
13447
+ position: 'absolute',
13448
+ right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
13449
+ 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',
13450
+ bottom: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _d !== void 0 ? _d : 23,
13451
+ zIndex: 999
13452
+ }, 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 }),
13453
+ renderContent(rec, index),
13454
+ renderBottom(rec, index),
13455
+ renderLikeButton(rec, index)));
13456
+ };
13457
+ return (React.createElement("div", { style: {
13458
+ width: '100%',
13459
+ height: containerHeight,
13460
+ display: 'flex',
13461
+ boxSizing: 'border-box',
13462
+ gap: 16,
13463
+ pointerEvents: 'none',
13464
+ userSelect: 'none'
13465
+ } }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
13466
+ return renderView(rec, index);
13467
+ })));
13468
+ };
13469
+ var index$1 = React.memo(DiyPortalPreview);
13470
+
13041
13471
  /*
13042
13472
  * @Author: binruan@chatlabs.com
13043
13473
  * @Date: 2023-10-31 10:56:01
@@ -13131,10 +13561,10 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
13131
13561
  return searchParams;
13132
13562
  }, []);
13133
13563
  return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
13134
- 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 }) => {
13564
+ 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 }) => {
13135
13565
  var _a;
13136
13566
  return (React.createElement(React.Fragment, null,
13137
- 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 })),
13567
+ 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 })),
13138
13568
  React.createElement(Popup, null)));
13139
13569
  } })));
13140
13570
  };
@@ -13178,13 +13608,15 @@ function useEditorDataProvider() {
13178
13608
  * @FilePath: \pb-sxp-ui\src\index.ts
13179
13609
  */
13180
13610
 
13611
+ exports.DiyPortalPreview = index$1;
13181
13612
  exports.EditorDataProvider = EditorDataProvider;
13182
13613
  exports.Modal = Modal$1;
13183
13614
  exports.SxpDataSourceProvider = SxpDataSourceProvider$1;
13184
13615
  exports.SxpPageCore = index;
13185
13616
  exports.SxpPageRender = SxpPageRender;
13186
- exports.core = index$1;
13617
+ exports.core = index$2;
13187
13618
  exports.default = Pagebuilder;
13188
13619
  exports.defaultSetting = defaultSetting;
13189
13620
  exports.materials = _materials_;
13190
13621
  exports.useEditorDataProvider = useEditorDataProvider;
13622
+ //# sourceMappingURL=index.cjs.map