pb-sxp-ui 1.15.7 → 1.15.8

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
@@ -16925,12 +16941,14 @@ const Click$1 = (_a) => {
16925
16941
  return consentPopupCate || (open && style && !consentResult);
16926
16942
  }, [consentPopupCate, open, style, consentResult]);
16927
16943
  React.useEffect(() => {
16928
- !consentPopupCate && open && style && handleGetAccount();
16944
+ !consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
16929
16945
  }, []);
16930
16946
  const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
16931
16947
  const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
16932
- if (res)
16948
+ if (res) {
16933
16949
  setConsentResult(true);
16950
+ setUserConsentResult();
16951
+ }
16934
16952
  });
16935
16953
  const handleClickReject = () => {
16936
16954
  history === null || history === void 0 ? void 0 : history.back();
@@ -17069,12 +17087,14 @@ const Swipe$1 = (_a) => {
17069
17087
  return consentPopupCate || (open && style && !consentResult);
17070
17088
  }, [consentPopupCate, open, style, consentResult]);
17071
17089
  React.useEffect(() => {
17072
- !consentPopupCate && open && style && handleGetAccount();
17090
+ !consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
17073
17091
  }, []);
17074
17092
  const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
17075
17093
  const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
17076
- if (res)
17094
+ if (res) {
17077
17095
  setConsentResult(true);
17096
+ setUserConsentResult();
17097
+ }
17078
17098
  });
17079
17099
  const handleTouchStart = (event) => {
17080
17100
  const touch = event.touches[0];
@@ -18413,7 +18433,7 @@ var NavBack$1 = React.memo(NavBack);
18413
18433
  * @Author: binruan@chatlabs.com
18414
18434
  * @Date: 2024-03-20 10:27:31
18415
18435
  * @LastEditors: binruan@chatlabs.com
18416
- * @LastEditTime: 2025-02-25 15:51:17
18436
+ * @LastEditTime: 2025-02-25 16:50:19
18417
18437
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
18418
18438
  *
18419
18439
  */
@@ -18952,8 +18972,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
18952
18972
  isReload,
18953
18973
  renderToggleButton
18954
18974
  ]);
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` })) },
18975
+ 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' } },
18976
+ 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
18977
  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
18978
  const isEq = lodash.isEqual(rtcList, cacheRtcList);
18959
18979
  if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {