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/index.cjs CHANGED
@@ -484,11 +484,20 @@ const getFeSessionId = () => {
484
484
  return window.localStorage.getItem(feRealSessionIdKey);
485
485
  };
486
486
 
487
+ /*
488
+ * @Author: binruan@chatlabs.com
489
+ * @Date: 2024-03-20 10:27:31
490
+ * @LastEditors: binruan@chatlabs.com
491
+ * @LastEditTime: 2025-02-25 16:43:21
492
+ * @FilePath: \pb-sxp-ui\src\core\utils\localStore.ts
493
+ *
494
+ */
487
495
  const FAKE_USER_KEY = 'SXP_FAKE_USER_ID';
488
- const FAKE_USER_STATE = 'FAKE_USER_STATE'; //新用户仅显示一次滑动提示
496
+ const FAKE_USER_STATE = 'FAKE_USER_STATE'; // 新用户仅显示一次滑动提示
489
497
  const AGREE_POLICY = 'AGREE_POLICY';
490
- const SLIDE_SKIP_STATE = 'SLIDE_SKIP_STATE'; //新用户滑动下一个视频跳转外链状态(触发过一次就不再触发)
491
- const CCONTSENT_STATE = 'CCONTSENT_STATE'; //新用户仅显示一次contsent弹窗
498
+ const SLIDE_SKIP_STATE = 'SLIDE_SKIP_STATE'; // 新用户滑动下一个视频跳转外链状态(触发过一次就不再触发)
499
+ const CCONTSENT_STATE = 'CCONTSENT_STATE'; // 新用户仅显示一次contsent弹窗
500
+ const USER_CONSENT_RESULT_KEY = 'USER_CONSENT_RESULT'; // 用户已授权consent弹窗
492
501
  const storeAndLoadFeUserId = () => {
493
502
  let fakeUserId = window.localStorage.getItem(FAKE_USER_KEY);
494
503
  if (lodash.isEmpty(fakeUserId)) {
@@ -518,6 +527,13 @@ const getContsentState = () => {
518
527
  }
519
528
  return lodash.isEmpty(contsentState);
520
529
  };
530
+ const getUserConsentResult = () => {
531
+ const contsentState = window.localStorage.getItem(USER_CONSENT_RESULT_KEY);
532
+ return contsentState === 'true';
533
+ };
534
+ const setUserConsentResult = () => {
535
+ window.localStorage.setItem(USER_CONSENT_RESULT_KEY, 'true');
536
+ };
521
537
 
522
538
  /*
523
539
  * @Author: binruan@chatlabs.com
@@ -743,6 +759,24 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
743
759
  .then((res) => res.json())
744
760
  .catch((err) => Promise.reject(err));
745
761
  }, [bffDataSource, fakeUserId]);
762
+ // bff API admin 请求方法
763
+ const bffFetchAdmin = React.useCallback((path, options) => {
764
+ if (!bffDataSource)
765
+ return;
766
+ const url = bffDataSource.url;
767
+ if (options === null || options === void 0 ? void 0 : options.query) {
768
+ const queryString = qs.stringify(options.query);
769
+ path = `${path}?${queryString}`;
770
+ }
771
+ return window
772
+ .fetch(`${url}/admin/${path}`, {
773
+ headers: Object.assign({ 'Content-Type': 'application/json' }, bffDataSource.headers),
774
+ method: options.method,
775
+ body: JSON.stringify(options.body)
776
+ })
777
+ .then((res) => res.json())
778
+ .catch((err) => Promise.reject(err));
779
+ }, [bffDataSource]);
746
780
  // 获取推荐视频数据
747
781
  const getRecommendVideos = React.useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
748
782
  var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
@@ -771,7 +805,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
771
805
  const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
772
806
  var _v, _w, _x, _y, _z, _0;
773
807
  query.pageNum = pageNum;
774
- result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', { method: 'POST', body: query }));
808
+ result = yield (bffFetchAdmin === null || bffFetchAdmin === void 0 ? void 0 : bffFetchAdmin('recommend/direct_page', { method: 'POST', body: query }));
775
809
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
776
810
  return undefined;
777
811
  }
@@ -811,7 +845,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
811
845
  return Object.assign(Object.assign({}, result.data), { recList: list });
812
846
  }
813
847
  return result === null || result === void 0 ? void 0 : result.data;
814
- }), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId]);
848
+ }), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin]);
815
849
  const loadVideos = React.useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
816
850
  var _1, _2, _3, _4;
817
851
  if (rtcList.length <= 0) {
@@ -16925,12 +16959,14 @@ const Click$1 = (_a) => {
16925
16959
  return consentPopupCate || (open && style && !consentResult);
16926
16960
  }, [consentPopupCate, open, style, consentResult]);
16927
16961
  React.useEffect(() => {
16928
- !consentPopupCate && open && style && handleGetAccount();
16962
+ !consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
16929
16963
  }, []);
16930
16964
  const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
16931
16965
  const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
16932
- if (res)
16966
+ if (res) {
16933
16967
  setConsentResult(true);
16968
+ setUserConsentResult();
16969
+ }
16934
16970
  });
16935
16971
  const handleClickReject = () => {
16936
16972
  history === null || history === void 0 ? void 0 : history.back();
@@ -16952,7 +16988,7 @@ var ClickComponent = React.memo(Click$1);
16952
16988
  * @Author: binruan@chatlabs.com
16953
16989
  * @Date: 2025-01-14 16:22:35
16954
16990
  * @LastEditors: binruan@chatlabs.com
16955
- * @LastEditTime: 2025-01-15 17:09:49
16991
+ * @LastEditTime: 2025-02-26 11:44:00
16956
16992
  * @FilePath: \pb-sxp-ui\src\materials\sxp\consentPopup\Click\material.tsx
16957
16993
  *
16958
16994
  */
@@ -16967,7 +17003,7 @@ const Click = createMaterial(ClickComponent, {
16967
17003
  },
16968
17004
  defaulSetting: {
16969
17005
  props: {
16970
- 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>',
17006
+ 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>',
16971
17007
  acceptButton: {
16972
17008
  text: 'Accept all cookies',
16973
17009
  style: {
@@ -17069,12 +17105,14 @@ const Swipe$1 = (_a) => {
17069
17105
  return consentPopupCate || (open && style && !consentResult);
17070
17106
  }, [consentPopupCate, open, style, consentResult]);
17071
17107
  React.useEffect(() => {
17072
- !consentPopupCate && open && style && handleGetAccount();
17108
+ !consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
17073
17109
  }, []);
17074
17110
  const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
17075
17111
  const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
17076
- if (res)
17112
+ if (res) {
17077
17113
  setConsentResult(true);
17114
+ setUserConsentResult();
17115
+ }
17078
17116
  });
17079
17117
  const handleTouchStart = (event) => {
17080
17118
  const touch = event.touches[0];
@@ -17111,7 +17149,7 @@ var SwipeComponent = React.memo(Swipe$1);
17111
17149
  * @Author: binruan@chatlabs.com
17112
17150
  * @Date: 2025-01-14 16:22:35
17113
17151
  * @LastEditors: binruan@chatlabs.com
17114
- * @LastEditTime: 2025-02-24 14:09:52
17152
+ * @LastEditTime: 2025-02-26 11:39:59
17115
17153
  * @FilePath: \pb-sxp-ui\src\materials\sxp\consentPopup\Swipe\material.tsx
17116
17154
  *
17117
17155
  */
@@ -17126,7 +17164,7 @@ const Swipe = createMaterial(SwipeComponent, {
17126
17164
  },
17127
17165
  defaulSetting: {
17128
17166
  props: {
17129
- 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>'
17167
+ 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>'
17130
17168
  },
17131
17169
  style: {
17132
17170
  backgroundColor: '#fff',
@@ -18413,7 +18451,7 @@ var NavBack$1 = React.memo(NavBack);
18413
18451
  * @Author: binruan@chatlabs.com
18414
18452
  * @Date: 2024-03-20 10:27:31
18415
18453
  * @LastEditors: binruan@chatlabs.com
18416
- * @LastEditTime: 2025-02-25 15:51:17
18454
+ * @LastEditTime: 2025-02-25 16:50:19
18417
18455
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
18418
18456
  *
18419
18457
  */
@@ -18952,8 +18990,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
18952
18990
  isReload,
18953
18991
  renderToggleButton
18954
18992
  ]);
18955
- 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' } },
18956
- 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` })) },
18993
+ 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' } },
18994
+ 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` })) },
18957
18995
  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: () => {
18958
18996
  const isEq = lodash.isEqual(rtcList, cacheRtcList);
18959
18997
  if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {