pb-sxp-ui 1.0.61 → 1.0.63

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.
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('eventemitter3'), require('@emotion/css'), require('@ant-design/pro-components'), require('react-dom'), require('hls.js')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'lodash', 'uuid', 'pako', 'react', 'qs', 'eventemitter3', '@emotion/css', '@ant-design/pro-components', 'react-dom', '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.EventEmitter, global.css, global.proComponents, global.ReactDOM, global.Hls));
5
+ })(this, (function (exports, lodash, uuid$1, pako, React, qs, EventEmitter, css, proComponents, ReactDOM, Hls) { 'use strict';
6
6
 
7
7
  function _interopNamespaceDefault(e) {
8
8
  var n = Object.create(null);
@@ -421,6 +421,14 @@
421
421
  }, [appDomain, path, domain]);
422
422
  }
423
423
 
424
+ const SXP_EVENT_BUS = new EventEmitter();
425
+ var SXP_EVENT_TYPE;
426
+ (function (SXP_EVENT_TYPE) {
427
+ SXP_EVENT_TYPE["PAGE_DID_SHOW"] = "pageDidShow";
428
+ SXP_EVENT_TYPE["PAGE_DID_HIDE"] = "pageDidHide";
429
+ SXP_EVENT_TYPE["CHANGE_THEME_TAG"] = "changeThemeTag";
430
+ })(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
431
+
424
432
  const SxpDataSourceContext = React.createContext({
425
433
  rtcList: [],
426
434
  tagList: []
@@ -445,6 +453,16 @@
445
453
  const [cacheActiveIndex, setCacheActiveIndex] = React.useState(0);
446
454
  const [isFromHashtag, setIsFromHashtag] = React.useState(false);
447
455
  const [videoRef, setVideoRef] = React.useState(null);
456
+ const themeTag = React.useRef();
457
+ React.useEffect(() => {
458
+ const handleChangeThemeTag = (tag) => {
459
+ themeTag.current = tag;
460
+ };
461
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.CHANGE_THEME_TAG, handleChangeThemeTag);
462
+ return () => {
463
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.CHANGE_THEME_TAG, handleChangeThemeTag);
464
+ };
465
+ }, []);
448
466
  React.useEffect(() => {
449
467
  setOpenHashtag(isOpenHashTag);
450
468
  }, [isOpenHashTag]);
@@ -487,7 +505,8 @@
487
505
  'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
488
506
  'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
489
507
  hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
490
- traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo
508
+ traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo,
509
+ themeTag: query === null || query === void 0 ? void 0 : query.themeTag
491
510
  };
492
511
  if (utmVal) {
493
512
  const val = (_e = (_d = (_c = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _c === void 0 ? void 0 : _c.filter((val) => {
@@ -512,7 +531,8 @@
512
531
  const data = yield getRecommendVideos({
513
532
  hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
514
533
  'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
515
- 'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
534
+ 'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
535
+ themeTag: themeTag.current
516
536
  });
517
537
  setRtcList(rtcList.concat((_f = data === null || data === void 0 ? void 0 : data.recList) !== null && _f !== void 0 ? _f : []));
518
538
  setCacheRtcList(cacheRtcList.concat((_g = data === null || data === void 0 ? void 0 : data.recList) !== null && _g !== void 0 ? _g : []));
@@ -571,12 +591,16 @@
571
591
  }), [bffFetch]);
572
592
  // 获取 Tag
573
593
  const bffGetTagList = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
574
- var _h, _j;
594
+ var _h, _j, _k, _l, _m;
575
595
  if (!utmVal)
576
596
  return;
577
597
  try {
578
- const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: utmVal } }));
579
- setTagList((_j = (_h = result === null || result === void 0 ? void 0 : result.data) === null || _h === void 0 ? void 0 : _h.tags) !== null && _j !== void 0 ? _j : []);
598
+ const val = (_k = (_j = (_h = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _h === void 0 ? void 0 : _h.filter((val) => {
599
+ const key = val.split('=')[0];
600
+ return UTM_KEYS.includes(key);
601
+ })) === null || _j === void 0 ? void 0 : _j.join('&')) !== null && _k !== void 0 ? _k : '';
602
+ const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
603
+ setTagList((_m = (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []);
580
604
  }
581
605
  catch (e) {
582
606
  console.log('e', e);
@@ -8443,10 +8467,10 @@
8443
8467
  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'),
8444
8468
  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),
8445
8469
  React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
8446
- 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
8447
- bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
8448
- collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
8449
- necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
8470
+ 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
8471
+ bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
8472
+ collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
8473
+ necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
8450
8474
  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 }))));
