pb-sxp-ui 1.0.42 → 1.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +111 -111
  3. package/dist/index.cjs +237 -600
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.css +4 -54
  6. package/dist/index.js +237 -599
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.min.cjs +3 -4
  9. package/dist/index.min.cjs.map +1 -1
  10. package/dist/index.min.js +3 -4
  11. package/dist/index.min.js.map +1 -1
  12. package/dist/pb-ui.js +241 -603
  13. package/dist/pb-ui.js.map +1 -1
  14. package/dist/pb-ui.min.js +3 -4
  15. package/dist/pb-ui.min.js.map +1 -1
  16. package/es/core/components/SxpPageCore/index.js +2 -2
  17. package/es/core/components/SxpPageRender/Nudge/index.js +5 -6
  18. package/es/core/components/SxpPageRender/VideoWidget/index.d.ts +1 -0
  19. package/es/core/components/SxpPageRender/VideoWidget/index.js +119 -88
  20. package/es/core/components/SxpPageRender/WaterFall/index.js +1 -1
  21. package/es/core/components/SxpPageRender/index.d.ts +0 -2
  22. package/es/core/components/SxpPageRender/index.js +63 -25
  23. package/es/core/context/SxpDataSourceProvider.d.ts +2 -3
  24. package/es/core/context/SxpDataSourceProvider.js +7 -28
  25. package/es/core/hooks/useEventReport.js +4 -4
  26. package/es/index.d.ts +0 -1
  27. package/es/index.js +0 -1
  28. package/es/materials/sxp/popup/CommodityDetail/index.js +10 -10
  29. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +10 -10
  30. package/lib/core/components/SxpPageCore/index.js +2 -2
  31. package/lib/core/components/SxpPageRender/Nudge/index.js +5 -6
  32. package/lib/core/components/SxpPageRender/VideoWidget/index.d.ts +1 -0
  33. package/lib/core/components/SxpPageRender/VideoWidget/index.js +119 -88
  34. package/lib/core/components/SxpPageRender/WaterFall/index.js +1 -1
  35. package/lib/core/components/SxpPageRender/index.d.ts +0 -2
  36. package/lib/core/components/SxpPageRender/index.js +63 -25
  37. package/lib/core/context/SxpDataSourceProvider.d.ts +2 -3
  38. package/lib/core/context/SxpDataSourceProvider.js +7 -28
  39. package/lib/core/hooks/useEventReport.js +4 -4
  40. package/lib/index.d.ts +0 -1
  41. package/lib/index.js +1 -3
  42. package/lib/materials/sxp/popup/CommodityDetail/index.js +10 -10
  43. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +10 -10
  44. package/package.json +114 -115
  45. package/es/core/components/DiyPortalPreview/PictureGroup.d.ts +0 -13
  46. package/es/core/components/DiyPortalPreview/PictureGroup.js +0 -11
  47. package/es/core/components/DiyPortalPreview/VideoWidget.d.ts +0 -15
  48. package/es/core/components/DiyPortalPreview/VideoWidget.js +0 -236
  49. package/es/core/components/DiyPortalPreview/index.d.ts +0 -6
  50. package/es/core/components/DiyPortalPreview/index.js +0 -127
  51. package/es/core/components/SxpPageRender/Tagbar.d.ts +0 -7
  52. package/es/core/components/SxpPageRender/Tagbar.js +0 -37
  53. package/lib/core/components/DiyPortalPreview/PictureGroup.d.ts +0 -13
  54. package/lib/core/components/DiyPortalPreview/PictureGroup.js +0 -14
  55. package/lib/core/components/DiyPortalPreview/VideoWidget.d.ts +0 -15
  56. package/lib/core/components/DiyPortalPreview/VideoWidget.js +0 -239
  57. package/lib/core/components/DiyPortalPreview/index.d.ts +0 -6
  58. package/lib/core/components/DiyPortalPreview/index.js +0 -130
  59. package/lib/core/components/SxpPageRender/Tagbar.d.ts +0 -7
  60. package/lib/core/components/SxpPageRender/Tagbar.js +0 -40
package/dist/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'), 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';
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';
6
6
 
7
7
  function _interopNamespaceDefault(e) {
8
8
  var n = Object.create(null);
@@ -422,8 +422,7 @@
422
422
  }
423
423
 
424
424
  const SxpDataSourceContext = React.createContext({
425
- rtcList: [],
426
- tagList: []
425
+ rtcList: []
427
426
  });
428
427
  var DataSourceType;
429
428
  (function (DataSourceType) {
@@ -432,7 +431,6 @@
432
431
  const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
433
432
  const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false }) => {
434
433
  const [rtcList, setRtcList] = React.useState([]);
435
- const [tagList, setTagList] = React.useState([]);
436
434
  const [loading, setLoading] = React.useState(false);
437
435
  const [curReqInfo, setCurReqInfo] = React.useState({ rtc: '', requestId: '' });
438
436
  const swiperRef = React.useRef(null);
@@ -444,6 +442,7 @@
444
442
  const [cacheRtcList, setCacheRtcList] = React.useState([]);
445
443
  const [cacheActiveIndex, setCacheActiveIndex] = React.useState(0);
446
444
  const [isFromHashtag, setIsFromHashtag] = React.useState(false);
445
+ const [videoRef, setVideoRef] = React.useState(null);
447
446
  React.useEffect(() => {
448
447
  setOpenHashtag(isOpenHashTag);
449
448
  }, [isOpenHashTag]);
@@ -556,19 +555,6 @@
556
555
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
557
556
  return res === null || res === void 0 ? void 0 : res.success;
558
557
  }), [bffFetch]);
559
- // 获取 Tag
560
- const bffGetTagList = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
561
- var _g, _h;
562
- if (!utmVal)
563
- return;
564
- try {
565
- const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: utmVal } }));
566
- 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 : []);
567
- }
568
- catch (e) {
569
- console.log('e', e);
570
- }
571
- }), [bffFetch, utmVal]);
572
558
  const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
573
559
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
574
560
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
@@ -584,12 +570,11 @@
584
570
  fromKName = 'imagePage';
585
571
  }
586
572
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
587
- 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 })
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
574
  });
589
575
  }, [bffEventReport, isFromHashtag]);
590
576
  React.useEffect(() => {
591
577
  setLoading(true);
592
- bffGetTagList();
593
578
  getRecommendVideos()
594
579
  .then((data) => {
595
580
  var _a, _b;
@@ -605,7 +590,6 @@
605
590
  if (!isInit.current)
606
591
  return;
607
592
  setLoading(true);
608
- bffGetTagList();
609
593
  getRecommendVideos()
610
594
  .then((data) => {
611
595
  var _a, _b;
@@ -615,7 +599,7 @@
615
599
  .finally(() => {
616
600
  setLoading(false);
617
601
  });
618
- }, [getRecommendVideos, bffGetTagList]);
602
+ }, [getRecommendVideos]);
619
603
  const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
620
604
  return (React.createElement(SxpDataSourceContext.Provider, { value: {
621
605
  rtcList,
@@ -648,15 +632,9 @@
648
632
  hashTagSize,
649
633
  loadingImage: loadingImage !== null && loadingImage !== void 0 ? loadingImage : defaultLoadingImage,
650
634
  isOpenHashTag,
651
- tagList,
652
- setLoading
653
- } }, render({
654
- rtcList,
655
- mutateLike: bffMutateLike,
656
- mutateUnlike: bffMutateUnlike,
657
- submitForm: bffSubmitForm,
658
- tagList
659
- })));
635
+ videoRef,
636
+ setVideoRef
637
+ } }, render({ rtcList, mutateLike: bffMutateLike, mutateUnlike: bffMutateUnlike, submitForm: bffSubmitForm })));
660
638
  };
661
639
  var SxpDataSourceProvider$1 = React.memo(SxpDataSourceProvider);
662
640
 
@@ -881,7 +859,7 @@
881
859
  React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
882
860
  });
883
861
 
884
- var index$2 = /*#__PURE__*/Object.freeze({
862
+ var index$1 = /*#__PURE__*/Object.freeze({
885
863
  __proto__: null,
886
864
  EditorCore: EditorCore
887
865
  });
@@ -8167,8 +8145,8 @@
8167
8145
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
8168
8146
  contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
8169
8147
  position: position + '',
8170
- 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 : '',
8171
- ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
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 : '',
8172
8150
  traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
8173
8151
  }
8174
8152
  });
@@ -8192,8 +8170,8 @@
8192
8170
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
8193
8171
  contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
8194
8172
  position: position + '',
8195
- contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
8196
- ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
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,
8197
8175
  traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
8198
8176
  timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
8199
8177
  eventSubject: 'productView',
@@ -8356,7 +8334,7 @@
8356
8334
  var FormatImage$1 = React.memo(FormatImage);
8357
8335
 
8358
8336
  const CommodityDetail$1 = (_a) => {
8359
- var _b, _c, _d, _e, _f, _g, _h, _j, _k;
8337
+ var _b, _c, _d, _e, _f, _g, _h, _j;
8360
8338
  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"]);
8361
8339
  const { sxpParameter } = useSxpDataSource();
8362
8340
  const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
@@ -8397,7 +8375,7 @@
8397
8375
  return '$7,000';
8398
8376
  }
8399
8377
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
8400
- const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
8378
+ const width = isPreview ? 375 : window.innerWidth;
8401
8379
  const renderContent = ({ isPost }) => {
8402
8380
  var _a, _b, _c;
8403
8381
  return (React.createElement("div", null,
@@ -8405,10 +8383,10 @@
8405
8383
  React.createElement("div", { className: 'pb-commondity-content-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.title) }, (_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium'),
8406
8384
  React.createElement("div", { className: 'pb-commondity-content-price', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price) }, priceText),
8407
8385
  React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
8408
- React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
8409
- bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
8410
- collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
8411
- necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
8386
+ React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
8387
+ bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
8388
+ collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
8389
+ necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
8412
8390
  18-karat gold, this necklace is embellished with hand-set diamonds.`, maxStr: 79, className: 'pb-commondity-content-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info }))));
8413
8391
  };
8414
8392
  const renderBtn = () => {
@@ -8417,7 +8395,7 @@
8417
8395
  };
8418
8396
  return (React.createElement("div", { className: 'pb-commondity' },
8419
8397
  React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
8420
- 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: {
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: {
8421
8399
  clickable: true,
8422
8400
  bulletActiveClass: 'swipe-item-active-bullet',
8423
8401
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -8425,7 +8403,7 @@
8425
8403
  : 'commondityDetail-swiper-clickable-center'
8426
8404
  }, loop: true, autoplay: {
8427
8405
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
8428
- } }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
8406
+ } }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
8429
8407
  return (React.createElement(SwiperSlide, { key: src },
8430
8408
  React.createElement("div", { style: {
8431
8409
  overflow: 'hidden',
@@ -8434,7 +8412,7 @@
8434
8412
  } },
8435
8413
  React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
8436
8414
  }))),
8437
- !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css.css({
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({
8438
8416
  position: 'relative',
8439
8417
  height: 0,
8440
8418
  width: '100%',
@@ -8447,7 +8425,7 @@
8447
8425
  top: 0,
8448
8426
  objectFit: 'cover',
8449
8427
  width: '100%'
8450
- }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
8428
+ }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
8451
8429
  React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
8452
8430
  renderBtn(),
8453
8431
  React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
@@ -8807,7 +8785,7 @@
8807
8785
  ];
8808
8786
 
8809
8787
  const CommodityDetailDiroNew$1 = (_a) => {
8810
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
8788
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
8811
8789
  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"]);
8812
8790
  React.useState(true);
8813
8791
  const { sxpParameter } = useSxpDataSource();
@@ -8855,16 +8833,16 @@
8855
8833
  return '£102,300.00';
8856
8834
  }
8857
8835
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
8858
- const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
8836
+ const width = isPreview ? 375 : window.innerWidth;
8859
8837
  const productInfoText = ({ isPost }) => {
8860
8838
  return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
8861
8839
  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) ||
8862
- `Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
8840
+ `Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
8863
8841
  Made in Italy` })));
8864
8842
  };
8865
8843
  return (React.createElement("div", { className: 'pb-commondityDiroNew' },
8866
8844
  React.createElement("div", Object.assign({ ref: scrollRef, className: css.css(Object.assign({}, style)) }, props),
8867
- 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: {
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: {
8868
8846
  clickable: true,
8869
8847
  bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
8870
8848
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -8872,7 +8850,7 @@ Made in Italy` })));
8872
8850
  : 'commondityDiroNew-swiper-clickable-center'
8873
8851
  }, loop: true, autoplay: {
8874
8852
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
8875
- } }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
8853
+ } }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
8876
8854
  return (React.createElement(SwiperSlide, { key: src },
8877
8855
  React.createElement("div", { style: {
8878
8856
  overflow: 'hidden',
@@ -8881,7 +8859,7 @@ Made in Italy` })));
8881
8859
  } },
8882
8860
  React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
8883
8861
  }))),
8884
- !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css.css({
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({
8885
8863
  position: 'relative',
8886
8864
  height: 0,
8887
8865
  width: '100%',
@@ -8894,16 +8872,16 @@ Made in Italy` })));
8894
8872
  top: 0,
8895
8873
  objectFit: 'cover',
8896
8874
  width: '100%'
8897
- }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
8875
+ }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
8898
8876
  React.createElement("div", { className: 'pb-commondityDiroNew-content' },
8899
8877
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
8900
8878
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
8901
- 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'),
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'),
8902
8880
  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')),
8903
8881
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
8904
8882
  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),
8905
- 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 : '税费'))),
8906
- (!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')),
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')),
8907
8885
  productInfoText({ isPost }))),
8908
8886
  React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
8909
8887
  };
@@ -11811,7 +11789,7 @@ Made in Italy` })));
11811
11789
  }
11812
11790
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
11813
11791
  eventInfo: {
11814
- contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
11792
+ relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
11815
11793
  position: cacheActiveIndex + '',
11816
11794
  contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
11817
11795
  traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
@@ -11944,14 +11922,14 @@ Made in Italy` })));
11944
11922
  Prompt: Prompt
11945
11923
  });
11946
11924
 
11947
- const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
11948
- const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
11925
+ const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
11926
+ const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
11949
11927
  const LikeButton = (_a) => {
11950
11928
  var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
11951
11929
  const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
11952
11930
  const [state, setState] = React.useState(active);
11953
- const likeIcon = useIconLink(defaultLikeIconPath$1);
11954
- const unlikeIcon = useIconLink(defaultUnLikeIconPath$1);
11931
+ const likeIcon = useIconLink(defaultLikeIconPath);
11932
+ const unlikeIcon = useIconLink(defaultUnLikeIconPath);
11955
11933
  const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
11956
11934
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
11957
11935
  if (state) {
@@ -12007,9 +11985,8 @@ Made in Italy` })));
12007
11985
  SXP_EVENT_TYPE["PAGE_DID_HIDE"] = "pageDidHide";
12008
11986
  })(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
12009
11987
 
12010
- const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig }) => {
11988
+ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef }) => {
12011
11989
  const [isPauseVideo, setIsPauseVideo] = React.useState(false);
12012
- const videoRef = React.useRef(null);
12013
11990
  const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
12014
11991
  const videoStartTime = React.useRef(0);
12015
11992
  const [isLoadFinish, setIsLoadFinish] = React.useState(false);
@@ -12017,99 +11994,118 @@ Made in Italy` })));
12017
11994
  const { isActive } = useSwiperSlide();
12018
11995
  const canvasRef = React.useRef(null);
12019
11996
  const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
11997
+ const videoId = `pb-cache-video-${index}`;
11998
+ const videoEleRef = React.useRef(null);
12020
11999
  React.useEffect(() => {
12021
- if (!videoRef.current)
12000
+ if (!videoRef)
12022
12001
  return;
12023
- videoRef.current.muted = muted;
12024
- }, [muted]);
12025
- const handleVideoStart = React.useCallback(() => {
12026
- var _a;
12027
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
12028
- }, []);
12002
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.muted(muted);
12003
+ }, [muted, videoRef]);
12004
+ const handleEnded = React.useCallback(() => {
12005
+ if (!videoRef)
12006
+ return;
12007
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
12008
+ }, [videoRef]);
12029
12009
  const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
12030
12010
  const handlePlaying = React.useCallback(() => {
12031
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
12011
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
12012
+ if (!videoRef)
12013
+ return;
12032
12014
  setIsPauseVideo(false);
12033
12015
  const item = data[index];
12034
- if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
12035
- videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
12036
- const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
12037
- const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
12016
+ if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration())) {
12017
+ videoStartTime.current = (videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime()) || 0;
12018
+ const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration()) !== null && _a !== void 0 ? _a : 0).toFixed(2);
12019
+ const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime()) !== null && _b !== void 0 ? _b : 0).toFixed(2);
12038
12020
  const playType = isFirstPlay ? '0' : '1';
12039
12021
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
12040
12022
  eventInfo: {
12041
12023
  eventSubject: 'playVideo',
12042
12024
  eventDescription: 'User played the video',
12043
- contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
12044
- contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
12025
+ contentId: (_d = (_c = item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
12026
+ contentName: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : '',
12045
12027
  playType,
12046
12028
  startTime: videoCurrentTime,
12047
12029
  videoDuration,
12048
- contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
12030
+ contentTags: JSON.stringify((_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []),
12049
12031
  position: index + '',
12050
12032
  contentFormat: 'video',
12051
- traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
12033
+ traceInfo: (_j = item.video) === null || _j === void 0 ? void 0 : _j.traceInfo
12052
12034
  }
12053
12035
  });
12054
12036
  setIsFirstPlay(false);
12055
12037
  }
12056
- }, [bffEventReport, data, index, isFirstPlay]);
12057
- const handleLoadedMetadata = React.useCallback(() => {
12038
+ }, [bffEventReport, data, index, isFirstPlay, videoRef]);
12039
+ const handleLoadedmetadata = React.useCallback(() => {
12040
+ if (!videoRef)
12041
+ return;
12042
+ if (activeIndex !== index) {
12043
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
12044
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
12045
+ }
12046
+ setIsLoadFinish(true);
12047
+ }, [activeIndex, index, videoRef]);
12048
+ const handleCanplay = React.useCallback(() => {
12058
12049
  setIsLoadFinish(true);
12059
12050
  }, []);
12060
12051
  const handleClickVideo = React.useCallback((type) => () => {
12061
- var _a, _b, _c, _d, _e;
12052
+ if (!videoRef)
12053
+ return;
12062
12054
  if (!isLoadFinish)
12063
12055
  return;
12064
- const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
12056
+ const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused();
12065
12057
  switch (type) {
12066
12058
  case 'start':
12067
12059
  if (!isPause)
12068
12060
  return;
12069
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
12061
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
12070
12062
  setIsPauseVideo(false);
12071
12063
  break;
12072
12064
  case 'pause':
12073
12065
  if (isPause)
12074
12066
  return;
12075
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
12067
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
12076
12068
  setIsPauseVideo(true);
12077
12069
  break;
12078
12070
  default:
12079
12071
  if (isPause) {
12080
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
12072
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
12081
12073
  }
12082
12074
  else {
12083
- (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
12075
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
12084
12076
  }
12085
12077
  setIsPauseVideo(!isPause);
12086
12078
  break;
12087
12079
  }
12088
- }, [isLoadFinish]);
12089
- const onPause = React.useCallback(() => {
12090
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
12080
+ }, [isLoadFinish, videoRef]);
12081
+ const handlePause = React.useCallback(() => {
12082
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
12083
+ if (!videoRef)
12084
+ return;
12085
+ if (activeIndex !== index)
12086
+ return;
12091
12087
  const item = data[index];
12092
- const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
12093
- const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
12094
- if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
12095
- const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
12088
+ const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration()) !== null && _a !== void 0 ? _a : 0).toFixed(2);
12089
+ const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime()) !== null && _b !== void 0 ? _b : 0).toFixed(2);
12090
+ if (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration()) {
12091
+ const playDuration = ((videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime()) - videoStartTime.current).toFixed(2);
12096
12092
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
12097
12093
  eventInfo: {
12098
12094
  eventSubject: 'playOverVideo',
12099
12095
  eventDescription: 'User finished playing the video',
12100
- contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
12101
- contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
12096
+ contentId: (_d = (_c = item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
12097
+ contentName: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : '',
12102
12098
  endTime: videoCurrentTime,
12103
12099
  videoDuration,
12104
12100
  playDuration,
12105
- contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
12101
+ contentTags: JSON.stringify((_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []),
12106
12102
  position: index + '',
12107
12103
  contentFormat: 'video',
12108
- traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
12104
+ traceInfo: (_j = item.video) === null || _j === void 0 ? void 0 : _j.traceInfo
12109
12105
  }
12110
12106
  });
12111
12107
  }
12112
- }, [data, index, bffEventReport]);
12108
+ }, [data, index, bffEventReport, videoRef]);
12113
12109
  const blur = React.useMemo(() => {
12114
12110
  return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
12115
12111
  }, [videoPostConfig]);
@@ -12124,82 +12120,82 @@ Made in Italy` })));
12124
12120
  return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
12125
12121
  }, [firstFrameSrc, rec]);
12126
12122
  const handLoadeddata = React.useCallback(() => {
12127
- if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
12123
+ var _a;
12124
+ if (!videoRef)
12128
12125
  return;
12129
- const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
12130
- const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
12131
- const ctx = canvas.getContext('2d');
12132
- const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
12133
- const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
12134
- canvas.height = targetHeight;
12135
- canvas.width = targetWidth;
12136
- ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
12137
- setFirstFrameSrc(canvas.toDataURL());
12138
- }, []);
12126
+ const videoDomRef = document.getElementById(`${videoId}_html5_api`);
12127
+ if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
12128
+ return;
12129
+ const setFrameImg = () => {
12130
+ const video = videoDomRef;
12131
+ const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
12132
+ const ctx = canvas.getContext('2d');
12133
+ const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
12134
+ const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
12135
+ canvas.height = targetHeight;
12136
+ canvas.width = targetWidth;
12137
+ ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
12138
+ setFirstFrameSrc(canvas.toDataURL());
12139
+ };
12140
+ setFrameImg();
12141
+ setTimeout(() => {
12142
+ setFrameImg();
12143
+ }, 500);
12144
+ }, [videoRef]);
12139
12145
  React.useEffect(() => {
12140
- var _a, _b, _c, _d;
12141
- if (!videoRef.current)
12146
+ if (!isActive || !videoRef)
12147
+ return;
12148
+ const videoSrc = rec.video.url;
12149
+ if (!videoSrc)
12142
12150
  return;
12143
12151
  setIsPauseVideo(false);
12144
- if (!videoRef.current.src) {
12145
- const videoSrc = rec.video.url;
12146
- // if (videoSrc.includes('.m3u8')) {
12147
- // if (Hls.isSupported()) {
12148
- // const hls = new Hls();
12149
- // hls.loadSource(videoSrc);
12150
- // hls.attachMedia(videoRef.current);
12151
- // hls.on(Hls.Events.MANIFEST_PARSED, function () {
12152
- // videoRef?.current?.play();
12153
- // });
12154
- // } else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
12155
- // videoRef.current.src = videoSrc;
12156
- // } else {
12157
- // videoRef.current.src = videoSrc;
12158
- // }
12159
- // } else {
12160
- videoRef.current.src = videoSrc;
12161
- // }
12162
- videoRef.current.setAttribute('x5-playsinline', 'true');
12163
- videoRef.current.setAttribute('webkit-playsinline', 'true');
12164
- }
12165
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
12166
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
12167
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
12168
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
12152
+ const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
12153
+ const dom = document.querySelector('#player-container-id');
12154
+ const dom2 = document.querySelector('#player-container-id-copy');
12155
+ if (!dom && !dom2)
12156
+ return;
12157
+ videoPlayerWrapperNode === null || videoPlayerWrapperNode === void 0 ? void 0 : videoPlayerWrapperNode.appendChild(dom || dom2);
12158
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.src(videoSrc);
12159
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadedmetadata', handleLoadedmetadata);
12160
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadeddata', handLoadeddata);
12161
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('canplay', handleCanplay);
12162
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('playing', handlePlaying);
12163
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('pause', handlePause);
12164
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('ended', handleEnded);
12169
12165
  return () => {
12170
- var _a, _b, _c, _d;
12171
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
12172
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
12173
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
12174
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
12166
+ dom2 === null || dom2 === void 0 ? void 0 : dom2.appendChild(dom);
12167
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('loadedmetadata', handleLoadedmetadata);
12168
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('loadeddata', handLoadeddata);
12169
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('canplay', handleCanplay);
12170
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('playing', handlePlaying);
12171
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('pause', handlePause);
12172
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('ended', handleEnded);
12175
12173
  };
12176
- }, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
12174
+ }, [isActive, videoId, rec, videoRef]);
12177
12175
  React.useEffect(() => {
12178
- var _a;
12179
- if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
12176
+ if (!videoRef || !isLoadFinish)
12180
12177
  return;
12181
12178
  if (isActive) {
12182
- videoRef.current.play();
12179
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
12183
12180
  }
12184
12181
  else {
12185
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
12182
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
12186
12183
  }
12187
- }, [isActive, isLoadFinish]);
12184
+ }, [isActive, isLoadFinish, videoRef]);
12188
12185
  /*
12189
12186
  打开/关闭hashtag暂停/播放视频
12190
12187
  */
12191
12188
  React.useEffect(() => {
12192
- var _a, _b, _c;
12193
- if (!isActive || !(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
12189
+ if (!isActive || !videoRef)
12194
12190
  return;
12195
- const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
12191
+ const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused();
12196
12192
  if (!isPause && openHashtag) {
12197
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.pause();
12193
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
12198
12194
  }
12199
12195
  else if (!openHashtag) {
12200
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
12196
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
12201
12197
  }
12202
- }, [openHashtag, isActive]);
12198
+ }, [openHashtag, isActive, videoRef]);
12203
12199
  React.useEffect(() => {
12204
12200
  if (!isActive)
12205
12201
  return;
@@ -12219,9 +12215,11 @@ Made in Italy` })));
12219
12215
  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 }));
12220
12216
  }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
12221
12217
  React.useEffect(() => {
12218
+ if (!videoRef)
12219
+ return;
12222
12220
  const handleBeforeUnload = () => {
12223
- var _a, _b;
12224
- 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) {
12221
+ var _a;
12222
+ if (activeIndex === index && ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) && videoRef && !isPauseVideo) {
12225
12223
  handleClickVideo('pause')();
12226
12224
  }
12227
12225
  };
@@ -12259,23 +12257,19 @@ Made in Italy` })));
12259
12257
  right: 0
12260
12258
  } },
12261
12259
  React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
12262
- 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: {
12263
- width: '100%',
12264
- height: '100%',
12265
- objectFit: 'contain'
12266
- } }),
12260
+ React.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
12267
12261
  React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
12268
- renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
12262
+ renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, style: {
12269
12263
  position: 'relative',
12270
12264
  width: '100%',
12271
12265
  height,
12272
12266
  overflow: 'hidden'
12273
- } },
12274
- 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 }),
12267
+ }, onClick: handleClickVideo() },
12268
+ React.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
12275
12269
  renderPoster,
12276
12270
  React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
12277
12271
  };
12278
- var VideoWidget$3 = React.memo(VideoWidget$2);
12272
+ var VideoWidget$1 = React.memo(VideoWidget);
12279
12273
 
12280
12274
  /*
12281
12275
  * @Author: binruan@chatlabs.com
@@ -12375,7 +12369,7 @@ Made in Italy` })));
12375
12369
  * @LastEditTime: 2024-04-18 19:56:22
12376
12370
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
12377
12371
  */
12378
- const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
12372
+ const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
12379
12373
  var _a;
12380
12374
  const ref = React.useRef();
12381
12375
  const { isActive } = useSwiperSlide();
@@ -12404,7 +12398,7 @@ Made in Italy` })));
12404
12398
  React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
12405
12399
  })));
12406
12400
  };
12407
- var PictureGroup$3 = React.memo(PictureGroup$2);
12401
+ var PictureGroup$1 = React.memo(PictureGroup);
12408
12402
 
12409
12403
  /*
12410
12404
  * @Author: binruan@chatlabs.com
@@ -12568,63 +12562,26 @@ Made in Italy` })));
12568
12562
  *
12569
12563
  */
12570
12564
  const Nudge = ({ nudge }) => {
12571
- var _a, _b, _c, _d, _e, _f, _g;
12572
12565
  return (React.createElement(React.Fragment, null, (nudge === null || nudge === void 0 ? void 0 : nudge.isOpen) && (React.createElement("div", { className: 'clc-sxp-bottom-nudge', style: {
12573
- marginBottom: (_a = nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom) !== null && _a !== void 0 ? _a : 5,
12574
- 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,
12575
- 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,
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,
12576
12569
  backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
12577
- borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
12570
+ borderRadius: nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius
12578
12571
  } },
12579
12572
  (nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover' } }) : null,
12580
- 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 : '')))));
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)))));
12581
12574
  };
12582
12575
 
12583
- const DEFAULT_TAG = 'FOR U';
12584
- const Tagbar = ({ tagList = [], setActiveIndex }) => {
12585
- const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
12586
- const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = useSxpDataSource();
12587
- const realTagList = React.useMemo(() => {
12588
- return [DEFAULT_TAG, ...tagList];
12589
- }, [tagList]);
12590
- const handleSelectTag = (tag) => () => {
12591
- if (tag === selectTag)
12592
- return;
12593
- let hashTag;
12594
- if (tag !== DEFAULT_TAG) {
12595
- hashTag = tag;
12596
- }
12597
- setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
12598
- getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ hashTag }).then((res) => {
12599
- var _a, _b, _c, _d;
12600
- setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
12601
- setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
12602
- setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
12603
- setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(0);
12604
- (_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);
12605
- }).finally(() => {
12606
- setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
12607
- });
12608
- setSelectTag(tag);
12609
- };
12610
- if (tagList.length <= 0)
12611
- return null;
12612
- return (React.createElement("div", { className: 'clc-sxp-tagbar', style: { height: 45 } },
12613
- React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
12614
- return (React.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
12615
- }))));
12616
- };
12617
- var Tagbar$1 = React.memo(Tagbar);
12618
-
12619
12576
  /*
12620
12577
  * @Author: binruan@chatlabs.com
12621
12578
  * @Date: 2024-01-15 19:03:09
12622
12579
  * @LastEditors: binruan@chatlabs.com
12623
- * @LastEditTime: 2024-04-23 15:48:32
12580
+ * @LastEditTime: 2024-04-29 15:48:42
12624
12581
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
12625
12582
  *
12626
12583
  */
12627
- const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [] }) => {
12584
+ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle }) => {
12628
12585
  var _a, _b, _c, _d, _e, _f, _g;
12629
12586
  const { schema } = useEditor();
12630
12587
  const [activeIndex, setActiveIndex] = React.useState(0);
@@ -12636,6 +12593,8 @@ Made in Italy` })));
12636
12593
  const [isLoadMore, setIsLoadMore] = React.useState(false);
12637
12594
  const [isShowMore, setIsShowMore] = React.useState(false);
12638
12595
  const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData } = useSxpDataSource();
12596
+ const [videoRef, setVideoRef] = React.useState(null);
12597
+ const playerRef = React.useRef();
12639
12598
  const { productView } = useEventReport();
12640
12599
  const isShowFingerTip = React.useMemo(() => {
12641
12600
  return data.length > 0 && !loading && getFeUserId();
@@ -12673,6 +12632,25 @@ Made in Italy` })));
12673
12632
  viewTime.current = new Date();
12674
12633
  refreshFeSessionId();
12675
12634
  };
12635
+ const firstRef = React.useRef();
12636
+ React.useEffect(() => {
12637
+ if (!firstRef.current && !videoRef) {
12638
+ firstRef.current = true;
12639
+ const player = TCPlayer('player-container-id', {
12640
+ licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1325816236_1/v_cube.license', // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
12641
+ controls: false,
12642
+ autoplay: false,
12643
+ loop: false,
12644
+ muted: true,
12645
+ preload: 'auto',
12646
+ posterImage: false,
12647
+ bigPlayButton: true
12648
+ });
12649
+ player === null || player === void 0 ? void 0 : player.ready(() => {
12650
+ setVideoRef(player);
12651
+ });
12652
+ }
12653
+ }, [videoRef]);
12676
12654
  React.useEffect(() => {
12677
12655
  if (!isInit)
12678
12656
  handleH5EnterLink();
@@ -12702,8 +12680,8 @@ Made in Italy` })));
12702
12680
  // sessionDuration: Math.floor(((new Date() as any) - curTime) / 1000) + '',
12703
12681
  // eventSubject: 'sessionCompleted',
12704
12682
  // eventDescription: 'Session completed',
12705
- // contentId: item?.video?.itemId,
12706
- // productId: item?.product?.itemId,
12683
+ // relatedContentId: item?.video?.itemId,
12684
+ // relatedProductId: item?.product?.itemId,
12707
12685
  // position: item?.position
12708
12686
  // }
12709
12687
  // });
@@ -12747,12 +12725,12 @@ Made in Italy` })));
12747
12725
  sessionDuration: Math.floor((new Date() - curTime.current) / 1000) + '',
12748
12726
  eventSubject: 'sessionCompleted',
12749
12727
  eventDescription: 'Session completed',
12750
- contentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
12751
- productId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
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,
12752
12730
  position: activeIndex + '',
12753
12731
  fromKName,
12754
12732
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
12755
- 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 : ''
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 : ''
12756
12734
  }
12757
12735
  });
12758
12736
  }
@@ -12769,15 +12747,8 @@ Made in Italy` })));
12769
12747
  };
12770
12748
  }, [activeIndex, bffEventReport, curTime, data, handleH5EnterLink, popupDetailData, isFromHashtag, tempMap]);
12771
12749
  const height = React.useMemo(() => {
12772
- let minusHeight = 0;
12773
- if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
12774
- minusHeight += 45;
12775
- }
12776
- if (tagList.length > 0) {
12777
- minusHeight += 45;
12778
- }
12779
- return containerHeight - minusHeight;
12780
- }, [globalConfig, containerHeight, tagList]);
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]);
12781
12752
  const renderLogo = React.useMemo(() => {
12782
12753
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
12783
12754
  return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
@@ -12788,10 +12759,10 @@ Made in Italy` })));
12788
12759
  const renderContent = React.useCallback((rec, index) => {
12789
12760
  var _a, _b, _c, _d;
12790
12761
  if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
12791
- 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 }));
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 }));
12792
12763
  }
12793
12764
  if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
12794
- 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 }));
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 }));
12795
12766
  }
12796
12767
  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) {
12797
12768
  return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
@@ -12803,7 +12774,19 @@ Made in Italy` })));
12803
12774
  });
12804
12775
  }
12805
12776
  return null;
12806
- }, [containerWidth, data, height, isMuted, activeIndex, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost, viewTime, tipText, resolver, schema]);
12777
+ }, [
12778
+ containerWidth,
12779
+ data,
12780
+ height,
12781
+ isMuted,
12782
+ activeIndex,
12783
+ globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost,
12784
+ viewTime,
12785
+ tipText,
12786
+ resolver,
12787
+ schema,
12788
+ videoRef
12789
+ ]);
12807
12790
  const onExpandableChange = React.useCallback((v) => {
12808
12791
  setIsShowMore(v);
12809
12792
  }, []);
@@ -12825,8 +12808,8 @@ Made in Italy` })));
12825
12808
  ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
12826
12809
  React.createElement("div", { className: 'clc-sxp-bottom' },
12827
12810
  React.createElement(Nudge, { nudge: nudge }),
12828
- (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' },
12829
- React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver }))) : null,
12811
+ React.createElement("div", { className: 'clc-sxp-bottom-card' },
12812
+ React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
12830
12813
  React.createElement("div", null,
12831
12814
  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 }),
12832
12815
  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 })))));
@@ -12893,8 +12876,8 @@ Made in Italy` })));
12893
12876
  eventInfo: {
12894
12877
  eventSubject: 'scrollDown',
12895
12878
  eventDescription: 'User scroll down',
12896
- contentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
12897
- productId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
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 : '',
12898
12881
  requestId: null
12899
12882
  }
12900
12883
  });
@@ -12906,8 +12889,8 @@ Made in Italy` })));
12906
12889
  eventInfo: {
12907
12890
  eventSubject: 'scrollUp',
12908
12891
  eventDescription: 'User scroll up',
12909
- contentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
12910
- productId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
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 : '',
12911
12894
  requestId: null
12912
12895
  }
12913
12896
  });
@@ -12987,9 +12970,13 @@ Made in Italy` })));
12987
12970
  setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
12988
12971
  } })),
12989
12972
  renderLogo,
12990
- React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex }),
12991
12973
  isShowFingerTip ? React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
12992
- React.createElement(Swiper, { ref: swiperRef, onActiveIndexChange: (swiper) => {
12974
+ React.createElement(Swiper, { ref: swiperRef, onSlideChange: () => {
12975
+ swiperRef.current.swiper.allowTouchMove = false;
12976
+ setTimeout(() => {
12977
+ swiperRef.current.swiper.allowTouchMove = true;
12978
+ }, 500);
12979
+ }, onActiveIndexChange: (swiper) => {
12993
12980
  setActiveIndex(swiper.activeIndex);
12994
12981
  if (openHashtag)
12995
12982
  return;
@@ -13006,6 +12993,9 @@ Made in Italy` })));
13006
12993
  }
13007
12994
  }
13008
12995
  },
12996
+ // style={{
12997
+ // pointerEvents: canSwiper ? 'auto' : 'none'
12998
+ // }}
13009
12999
  // onReachEnd={() => {
13010
13000
  // // 由hashtaglist跳转过来时不执行下面的方法
13011
13001
  // if (waterFallData) return;
@@ -13028,367 +13018,17 @@ Made in Italy` })));
13028
13018
  zIndex: 999
13029
13019
  }, defaultValue: isMuted, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon, onChange: setIsMuted }),
13030
13020
  renderView),
13031
- React.createElement(WaterFall$1, Object.assign({}, (_g = (_f = (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.item) === null || _g === void 0 ? void 0 : _g.props))));
13032
- };
13033
-
13034
- const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
13035
- 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) => {
13036
- return (React.createElement(SwiperSlide, { key: url },
13037
- React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
13038
- })));
13039
- };
13040
- var PictureGroup$1 = React.memo(PictureGroup);
13041
-
13042
- const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width }) => {
13043
- const [isPauseVideo, setIsPauseVideo] = React.useState(false);
13044
- const videoRef = React.useRef(null);
13045
- const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
13046
- const videoStartTime = React.useRef(0);
13047
- const [isLoadFinish, setIsLoadFinish] = React.useState(false);
13048
- const [isFirstPlay, setIsFirstPlay] = React.useState(true);
13049
- const canvasRef = React.useRef(null);
13050
- const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
13051
- React.useEffect(() => {
13052
- if (!videoRef.current)
13053
- return;
13054
- videoRef.current.muted = muted;
13055
- }, [muted]);
13056
- const handleVideoStart = React.useCallback(() => {
13057
- var _a;
13058
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
13059
- }, []);
13060
- const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
13061
- const handlePlaying = React.useCallback(() => {
13062
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
13063
- setIsPauseVideo(false);
13064
- const item = data[index];
13065
- if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
13066
- videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
13067
- const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
13068
- const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
13069
- const playType = isFirstPlay ? '0' : '1';
13070
- bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
13071
- eventInfo: {
13072
- eventSubject: 'playVideo',
13073
- eventDescription: 'User played the video',
13074
- contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
13075
- contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
13076
- playType,
13077
- startTime: videoCurrentTime,
13078
- videoDuration,
13079
- contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
13080
- position: index + '',
13081
- contentFormat: 'video',
13082
- traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
13083
- }
13084
- });
13085
- setIsFirstPlay(false);
13086
- }
13087
- }, [bffEventReport, data, index, isFirstPlay]);
13088
- const handleLoadedMetadata = React.useCallback(() => {
13089
- setIsLoadFinish(true);
13090
- }, []);
13091
- const handleClickVideo = React.useCallback((type) => () => {
13092
- var _a, _b, _c, _d, _e;
13093
- if (!isLoadFinish)
13094
- return;
13095
- const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
13096
- switch (type) {
13097
- case 'start':
13098
- if (!isPause)
13099
- return;
13100
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
13101
- setIsPauseVideo(false);
13102
- break;
13103
- case 'pause':
13104
- if (isPause)
13105
- return;
13106
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
13107
- setIsPauseVideo(true);
13108
- break;
13109
- default:
13110
- if (isPause) {
13111
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
13112
- }
13113
- else {
13114
- (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
13115
- }
13116
- setIsPauseVideo(!isPause);
13117
- break;
13118
- }
13119
- }, [isLoadFinish]);
13120
- const onPause = React.useCallback(() => {
13121
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
13122
- const item = data[index];
13123
- const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
13124
- const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
13125
- if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
13126
- const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
13127
- bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
13128
- eventInfo: {
13129
- eventSubject: 'playOverVideo',
13130
- eventDescription: 'User finished playing the video',
13131
- contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
13132
- contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
13133
- endTime: videoCurrentTime,
13134
- videoDuration,
13135
- playDuration,
13136
- contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
13137
- position: index + '',
13138
- contentFormat: 'video',
13139
- traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
13140
- }
13141
- });
13142
- }
13143
- }, [data, index, bffEventReport]);
13144
- const blur = React.useMemo(() => {
13145
- return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
13146
- }, [videoPostConfig]);
13147
- const translateY = React.useMemo(() => {
13148
- var _a;
13149
- return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
13150
- ? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
13151
- : 'translateY(-50%)';
13152
- }, [videoPostConfig]);
13153
- const blurBgSrc = React.useMemo(() => {
13154
- var _a;
13155
- return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
13156
- }, [firstFrameSrc, rec]);
13157
- const handLoadeddata = React.useCallback(() => {
13158
- if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
13159
- return;
13160
- const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
13161
- const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
13162
- const ctx = canvas.getContext('2d');
13163
- const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
13164
- const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
13165
- canvas.height = targetHeight;
13166
- canvas.width = targetWidth;
13167
- ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
13168
- setFirstFrameSrc(canvas.toDataURL());
13169
- }, []);
13170
- React.useEffect(() => {
13171
- var _a, _b, _c, _d;
13172
- if (!videoRef.current)
13173
- return;
13174
- setIsPauseVideo(false);
13175
- if (!videoRef.current.src) {
13176
- const videoSrc = rec.video.url;
13177
- if (videoSrc.includes('.m3u8')) {
13178
- if (Hls.isSupported()) {
13179
- const hls = new Hls();
13180
- hls.loadSource(videoSrc);
13181
- hls.attachMedia(videoRef.current);
13182
- }
13183
- else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
13184
- videoRef.current.src = videoSrc;
13185
- }
13186
- else {
13187
- videoRef.current.src = videoSrc;
13188
- }
13189
- }
13190
- else {
13191
- videoRef.current.src = videoSrc;
13192
- }
13193
- videoRef.current.setAttribute('x5-playsinline', 'true');
13194
- videoRef.current.setAttribute('webkit-playsinline', 'true');
13195
- }
13196
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
13197
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
13198
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
13199
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
13200
- return () => {
13201
- var _a, _b, _c, _d;
13202
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
13203
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
13204
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
13205
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
13206
- };
13207
- }, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
13208
- const renderPoster = React.useMemo(() => {
13209
- if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
13210
- return null;
13211
- }
13212
- 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 }));
13213
- }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
13214
- React.useEffect(() => {
13215
- const handleBeforeUnload = () => {
13216
- var _a, _b;
13217
- 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) {
13218
- handleClickVideo('pause')();
13219
- }
13220
- };
13221
- window.addEventListener('beforeunload', handleBeforeUnload);
13222
- return () => {
13223
- window.removeEventListener('beforeunload', handleBeforeUnload);
13224
- };
13225
- }, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
13226
- const blurStyle = React.useMemo(() => {
13227
- return blur
13228
- ? {
13229
- filter: 'blur(10px)',
13230
- transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
13231
- }
13232
- : {};
13233
- }, [blur]);
13234
- if (!rec.video) {
13235
- return null;
13236
- }
13237
- return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
13238
- position: 'relative',
13239
- width,
13240
- height,
13241
- overflow: 'hidden'
13242
- } },
13243
- React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height,
13244
- width, objectFit: 'cover' }, blurStyle) }),
13245
- React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
13246
- React.createElement("div", { style: {
13247
- position: 'absolute',
13248
- width,
13249
- height,
13250
- top: '50%',
13251
- transform: translateY,
13252
- left: 0,
13253
- right: 0
13254
- } },
13255
- React.createElement("div", { style: { position: 'relative', width, height: '100%' } },
13256
- 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: {
13257
- width: '100%',
13258
- height,
13259
- objectFit: 'contain'
13260
- } }),
13261
- React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
13262
- renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
13263
- position: 'relative',
13264
- width,
13265
- height,
13266
- overflow: 'hidden'
13267
- } },
13268
- 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 }),
13269
- renderPoster,
13270
- React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
13271
- };
13272
- var VideoWidget$1 = React.memo(VideoWidget);
13273
-
13274
- const RESOLVER$1 = {};
13275
- Object.values(_materials_).forEach((v) => {
13276
- RESOLVER$1[v.extend.type] = v;
13277
- });
13278
- const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
13279
- const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
13280
- const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [] }) => {
13281
- const height = React.useMemo(() => {
13282
- let minusHeight = 0;
13283
- if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
13284
- minusHeight += 45;
13285
- }
13286
- if (tagList.length > 0) {
13287
- minusHeight += 45;
13288
- }
13289
- return containerHeight - minusHeight;
13290
- }, [globalConfig, containerHeight, tagList]);
13291
- const renderContent = (rec, index) => {
13292
- var _a, _b, _c, _d;
13293
- if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
13294
- 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 }));
13295
- }
13296
- if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
13297
- 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 }));
13298
- }
13299
- if (rec.product) {
13300
- 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) {
13301
- return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
13302
- var _a, _b, _c, _d, _e, _f, _g, _h;
13303
- const t = RESOLVER$1[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
13304
- const Component = withBindDataSource(t);
13305
- const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
13306
- 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) || {},
13307
- // schema={schema}
13308
- id: value === null || value === void 0 ? void 0 : value.id,
13309
- // viewTime={viewTime.current}
13310
- 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 })));
13311
- });
13312
- }
13313
- }
13314
- };
13315
- const renderLogo = React.useMemo(() => {
13316
- if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
13317
- return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
13318
- React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
13319
- }
13320
- return null;
13321
- }, [globalConfig]);
13322
- const CTA = (rec, index) => {
13323
- if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
13324
- return (React.createElement("div", { className: 'clc-sxp-bottom-card' },
13325
- React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1 })));
13326
- }
13327
- return null;
13328
- };
13329
- const renderBottom = (rec, index) => {
13330
- var _a, _b, _c, _d, _e, _f, _g;
13331
- if (rec.video) {
13332
- return (React.createElement(React.Fragment, null,
13333
- ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
13334
- React.createElement("div", { className: 'clc-sxp-bottom' },
13335
- React.createElement(Nudge, { nudge: nudge }),
13336
- CTA(rec, index),
13337
- React.createElement("div", null,
13338
- 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' }) })),
13339
- 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 }))));
13340
- }
13341
- return null;
13342
- };
13343
- const likeIcon = useIconLink(defaultLikeIconPath, appDomain);
13344
- const unlikeIcon = useIconLink(defaultUnLikeIconPath, appDomain);
13345
- const renderLikeButton = (rec, index) => {
13346
- var _a, _b, _c, _d;
13347
- if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
13348
- return;
13349
- let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
13350
- if (top < 40) {
13351
- top += 40;
13352
- }
13353
- if (rec.video) {
13354
- 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: {
13355
- top,
13356
- right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0
13357
- } }));
13358
- }
13359
- return null;
13360
- };
13361
- const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png', appDomain);
13362
- const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png', appDomain);
13363
- const renderView = (rec, index) => {
13364
- var _a, _b, _c, _d;
13365
- return (React.createElement("div", { style: { position: 'relative', border: '1px solid #e1e1e1' } },
13366
- renderLogo,
13367
- React.createElement(Tagbar$1, { tagList: tagList }),
13368
- React.createElement(ToggleButton$1, { style: {
13369
- position: 'absolute',
13370
- right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
13371
- 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',
13372
- bottom: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _d !== void 0 ? _d : 23,
13373
- zIndex: 999
13374
- }, 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 }),
13375
- renderContent(rec, index),
13376
- renderBottom(rec, index),
13377
- renderLikeButton(rec, index)));
13378
- };
13379
- return (React.createElement("div", { style: {
13380
- width: '100%',
13381
- height: containerHeight,
13382
- display: 'flex',
13383
- boxSizing: 'border-box',
13384
- gap: 16,
13385
- pointerEvents: 'none',
13386
- userSelect: 'none'
13387
- } }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
13388
- return renderView(rec, index);
13389
- })));
13021
+ React.createElement(WaterFall$1, Object.assign({}, (_g = (_f = (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.item) === null || _g === void 0 ? void 0 : _g.props)),
13022
+ React.createElement("div", { style: { position: 'absolute', zIndex: -100 } },
13023
+ React.createElement("video", { ref: playerRef, id: 'player-container-id', playsInline: true, crossOrigin: 'anonymous', style: {
13024
+ backgroundColor: 'transparent',
13025
+ width: '100%',
13026
+ height: '100%',
13027
+ objectFit: 'cover',
13028
+ pointerEvents: 'none'
13029
+ } }),
13030
+ React.createElement("div", { id: 'player-container-id-copy' }))));
13390
13031
  };
13391
- var index$1 = React.memo(DiyPortalPreview);
13392
13032
 
13393
13033
  /*
13394
13034
  * @Author: binruan@chatlabs.com
@@ -13483,10 +13123,10 @@ Made in Italy` })));
13483
13123
  return searchParams;
13484
13124
  }, []);
13485
13125
  return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
13486
- 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 }) => {
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 }) => {
13487
13127
  var _a;
13488
13128
  return (React.createElement(React.Fragment, null,
13489
- 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 })),
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 })),
13490
13130
  React.createElement(Popup, null)));
13491
13131
  } })));
13492
13132
  };
@@ -13530,13 +13170,12 @@ Made in Italy` })));
13530
13170
  * @FilePath: \pb-sxp-ui\src\index.ts
13531
13171
  */
13532
13172
 
13533
- exports.DiyPortalPreview = index$1;
13534
13173
  exports.EditorDataProvider = EditorDataProvider;
13535
13174
  exports.Modal = Modal$1;
13536
13175
  exports.SxpDataSourceProvider = SxpDataSourceProvider$1;
13537
13176
  exports.SxpPageCore = index;
13538
13177
  exports.SxpPageRender = SxpPageRender;
13539
- exports.core = index$2;
13178
+ exports.core = index$1;
13540
13179
  exports.default = Pagebuilder;
13541
13180
  exports.defaultSetting = defaultSetting;
13542
13181
  exports.materials = _materials_;
@@ -13545,4 +13184,3 @@ Made in Italy` })));
13545
13184
  Object.defineProperty(exports, '__esModule', { value: true });
13546
13185
 
13547
13186
  }));
13548
- //# sourceMappingURL=pb-ui.js.map