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/pb-ui.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('uuid'), require('pako'), require('react'), require('qs'), require('@emotion/css'), require('@ant-design/pro-components'), require('react-dom'), require('eventemitter3')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'lodash', 'uuid', 'pako', 'react', 'qs', '@emotion/css', '@ant-design/pro-components', 'react-dom', 'eventemitter3'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PUI = {}, global.lodash, global.uuid$1, global.pako, global.React, global.qs, global.css, global.proComponents, global.ReactDOM, global.EventEmitter));
5
- })(this, (function (exports, lodash, uuid$1, pako, React, qs, css, proComponents, ReactDOM, EventEmitter) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('uuid'), require('pako'), require('react'), require('qs'), require('@emotion/css'), require('@ant-design/pro-components'), require('react-dom'), require('eventemitter3'), require('hls.js')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'lodash', 'uuid', 'pako', 'react', 'qs', '@emotion/css', '@ant-design/pro-components', 'react-dom', 'eventemitter3', 'hls.js'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PUI = {}, global.lodash, global.uuid$1, global.pako, global.React, global.qs, global.css, global.proComponents, global.ReactDOM, global.EventEmitter, global.Hls));
5
+ })(this, (function (exports, lodash, uuid$1, pako, React, qs, css, proComponents, ReactDOM, EventEmitter, Hls) { 'use strict';
6
6
 
7
7
  function _interopNamespaceDefault(e) {
8
8
  var n = Object.create(null);
@@ -422,7 +422,8 @@
422
422
  }
423
423
 
424
424
  const SxpDataSourceContext = React.createContext({
425
- rtcList: []
425
+ rtcList: [],
426
+ tagList: []
426
427
  });
427
428
  var DataSourceType;
428
429
  (function (DataSourceType) {
@@ -431,6 +432,7 @@
431
432
  const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
432
433
  const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false }) => {
433
434
  const [rtcList, setRtcList] = React.useState([]);
435
+ const [tagList, setTagList] = React.useState([]);
434
436
  const [loading, setLoading] = React.useState(false);
435
437
  const [curReqInfo, setCurReqInfo] = React.useState({ rtc: '', requestId: '' });
436
438
  const swiperRef = React.useRef(null);
@@ -555,6 +557,19 @@
555
557
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
556
558
  return res === null || res === void 0 ? void 0 : res.success;
557
559
  }), [bffFetch]);
560
+ // 获取 Tag
561
+ const bffGetTagList = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
562
+ var _g, _h;
563
+ if (!utmVal)
564
+ return;
565
+ try {
566
+ const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: utmVal } }));
567
+ 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 : []);
568
+ }
569
+ catch (e) {
570
+ console.log('e', e);
571
+ }
572
+ }), [bffFetch, utmVal]);
558
573
  const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
559
574
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
560
575
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
@@ -570,11 +585,12 @@
570
585
  fromKName = 'imagePage';
571
586
  }
572
587
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
573
- eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', 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 })
588
+ 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 })
574
589
  });
575
590
  }, [bffEventReport, isFromHashtag]);
576
591
  React.useEffect(() => {
577
592
  setLoading(true);
593
+ bffGetTagList();
578
594
  getRecommendVideos()
579
595
  .then((data) => {
580
596
  var _a, _b;
@@ -590,6 +606,7 @@
590
606
  if (!isInit.current)
591
607
  return;
592
608
  setLoading(true);
609
+ bffGetTagList();
593
610
  getRecommendVideos()
594
611
  .then((data) => {
595
612
  var _a, _b;
@@ -599,7 +616,7 @@
599
616
  .finally(() => {
600
617
  setLoading(false);
601
618
  });
602
- }, [getRecommendVideos]);
619
+ }, [getRecommendVideos, bffGetTagList]);
603
620
  const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
604
621
  return (React.createElement(SxpDataSourceContext.Provider, { value: {
605
622
  rtcList,
@@ -632,9 +649,17 @@
632
649
  hashTagSize,
633
650
  loadingImage: loadingImage !== null && loadingImage !== void 0 ? loadingImage : defaultLoadingImage,
634
651
  isOpenHashTag,
652
+ tagList,
653
+ setLoading,
635
654
  videoRef,
636
655
  setVideoRef
637
- } }, render({ rtcList, mutateLike: bffMutateLike, mutateUnlike: bffMutateUnlike, submitForm: bffSubmitForm })));
656
+ } }, render({
657
+ rtcList,
658
+ mutateLike: bffMutateLike,
659
+ mutateUnlike: bffMutateUnlike,
660
+ submitForm: bffSubmitForm,
661
+ tagList
662
+ })));
638
663
  };
639
664
  var SxpDataSourceProvider$1 = React.memo(SxpDataSourceProvider);
640
665
 
@@ -859,7 +884,7 @@
859
884
  React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
860
885
  });
861
886
 
862
- var index$1 = /*#__PURE__*/Object.freeze({
887
+ var index$2 = /*#__PURE__*/Object.freeze({
863
888
  __proto__: null,
864
889
  EditorCore: EditorCore
865
890
  });
@@ -8145,8 +8170,8 @@
8145
8170
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
8146
8171
  contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
8147
8172
  position: position + '',
8148
- 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 : '',
8149
- relatedCtatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
8173
+ 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 : '',
8174
+ ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
8150
8175
  traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
8151
8176
  }
8152
8177
  });
@@ -8170,8 +8195,8 @@
8170
8195
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
8171
8196
  contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
8172
8197
  position: position + '',
8173
- relatedContentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
8174
- relatedCtatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
8198
+ contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
8199
+ ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
8175
8200
  traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
8176
8201
  timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
8177
8202
  eventSubject: 'productView',
@@ -8334,7 +8359,7 @@
8334
8359
  var FormatImage$1 = React.memo(FormatImage);
8335
8360
 
8336
8361
  const CommodityDetail$1 = (_a) => {
8337
- var _b, _c, _d, _e, _f, _g, _h, _j;
8362
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k;
8338
8363
  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"]);
8339
8364
  const { sxpParameter } = useSxpDataSource();
8340
8365
  const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
@@ -8375,7 +8400,7 @@
8375
8400
  return '$7,000';
8376
8401
  }
8377
8402
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
8378
- const width = isPreview ? 375 : window.innerWidth;
8403
+ const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
8379
8404
  const renderContent = ({ isPost }) => {
8380
8405
  var _a, _b, _c;
8381
8406
  return (React.createElement("div", null,
@@ -8395,7 +8420,7 @@
8395
8420
  };
8396
8421
  return (React.createElement("div", { className: 'pb-commondity' },
8397
8422
  React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
8398
- 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: {
8423
+ 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: {
8399
8424
  clickable: true,
8400
8425
  bulletActiveClass: 'swipe-item-active-bullet',
8401
8426
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -8403,7 +8428,7 @@
8403
8428
  : 'commondityDetail-swiper-clickable-center'
8404
8429
  }, loop: true, autoplay: {
8405
8430
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
8406
- } }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
8431
+ } }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
8407
8432
  return (React.createElement(SwiperSlide, { key: src },
8408
8433
  React.createElement("div", { style: {
8409
8434
  overflow: 'hidden',
@@ -8412,7 +8437,7 @@
8412
8437
  } },
8413
8438
  React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
8414
8439
  }))),
8415
- !((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css.css({
8440
+ !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css.css({
8416
8441
  position: 'relative',
8417
8442
  height: 0,
8418
8443
  width: '100%',
@@ -8425,7 +8450,7 @@
8425
8450
  top: 0,
8426
8451
  objectFit: 'cover',
8427
8452
  width: '100%'
8428
- }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
8453
+ }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
8429
8454
  React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
8430
8455
  renderBtn(),
8431
8456
  React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
@@ -8785,7 +8810,7 @@
8785
8810
  ];
8786
8811
 
8787
8812
  const CommodityDetailDiroNew$1 = (_a) => {
8788
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
8813
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
8789
8814
  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"]);
8790
8815
  React.useState(true);
8791
8816
  const { sxpParameter } = useSxpDataSource();
@@ -8833,7 +8858,7 @@
8833
8858
  return '£102,300.00';
8834
8859
  }
8835
8860
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
8836
- const width = isPreview ? 375 : window.innerWidth;
8861
+ const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
8837
8862
  const productInfoText = ({ isPost }) => {
8838
8863
  return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
8839
8864
  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) ||
@@ -8842,7 +8867,7 @@ Made in Italy` })));
8842
8867
  };
8843
8868
  return (React.createElement("div", { className: 'pb-commondityDiroNew' },
8844
8869
  React.createElement("div", Object.assign({ ref: scrollRef, className: css.css(Object.assign({}, style)) }, props),
8845
- 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: {
8870
+ 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: {
8846
8871
  clickable: true,
8847
8872
  bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
8848
8873
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -8850,7 +8875,7 @@ Made in Italy` })));
8850
8875
  : 'commondityDiroNew-swiper-clickable-center'
8851
8876
  }, loop: true, autoplay: {
8852
8877
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
8853
- } }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
8878
+ } }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
8854
8879
  return (React.createElement(SwiperSlide, { key: src },
8855
8880
  React.createElement("div", { style: {
8856
8881
  overflow: 'hidden',
@@ -8859,7 +8884,7 @@ Made in Italy` })));
8859
8884
  } },
8860
8885
  React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
8861
8886
  }))),
8862
- !((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css.css({
8887
+ !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css.css({
8863
8888
  position: 'relative',
8864
8889
  height: 0,
8865
8890
  width: '100%',
@@ -8872,16 +8897,16 @@ Made in Italy` })));
8872
8897
  top: 0,
8873
8898
  objectFit: 'cover',
8874
8899
  width: '100%'
8875
- }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
8900
+ }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
8876
8901
  React.createElement("div", { className: 'pb-commondityDiroNew-content' },
8877
8902
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
8878
8903
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
8879
- 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'),
8904
+ 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'),
8880
8905
  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')),
8881
8906
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
8882
8907
  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),
8883
- 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 : '税费'))),
8884
- (!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')),
8908
+ 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 : '税费'))),
8909
+ (!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')),
8885
8910
  productInfoText({ isPost }))),
8886
8911
  React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
8887
8912
  };
@@ -11789,7 +11814,7 @@ Made in Italy` })));
11789
11814
  }
11790
11815
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
11791
11816
  eventInfo: {
11792
- relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
11817
+ contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
11793
11818
  position: cacheActiveIndex + '',
11794
11819
  contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
11795
11820
  traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
@@ -11922,14 +11947,14 @@ Made in Italy` })));
11922
11947
  Prompt: Prompt
11923
11948
  });
11924
11949
 
11925
- const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
11926
- const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
11950
+ const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
11951
+ const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
11927
11952
  const LikeButton = (_a) => {
11928
11953
  var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
11929
11954
  const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
11930
11955
  const [state, setState] = React.useState(active);
11931
- const likeIcon = useIconLink(defaultLikeIconPath);
11932
- const unlikeIcon = useIconLink(defaultUnLikeIconPath);
11956
+ const likeIcon = useIconLink(defaultLikeIconPath$1);
11957
+ const unlikeIcon = useIconLink(defaultUnLikeIconPath$1);
11933
11958
  const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
11934
11959
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
11935
11960
  if (state) {
@@ -11985,7 +12010,7 @@ Made in Italy` })));
11985
12010
  SXP_EVENT_TYPE["PAGE_DID_HIDE"] = "pageDidHide";
11986
12011
  })(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
11987
12012
 
11988
- const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef }) => {
12013
+ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef }) => {
11989
12014
  const [isPauseVideo, setIsPauseVideo] = React.useState(false);
11990
12015
  const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
11991
12016
  const videoStartTime = React.useRef(0);
@@ -12269,7 +12294,7 @@ Made in Italy` })));
12269
12294
  renderPoster,
12270
12295
  React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
12271
12296
  };
12272
- var VideoWidget$1 = React.memo(VideoWidget);
12297
+ var VideoWidget$3 = React.memo(VideoWidget$2);
12273
12298
 
12274
12299
  /*
12275
12300
  * @Author: binruan@chatlabs.com
@@ -12369,7 +12394,7 @@ Made in Italy` })));
12369
12394
  * @LastEditTime: 2024-04-18 19:56:22
12370
12395
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
12371
12396
  */
12372
- const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
12397
+ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
12373
12398
  var _a;
12374
12399
  const ref = React.useRef();
12375
12400
  const { isActive } = useSwiperSlide();
@@ -12398,7 +12423,7 @@ Made in Italy` })));
12398
12423
  React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
12399
12424
  })));
12400
12425
  };
12401
- var PictureGroup$1 = React.memo(PictureGroup);
12426
+ var PictureGroup$3 = React.memo(PictureGroup$2);
12402
12427
 
12403
12428
  /*
12404
12429
  * @Author: binruan@chatlabs.com
@@ -12562,26 +12587,63 @@ Made in Italy` })));
12562
12587
  *
12563
12588
  */
12564
12589
  const Nudge = ({ nudge }) => {
12590
+ var _a, _b, _c, _d, _e, _f, _g;
12565
12591
  return (React.createElement(React.Fragment, null, (nudge === null || nudge === void 0 ? void 0 : nudge.isOpen) && (React.createElement("div", { className: 'clc-sxp-bottom-nudge', style: {
12566
- marginBottom: nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom,
12567
- width: nudge === null || nudge === void 0 ? void 0 : nudge.size.width,
12568
- height: nudge === null || nudge === void 0 ? void 0 : nudge.size.height,
12592
+ marginBottom: (_a = nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom) !== null && _a !== void 0 ? _a : 5,
12593
+ 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,
12594
+ 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,
12569
12595
  backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
12570
- borderRadius: nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius
12596
+ borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
12571
12597
  } },
12572
12598
  (nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover' } }) : null,
12573
- React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, nudge === null || nudge === void 0 ? void 0 : nudge.content)))));
12599
+ 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 : '')))));
12574
12600
  };
12575
12601
 
12602
+ const DEFAULT_TAG = 'FOR U';
12603
+ const Tagbar = ({ tagList = [], setActiveIndex }) => {
12604
+ const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
12605
+ const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = useSxpDataSource();
12606
+ const realTagList = React.useMemo(() => {
12607
+ return [DEFAULT_TAG, ...tagList];
12608
+ }, [tagList]);
12609
+ const handleSelectTag = (tag) => () => {
12610
+ if (tag === selectTag)
12611
+ return;
12612
+ let hashTag;
12613
+ if (tag !== DEFAULT_TAG) {
12614
+ hashTag = tag;
12615
+ }
12616
+ setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
12617
+ getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ hashTag }).then((res) => {
12618
+ var _a, _b, _c, _d;
12619
+ setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
12620
+ setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
12621
+ setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
12622
+ setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(0);
12623
+ (_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);
12624
+ }).finally(() => {
12625
+ setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
12626
+ });
12627
+ setSelectTag(tag);
12628
+ };
12629
+ if (tagList.length <= 0)
12630
+ return null;
12631
+ return (React.createElement("div", { className: 'clc-sxp-tagbar', style: { height: 45 } },
12632
+ React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
12633
+ return (React.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
12634
+ }))));
12635
+ };
12636
+ var Tagbar$1 = React.memo(Tagbar);
12637
+
12576
12638
  /*
12577
12639
  * @Author: binruan@chatlabs.com
12578
12640
  * @Date: 2024-01-15 19:03:09
12579
12641
  * @LastEditors: binruan@chatlabs.com
12580
- * @LastEditTime: 2024-04-29 15:48:42
12642
+ * @LastEditTime: 2024-04-29 16:33:53
12581
12643
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12582
12644
  *
12583
12645
  */
12584
- const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle }) => {
12646
+ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [] }) => {
12585
12647
  var _a, _b, _c, _d, _e, _f, _g;
12586
12648
  const { schema } = useEditor();
12587
12649
  const [activeIndex, setActiveIndex] = React.useState(0);
@@ -12680,8 +12742,8 @@ Made in Italy` })));
12680
12742
  // sessionDuration: Math.floor(((new Date() as any) - curTime) / 1000) + '',
12681
12743
  // eventSubject: 'sessionCompleted',
12682
12744
  // eventDescription: 'Session completed',
12683
- // relatedContentId: item?.video?.itemId,
12684
- // relatedProductId: item?.product?.itemId,
12745
+ // contentId: item?.video?.itemId,
12746
+ // productId: item?.product?.itemId,
12685
12747
  // position: item?.position
12686
12748
  // }
12687
12749
  // });
@@ -12725,12 +12787,12 @@ Made in Italy` })));
12725
12787
  sessionDuration: Math.floor((new Date() - curTime.current) / 1000) + '',
12726
12788
  eventSubject: 'sessionCompleted',
12727
12789
  eventDescription: 'Session completed',
12728
- relatedContentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
12729
- relatedProductId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
12790
+ contentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
12791
+ productId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
12730
12792
  position: activeIndex + '',
12731
12793
  fromKName,
12732
12794
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
12733
- 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 : ''
12795
+ 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 : ''
12734
12796
  }
12735
12797
  });
12736
12798
  }
@@ -12747,8 +12809,15 @@ Made in Italy` })));
12747
12809
  };
12748
12810
  }, [activeIndex, bffEventReport, curTime, data, handleH5EnterLink, popupDetailData, isFromHashtag, tempMap]);
12749
12811
  const height = React.useMemo(() => {
12750
- return (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo) ? containerHeight - 45 : containerHeight;
12751
- }, [globalConfig, containerHeight]);
12812
+ let minusHeight = 0;
12813
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
12814
+ minusHeight += 45;
12815
+ }
12816
+ if (tagList.length > 0) {
12817
+ minusHeight += 45;
12818
+ }
12819
+ return containerHeight - minusHeight;
12820
+ }, [globalConfig, containerHeight, tagList]);
12752
12821
  const renderLogo = React.useMemo(() => {
12753
12822
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
12754
12823
  return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
@@ -12759,10 +12828,10 @@ Made in Italy` })));
12759
12828
  const renderContent = React.useCallback((rec, index) => {
12760
12829
  var _a, _b, _c, _d;
12761
12830
  if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
12762
- 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 }));
12831
+ 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 }));
12763
12832
  }
12764
12833
  if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
12765
- 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 }));
12834
+ 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 }));
12766
12835
  }
12767
12836
  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) {
12768
12837
  return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
@@ -12808,8 +12877,8 @@ Made in Italy` })));
12808
12877
  ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
12809
12878
  React.createElement("div", { className: 'clc-sxp-bottom' },
12810
12879
  React.createElement(Nudge, { nudge: nudge }),
12811
- React.createElement("div", { className: 'clc-sxp-bottom-card' },
12812
- React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
12880
+ (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' },
12881
+ React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver }))) : null,
12813
12882
  React.createElement("div", null,
12814
12883
  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 }),
12815
12884
  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 })))));
@@ -12876,8 +12945,8 @@ Made in Italy` })));
12876
12945
  eventInfo: {
12877
12946
  eventSubject: 'scrollDown',
12878
12947
  eventDescription: 'User scroll down',
12879
- relatedContentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
12880
- relatedProductId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
12948
+ contentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
12949
+ productId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
12881
12950
  requestId: null
12882
12951
  }
12883
12952
  });
@@ -12889,8 +12958,8 @@ Made in Italy` })));
12889
12958
  eventInfo: {
12890
12959
  eventSubject: 'scrollUp',
12891
12960
  eventDescription: 'User scroll up',
12892
- relatedContentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
12893
- relatedProductId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
12961
+ contentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
12962
+ productId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
12894
12963
  requestId: null
12895
12964
  }
12896
12965
  });
@@ -12970,6 +13039,7 @@ Made in Italy` })));
12970
13039
  setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
12971
13040
  } })),
12972
13041
  renderLogo,
13042
+ React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex }),
12973
13043
  isShowFingerTip ? React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
12974
13044
  React.createElement(Swiper, { ref: swiperRef, onSlideChange: () => {
12975
13045
  swiperRef.current.swiper.allowTouchMove = false;
@@ -13030,6 +13100,365 @@ Made in Italy` })));
13030
13100
  React.createElement("div", { id: 'player-container-id-copy' }))));
13031
13101
  };
13032
13102
 
13103
+ const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
13104
+ 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) => {
13105
+ return (React.createElement(SwiperSlide, { key: url },
13106
+ React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
13107
+ })));
13108
+ };
13109
+ var PictureGroup$1 = React.memo(PictureGroup);
13110
+
13111
+ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width }) => {
13112
+ const [isPauseVideo, setIsPauseVideo] = React.useState(false);
13113
+ const videoRef = React.useRef(null);
13114
+ const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
13115
+ const videoStartTime = React.useRef(0);
13116
+ const [isLoadFinish, setIsLoadFinish] = React.useState(false);
13117
+ const [isFirstPlay, setIsFirstPlay] = React.useState(true);
13118
+ const canvasRef = React.useRef(null);
13119
+ const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
13120
+ React.useEffect(() => {
13121
+ if (!videoRef.current)
13122
+ return;
13123
+ videoRef.current.muted = muted;
13124
+ }, [muted]);
13125
+ const handleVideoStart = React.useCallback(() => {
13126
+ var _a;
13127
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
13128
+ }, []);
13129
+ const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
13130
+ const handlePlaying = React.useCallback(() => {
13131
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
13132
+ setIsPauseVideo(false);
13133
+ const item = data[index];
13134
+ if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
13135
+ videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
13136
+ const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
13137
+ const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
13138
+ const playType = isFirstPlay ? '0' : '1';
13139
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
13140
+ eventInfo: {
13141
+ eventSubject: 'playVideo',
13142
+ eventDescription: 'User played the video',
13143
+ contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
13144
+ contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
13145
+ playType,
13146
+ startTime: videoCurrentTime,
13147
+ videoDuration,
13148
+ contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
13149
+ position: index + '',
13150
+ contentFormat: 'video',
13151
+ traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
13152
+ }
13153
+ });
13154
+ setIsFirstPlay(false);
13155
+ }
13156
+ }, [bffEventReport, data, index, isFirstPlay]);
13157
+ const handleLoadedMetadata = React.useCallback(() => {
13158
+ setIsLoadFinish(true);
13159
+ }, []);
13160
+ const handleClickVideo = React.useCallback((type) => () => {
13161
+ var _a, _b, _c, _d, _e;
13162
+ if (!isLoadFinish)
13163
+ return;
13164
+ const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
13165
+ switch (type) {
13166
+ case 'start':
13167
+ if (!isPause)
13168
+ return;
13169
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
13170
+ setIsPauseVideo(false);
13171
+ break;
13172
+ case 'pause':
13173
+ if (isPause)
13174
+ return;
13175
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
13176
+ setIsPauseVideo(true);
13177
+ break;
13178
+ default:
13179
+ if (isPause) {
13180
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
13181
+ }
13182
+ else {
13183
+ (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
13184
+ }
13185
+ setIsPauseVideo(!isPause);
13186
+ break;
13187
+ }
13188
+ }, [isLoadFinish]);
13189
+ const onPause = React.useCallback(() => {
13190
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
13191
+ const item = data[index];
13192
+ const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
13193
+ const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
13194
+ if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
13195
+ const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
13196
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
13197
+ eventInfo: {
13198
+ eventSubject: 'playOverVideo',
13199
+ eventDescription: 'User finished playing the video',
13200
+ contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
13201
+ contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
13202
+ endTime: videoCurrentTime,
13203
+ videoDuration,
13204
+ playDuration,
13205
+ contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
13206
+ position: index + '',
13207
+ contentFormat: 'video',
13208
+ traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
13209
+ }
13210
+ });
13211
+ }
13212
+ }, [data, index, bffEventReport]);
13213
+ const blur = React.useMemo(() => {
13214
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
13215
+ }, [videoPostConfig]);
13216
+ const translateY = React.useMemo(() => {
13217
+ var _a;
13218
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
13219
+ ? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
13220
+ : 'translateY(-50%)';
13221
+ }, [videoPostConfig]);
13222
+ const blurBgSrc = React.useMemo(() => {
13223
+ var _a;
13224
+ return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
13225
+ }, [firstFrameSrc, rec]);
13226
+ const handLoadeddata = React.useCallback(() => {
13227
+ if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
13228
+ return;
13229
+ const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
13230
+ const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
13231
+ const ctx = canvas.getContext('2d');
13232
+ const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
13233
+ const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
13234
+ canvas.height = targetHeight;
13235
+ canvas.width = targetWidth;
13236
+ ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
13237
+ setFirstFrameSrc(canvas.toDataURL());
13238
+ }, []);
13239
+ React.useEffect(() => {
13240
+ var _a, _b, _c, _d;
13241
+ if (!videoRef.current)
13242
+ return;
13243
+ setIsPauseVideo(false);
13244
+ if (!videoRef.current.src) {
13245
+ const videoSrc = rec.video.url;
13246
+ if (videoSrc.includes('.m3u8')) {
13247
+ if (Hls.isSupported()) {
13248
+ const hls = new Hls();
13249
+ hls.loadSource(videoSrc);
13250
+ hls.attachMedia(videoRef.current);
13251
+ }
13252
+ else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
13253
+ videoRef.current.src = videoSrc;
13254
+ }
13255
+ else {
13256
+ videoRef.current.src = videoSrc;
13257
+ }
13258
+ }
13259
+ else {
13260
+ videoRef.current.src = videoSrc;
13261
+ }
13262
+ videoRef.current.setAttribute('x5-playsinline', 'true');
13263
+ videoRef.current.setAttribute('webkit-playsinline', 'true');
13264
+ }
13265
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
13266
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
13267
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
13268
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
13269
+ return () => {
13270
+ var _a, _b, _c, _d;
13271
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
13272
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
13273
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
13274
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
13275
+ };
13276
+ }, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
13277
+ const renderPoster = React.useMemo(() => {
13278
+ if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
13279
+ return null;
13280
+ }
13281
+ 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 }));
13282
+ }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
13283
+ React.useEffect(() => {
13284
+ const handleBeforeUnload = () => {
13285
+ var _a, _b;
13286
+ 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) {
13287
+ handleClickVideo('pause')();
13288
+ }
13289
+ };
13290
+ window.addEventListener('beforeunload', handleBeforeUnload);
13291
+ return () => {
13292
+ window.removeEventListener('beforeunload', handleBeforeUnload);
13293
+ };
13294
+ }, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
13295
+ const blurStyle = React.useMemo(() => {
13296
+ return blur
13297
+ ? {
13298
+ filter: 'blur(10px)',
13299
+ transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
13300
+ }
13301
+ : {};
13302
+ }, [blur]);
13303
+ if (!rec.video) {
13304
+ return null;
13305
+ }
13306
+ return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
13307
+ position: 'relative',
13308
+ width,
13309
+ height,
13310
+ overflow: 'hidden'
13311
+ } },
13312
+ React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height,
13313
+ width, objectFit: 'cover' }, blurStyle) }),
13314
+ React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
13315
+ React.createElement("div", { style: {
13316
+ position: 'absolute',
13317
+ width,
13318
+ height,
13319
+ top: '50%',
13320
+ transform: translateY,
13321
+ left: 0,
13322
+ right: 0
13323
+ } },
13324
+ React.createElement("div", { style: { position: 'relative', width, height: '100%' } },
13325
+ 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: {
13326
+ width: '100%',
13327
+ height,
13328
+ objectFit: 'contain'
13329
+ } }),
13330
+ React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
13331
+ renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
13332
+ position: 'relative',
13333
+ width,
13334
+ height,
13335
+ overflow: 'hidden'
13336
+ } },
13337
+ 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 }),
13338
+ renderPoster,
13339
+ React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
13340
+ };
13341
+ var VideoWidget$1 = React.memo(VideoWidget);
13342
+
13343
+ const RESOLVER$1 = {};
13344
+ Object.values(_materials_).forEach((v) => {
13345
+ RESOLVER$1[v.extend.type] = v;
13346
+ });
13347
+ const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
13348
+ const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
13349
+ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [] }) => {
13350
+ const height = React.useMemo(() => {
13351
+ let minusHeight = 0;
13352
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
13353
+ minusHeight += 45;
13354
+ }
13355
+ if (tagList.length > 0) {
13356
+ minusHeight += 45;
13357
+ }
13358
+ return containerHeight - minusHeight;
13359
+ }, [globalConfig, containerHeight, tagList]);
13360
+ const renderContent = (rec, index) => {
13361
+ var _a, _b, _c, _d;
13362
+ if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
13363
+ 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 }));
13364
+ }
13365
+ if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
13366
+ 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 }));
13367
+ }
13368
+ if (rec.product) {
13369
+ 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) {
13370
+ return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
13371
+ var _a, _b, _c, _d, _e, _f, _g, _h;
13372
+ const t = RESOLVER$1[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
13373
+ const Component = withBindDataSource(t);
13374
+ const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
13375
+ 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) || {},
13376
+ // schema={schema}
13377
+ id: value === null || value === void 0 ? void 0 : value.id,
13378
+ // viewTime={viewTime.current}
13379
+ 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 })));
13380
+ });
13381
+ }
13382
+ }
13383
+ };
13384
+ const renderLogo = React.useMemo(() => {
13385
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
13386
+ return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
13387
+ React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
13388
+ }
13389
+ return null;
13390
+ }, [globalConfig]);
13391
+ const CTA = (rec, index) => {
13392
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
13393
+ return (React.createElement("div", { className: 'clc-sxp-bottom-card' },
13394
+ React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1 })));
13395
+ }
13396
+ return null;
13397
+ };
13398
+ const renderBottom = (rec, index) => {
13399
+ var _a, _b, _c, _d, _e, _f, _g;
13400
+ if (rec.video) {
13401
+ return (React.createElement(React.Fragment, null,
13402
+ ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
13403
+ React.createElement("div", { className: 'clc-sxp-bottom' },
13404
+ React.createElement(Nudge, { nudge: nudge }),
13405
+ CTA(rec, index),
13406
+ React.createElement("div", null,
13407
+ 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' }) })),
13408
+ 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 }))));
13409
+ }
13410
+ return null;
13411
+ };
13412
+ const likeIcon = useIconLink(defaultLikeIconPath, appDomain);
13413
+ const unlikeIcon = useIconLink(defaultUnLikeIconPath, appDomain);
13414
+ const renderLikeButton = (rec, index) => {
13415
+ var _a, _b, _c, _d;
13416
+ if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
13417
+ return;
13418
+ let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
13419
+ if (top < 40) {
13420
+ top += 40;
13421
+ }
13422
+ if (rec.video) {
13423
+ 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: {
13424
+ top,
13425
+ right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0
13426
+ } }));
13427
+ }
13428
+ return null;
13429
+ };
13430
+ const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png', appDomain);
13431
+ const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png', appDomain);
13432
+ const renderView = (rec, index) => {
13433
+ var _a, _b, _c, _d;
13434
+ return (React.createElement("div", { style: { position: 'relative', border: '1px solid #e1e1e1' } },
13435
+ renderLogo,
13436
+ React.createElement(Tagbar$1, { tagList: tagList }),
13437
+ React.createElement(ToggleButton$1, { style: {
13438
+ position: 'absolute',
13439
+ right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
13440
+ 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',
13441
+ bottom: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _d !== void 0 ? _d : 23,
13442
+ zIndex: 999
13443
+ }, 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 }),
13444
+ renderContent(rec, index),
13445
+ renderBottom(rec, index),
13446
+ renderLikeButton(rec, index)));
13447
+ };
13448
+ return (React.createElement("div", { style: {
13449
+ width: '100%',
13450
+ height: containerHeight,
13451
+ display: 'flex',
13452
+ boxSizing: 'border-box',
13453
+ gap: 16,
13454
+ pointerEvents: 'none',
13455
+ userSelect: 'none'
13456
+ } }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
13457
+ return renderView(rec, index);
13458
+ })));
13459
+ };
13460
+ var index$1 = React.memo(DiyPortalPreview);
13461
+
13033
13462
  /*
13034
13463
  * @Author: binruan@chatlabs.com
13035
13464
  * @Date: 2023-10-31 10:56:01
@@ -13123,10 +13552,10 @@ Made in Italy` })));
13123
13552
  return searchParams;
13124
13553
  }, []);
13125
13554
  return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
13126
- 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 }) => {
13555
+ 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 }) => {
13127
13556
  var _a;
13128
13557
  return (React.createElement(React.Fragment, null,
13129
- 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 })),
13558
+ 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 })),
13130
13559
  React.createElement(Popup, null)));
13131
13560
  } })));
13132
13561
  };
@@ -13170,12 +13599,13 @@ Made in Italy` })));
13170
13599
  * @FilePath: \pb-sxp-ui\src\index.ts
13171
13600
  */
13172
13601
 
13602
+ exports.DiyPortalPreview = index$1;
13173
13603
  exports.EditorDataProvider = EditorDataProvider;
13174
13604
  exports.Modal = Modal$1;
13175
13605
  exports.SxpDataSourceProvider = SxpDataSourceProvider$1;
13176
13606
  exports.SxpPageCore = index;
13177
13607
  exports.SxpPageRender = SxpPageRender;
13178
- exports.core = index$1;
13608
+ exports.core = index$2;
13179
13609
  exports.default = Pagebuilder;
13180
13610
  exports.defaultSetting = defaultSetting;
13181
13611
  exports.materials = _materials_;
@@ -13184,3 +13614,4 @@ Made in Italy` })));
13184
13614
  Object.defineProperty(exports, '__esModule', { value: true });
13185
13615
 
13186
13616
  }));
13617
+ //# sourceMappingURL=pb-ui.js.map