8451
8475
  };
8452
8476
  const renderBtn = () => {
@@ -8916,7 +8940,7 @@
8916
8940
  const productInfoText = ({ isPost }) => {
8917
8941
  return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
8918
8942
  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) ||
8919
- `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
8943
+ `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
8920
8944
  Made in Italy` })));
8921
8945
  };
8922
8946
  return (React.createElement("div", { className: 'pb-commondityDiroNew' },
@@ -9316,7 +9340,7 @@ Made in Italy` })));
9316
9340
  }
9317
9341
  }, [isOnScreen, ref, rec, ctaEvent, index]);
9318
9342
  const handleClick = lodash.throttle(() => {
9319
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
9343
+ var _a, _b, _c, _d, _e, _f, _g, _h;
9320
9344
  const item = (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
9321
9345
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
9322
9346
  eventSubject: 'clickCta',
@@ -9328,8 +9352,7 @@ Made in Italy` })));
9328
9352
  const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
9329
9353
  const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
9330
9354
  jumpToWeb(rec, product, cta, index);
9331
- window.location.href = (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link;
9332
- window.location.href = window.getJointUtmLink((_k = (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProduct) === null || _k === void 0 ? void 0 : _k.link);
9355
+ window.location.href = window.getJointUtmLink((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link);
9333
9356
  }
9334
9357
  }
9335
9358
  else {
@@ -12100,13 +12123,6 @@ Made in Italy` })));
12100
12123
  };
12101
12124
  var LikeButton$1 = React.memo(LikeButton);
12102
12125
 
12103
- const SXP_EVENT_BUS = new EventEmitter();
12104
- var SXP_EVENT_TYPE;
12105
- (function (SXP_EVENT_TYPE) {
12106
- SXP_EVENT_TYPE["PAGE_DID_SHOW"] = "pageDidShow";
12107
- SXP_EVENT_TYPE["PAGE_DID_HIDE"] = "pageDidHide";
12108
- })(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
12109
-
12110
12126
  const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef }) => {
12111
12127
  const [isPauseVideo, setIsPauseVideo] = React.useState(false);
12112
12128
  const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport } = useSxpDataSource();
@@ -12714,7 +12730,7 @@ Made in Italy` })));
12714
12730
  const DEFAULT_TAG = 'FOR U';
12715
12731
  const Tagbar = ({ tagList = [], setActiveIndex }) => {
12716
12732
  const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
12717
- const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = useSxpDataSource();
12733
+ const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef, waterFallData } = useSxpDataSource();
12718
12734
  const realTagList = React.useMemo(() => {
12719
12735
  return [DEFAULT_TAG, ...tagList];
12720
12736
  }, [tagList]);
@@ -12728,6 +12744,7 @@ Made in Italy` })));
12728
12744
  setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
12729
12745
  getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ themeTag }).then((res) => {
12730
12746
  var _a, _b, _c, _d;
12747
+ SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.CHANGE_THEME_TAG, themeTag);
12731
12748
  setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
12732
12749
  setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
12733
12750
  setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
@@ -12738,7 +12755,7 @@ Made in Italy` })));
12738
12755
  });
12739
12756
  setSelectTag(tag);
12740
12757
  };
12741
- if (tagList.length <= 0)
12758
+ if (waterFallData || tagList.length <= 0)
12742
12759
  return null;
12743
12760
  return (React.createElement("div", { className: 'clc-sxp-tagbar' },
12744
12761
  React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
@@ -12930,9 +12947,12 @@ Made in Italy` })));
12930
12947
  }
12931
12948
  if (tagList.length > 0) {
12932
12949
  minusHeight += 45;
12950
+ if (waterFallData) {
12951
+ minusHeight -= 45;
12952
+ }
12933
12953
  }
12934
12954
  return containerHeight - minusHeight;
12935
- }, [globalConfig, containerHeight, tagList]);
12955
+ }, [globalConfig, containerHeight, tagList, waterFallData]);
12936
12956
  const renderLogo = React.useMemo(() => {
12937
12957
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
12938
12958
  return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },