pb-sxp-ui 1.15.7 → 1.15.9

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
@@ -477,11 +477,20 @@
477
477
  return window.localStorage.getItem(feRealSessionIdKey);
478
478
  };
479
479
 
480
+ /*
481
+ * @Author: binruan@chatlabs.com
482
+ * @Date: 2024-03-20 10:27:31
483
+ * @LastEditors: binruan@chatlabs.com
484
+ * @LastEditTime: 2025-02-25 16:43:21
485
+ * @FilePath: \pb-sxp-ui\src\core\utils\localStore.ts
486
+ *
487
+ */
480
488
  const FAKE_USER_KEY = 'SXP_FAKE_USER_ID';
481
- const FAKE_USER_STATE = 'FAKE_USER_STATE'; //新用户仅显示一次滑动提示
489
+ const FAKE_USER_STATE = 'FAKE_USER_STATE'; // 新用户仅显示一次滑动提示
482
490
  const AGREE_POLICY = 'AGREE_POLICY';
483
- const SLIDE_SKIP_STATE = 'SLIDE_SKIP_STATE'; //新用户滑动下一个视频跳转外链状态(触发过一次就不再触发)
484
- const CCONTSENT_STATE = 'CCONTSENT_STATE'; //新用户仅显示一次contsent弹窗
491
+ const SLIDE_SKIP_STATE = 'SLIDE_SKIP_STATE'; // 新用户滑动下一个视频跳转外链状态(触发过一次就不再触发)
492
+ const CCONTSENT_STATE = 'CCONTSENT_STATE'; // 新用户仅显示一次contsent弹窗
493
+ const USER_CONSENT_RESULT_KEY = 'USER_CONSENT_RESULT'; // 用户已授权consent弹窗
485
494
  const storeAndLoadFeUserId = () => {
486
495
  let fakeUserId = window.localStorage.getItem(FAKE_USER_KEY);
487
496
  if (lodash.isEmpty(fakeUserId)) {
@@ -511,6 +520,13 @@
511
520
  }
512
521
  return lodash.isEmpty(contsentState);
513
522
  };
523
+ const getUserConsentResult = () => {
524
+ const contsentState = window.localStorage.getItem(USER_CONSENT_RESULT_KEY);
525
+ return contsentState === 'true';
526
+ };
527
+ const setUserConsentResult = () => {
528
+ window.localStorage.setItem(USER_CONSENT_RESULT_KEY, 'true');
529
+ };
514
530
 
515
531
  /*
516
532
  * @Author: binruan@chatlabs.com
@@ -736,6 +752,24 @@
736
752
  .then((res) => res.json())
737
753
  .catch((err) => Promise.reject(err));
738
754
  }, [bffDataSource, fakeUserId]);
755
+ // bff API admin 请求方法
756
+ const bffFetchAdmin = React.useCallback((path, options) => {
757
+ if (!bffDataSource)
758
+ return;
759
+ const url = bffDataSource.url;
760
+ if (options === null || options === void 0 ? void 0 : options.query) {
761
+ const queryString = qs.stringify(options.query);
762
+ path = `${path}?${queryString}`;
763
+ }
764
+ return window
765
+ .fetch(`${url}/admin/${path}`, {
766
+ headers: Object.assign({ 'Content-Type': 'application/json' }, bffDataSource.headers),
767
+ method: options.method,
768
+ body: JSON.stringify(options.body)
769
+ })
770
+ .then((res) => res.json())
771
+ .catch((err) => Promise.reject(err));
772
+ }, [bffDataSource]);
739
773
  // 获取推荐视频数据
740
774
  const getRecommendVideos = React.useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
741
775
  var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
@@ -764,7 +798,7 @@
764
798
  const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
765
799
  var _v, _w, _x, _y, _z, _0;
766
800
  query.pageNum = pageNum;
767
- result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', { method: 'POST', body: query }));
801
+ result = yield (bffFetchAdmin === null || bffFetchAdmin === void 0 ? void 0 : bffFetchAdmin('recommend/direct_page', { method: 'POST', body: query }));
768
802
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
769
803
  return undefined;
770
804
  }
@@ -804,7 +838,7 @@
804
838
  return Object.assign(Object.assign({}, result.data), { recList: list });
805
839
  }
806
840
  return result === null || result === void 0 ? void 0 : result.data;
807
- }), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId]);
841
+ }), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin]);
808
842
  const loadVideos = React.useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
809
843
  var _1, _2, _3, _4;
810
844
  if (rtcList.length <= 0) {
@@ -16918,12 +16952,14 @@ Made in Italy` })));
16918
16952
  return consentPopupCate || (open && style && !consentResult);
16919
16953
  }, [consentPopupCate, open, style, consentResult]);
16920
16954
  React.useEffect(() => {
16921
- !consentPopupCate && open && style && handleGetAccount();
16955
+ !consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
16922
16956
  }, []);
16923
16957
  const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
16924
16958
  const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
16925
- if (res)
16959
+ if (res) {
16926
16960
  setConsentResult(true);
16961
+ setUserConsentResult();
16962
+ }
16927
16963
  });
16928
16964
  const handleClickReject = () => {
16929
16965
  history === null || history === void 0 ? void 0 : history.back();
@@ -16945,7 +16981,7 @@ Made in Italy` })));
16945
16981
  * @Author: binruan@chatlabs.com
16946
16982
  * @Date: 2025-01-14 16:22:35
16947
16983
  * @LastEditors: binruan@chatlabs.com
16948
- * @LastEditTime: 2025-01-15 17:09:49
16984
+ * @LastEditTime: 2025-02-26 11:44:00
16949
16985
  * @FilePath: \pb-sxp-ui\src\materials\sxp\consentPopup\Click\material.tsx
16950
16986
  *
16951
16987
  */
@@ -16960,7 +16996,7 @@ Made in Italy` })));
16960
16996
  },
16961
16997
  defaulSetting: {
16962
16998
  props: {
16963
- content: '<p><strong><span style="font-size:14px"><span style="line-height:3">Your Cookie Preferences</span></span></strong></p><p>We use cookie, including third-party cookies, to ensure the proper functioning and security of this site, to analyse its use, and to show you personalised content. You can authorise the use of all cookies by clicking on &quot;Accept all cookies&quot;. If you click on &quot;Reject all cookies&quot;, we will only use cookies necessary for the proper functioning and security of this site. To personalise on adjust your preferences at any time, click on &quot;Cookies Settings&quot; below or at the bottom of any Fendi.com webpage. For more information, read our Cookie Policy.</p><p></p>',
16999
+ content: '<p><strong><span style="font-size:14px"><span style="line-height:3">Your Cookie Preferences</span></span></strong></p><p><span style="font-size:13px"><span style="line-height:1.7">We use cookie, including third-party cookies, to ensure the proper functioning and security of this site, to analyse its use, and to show you personalised content. You can authorise the use of all cookies by clicking on &quot;Accept all cookies&quot;. If you click on &quot;Reject all cookies&quot;, we will only use cookies necessary for the proper functioning and security of this site. To personalise on adjust your preferences at any time, click on &quot;Cookies Settings&quot; below or at the bottom of any Fendi.com webpage. For more information, read our Cookie Policy.</span></span></p><p></p>',
16964
17000
  acceptButton: {
16965
17001
  text: 'Accept all cookies',
16966
17002
  style: {
@@ -17062,12 +17098,14 @@ Made in Italy` })));
17062
17098
  return consentPopupCate || (open && style && !consentResult);
17063
17099
  }, [consentPopupCate, open, style, consentResult]);
17064
17100
  React.useEffect(() => {
17065
- !consentPopupCate && open && style && handleGetAccount();
17101
+ !consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
17066
17102
  }, []);
17067
17103
  const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
17068
17104
  const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
17069
- if (res)
17105
+ if (res) {
17070
17106
  setConsentResult(true);
17107
+ setUserConsentResult();
17108
+ }
17071
17109
  });
17072
17110
  const handleTouchStart = (event) => {
17073
17111
  const touch = event.touches[0];
@@ -17104,7 +17142,7 @@ Made in Italy` })));
17104
17142
  * @Author: binruan@chatlabs.com
17105
17143
  * @Date: 2025-01-14 16:22:35
17106
17144
  * @LastEditors: binruan@chatlabs.com
17107
- * @LastEditTime: 2025-02-24 14:09:52
17145
+ * @LastEditTime: 2025-02-26 11:39:59
17108
17146
  * @FilePath: \pb-sxp-ui\src\materials\sxp\consentPopup\Swipe\material.tsx
17109
17147
  *
17110
17148
  */
@@ -17119,7 +17157,7 @@ Made in Italy` })));
17119
17157
  },
17120
17158
  defaulSetting: {
17121
17159
  props: {
17122
- content: '<p><span style="font- size: 14px"><strong><span style="line - height: 3">Your Cookie Preferences</span></strong></span></p><p><span style="line- height: 1"><span style="font- size: 12px">We use cookie, including third-party cookies, to</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">ensure the proper functioning and security of</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">this site, to analyse its use, and to show you</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">personalised content.</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">You can authorise the use of all cookies by</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">clicking on &#x27;Accept all cookies&#x27;. If you click on</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">&#x27;Reject all cookies&#x27;, we will only use cookies</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">necessary for the proper functioning and </span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">security of this site. To personalise or adjust</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">your preferences at any time, click on &#x27;Cookies</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">Settings&#x27; below or at the bottom of any</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">Fendi.com webpage.</span></span></p><p><span style="line - height: 1"><span style="font - size: 12px">For more information, <u>read our Cookie Policy</u>.</span></span></p>'
17160
+ content: '<p><strong><span style="font-size:18px"><span style="line-height:1.7">Your Cookie Preferences</span></span></strong></p><p><span style="line-height:1.7"><span style="font-size:13px">We use cookie, including third-party cookies, to ensure the proper functioning and security of this site, to analyse its use, and to show you personalised content. You can authorise the use of all cookies by clicking on &#x27;Accept all cookies&#x27;. If you click on &#x27;Reject all cookies&#x27;, we will only use cookies necessary for the proper functioning and security of this site. To personalise or adjust your preferences at any time, click on &#x27;Cookies Settings&#x27; below or at the bottom of any Fendi.com webpage. For more information, <u>read our Cookie Policy</u>.</span></span></p>'
17123
17161
  },
17124
17162
  style: {
17125
17163
  backgroundColor: '#fff',
@@ -18406,7 +18444,7 @@ Made in Italy` })));
18406
18444
  * @Author: binruan@chatlabs.com
18407
18445
  * @Date: 2024-03-20 10:27:31
18408
18446
  * @LastEditors: binruan@chatlabs.com
18409
- * @LastEditTime: 2025-02-25 15:51:17
18447
+ * @LastEditTime: 2025-02-25 16:50:19
18410
18448
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
18411
18449
  *
18412
18450
  */
@@ -18945,8 +18983,8 @@ Made in Italy` })));
18945
18983
  isReload,
18946
18984
  renderToggleButton
18947
18985
  ]);
18948
- return (React.createElement("div", { id: 'sxp-render' }, (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
18949
- React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { className: 'clc-sxp-container', style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
18986
+ return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' }, (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
18987
+ React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
18950
18988
  waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff', top: `${minusHeight}px` }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
18951
18989
  const isEq = lodash.isEqual(rtcList, cacheRtcList);
18952
18990
  if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {