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.
@@ -554,8 +554,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
554
554
  isReload,
555
555
  renderToggleButton
556
556
  ]);
557
- 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' } },
558
- 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` })) },
557
+ 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' } },
558
+ 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` })) },
559
559
  waterFallData && (React.createElement(Navbar, { icon: left, 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: () => {
560
560
  const isEq = isEqual(rtcList, cacheRtcList);
561
561
  if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
@@ -3,9 +3,12 @@ export declare const FAKE_USER_STATE = "FAKE_USER_STATE";
3
3
  export declare const AGREE_POLICY = "AGREE_POLICY";
4
4
  export declare const SLIDE_SKIP_STATE = "SLIDE_SKIP_STATE";
5
5
  export declare const CCONTSENT_STATE = "CCONTSENT_STATE";
6
+ export declare const USER_CONSENT_RESULT_KEY = "USER_CONSENT_RESULT";
6
7
  export declare const storeAndLoadFeUserId: () => string;
7
8
  export declare const removeFeUserId: () => void;
8
9
  export declare const getFeUserState: () => boolean;
9
10
  export declare const getSlideSkipState: () => boolean;
10
11
  export declare const setSlideSkipState: () => void;
11
12
  export declare const getContsentState: () => boolean;
13
+ export declare const getUserConsentResult: () => boolean;
14
+ export declare const setUserConsentResult: () => void;
@@ -5,6 +5,7 @@ export const FAKE_USER_STATE = 'FAKE_USER_STATE';
5
5
  export const AGREE_POLICY = 'AGREE_POLICY';
6
6
  export const SLIDE_SKIP_STATE = 'SLIDE_SKIP_STATE';
7
7
  export const CCONTSENT_STATE = 'CCONTSENT_STATE';
8
+ export const USER_CONSENT_RESULT_KEY = 'USER_CONSENT_RESULT';
8
9
  export const storeAndLoadFeUserId = () => {
9
10
  let fakeUserId = window.localStorage.getItem(FAKE_USER_KEY);
10
11
  if (isEmpty(fakeUserId)) {
@@ -37,3 +38,10 @@ export const getContsentState = () => {
37
38
  }
38
39
  return isEmpty(contsentState);
39
40
  };
41
+ export const getUserConsentResult = () => {
42
+ const contsentState = window.localStorage.getItem(USER_CONSENT_RESULT_KEY);
43
+ return contsentState === 'true';
44
+ };
45
+ export const setUserConsentResult = () => {
46
+ window.localStorage.setItem(USER_CONSENT_RESULT_KEY, 'true');
47
+ };
@@ -5,6 +5,7 @@ import ConsentDetail from '../../popup/ConsentDetail';
5
5
  import tel from './tel.png';
6
6
  import { setFontForText } from '../../../../core/utils/tool';
7
7
  import { useSxpDataSource } from '../../../../core/hooks';
8
+ import { getUserConsentResult, setUserConsentResult } from '../../../../core/utils/localStore';
8
9
  const Click = (_a) => {
9
10
  var { isTel, open, content, style, consentPopupCate, acceptButton, rejectButton, showRejectButton } = _a, props = __rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "acceptButton", "rejectButton", "showRejectButton"]);
10
11
  const { getAccount, accountSonsent } = useSxpDataSource();
@@ -17,12 +18,14 @@ const Click = (_a) => {
17
18
  return consentPopupCate || (open && style && !consentResult);
18
19
  }, [consentPopupCate, open, style, consentResult]);
19
20
  useEffect(() => {
20
- !consentPopupCate && open && style && handleGetAccount();
21
+ !consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
21
22
  }, []);
22
23
  const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
23
24
  const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
24
- if (res)
25
+ if (res) {
25
26
  setConsentResult(true);
27
+ setUserConsentResult();
28
+ }
26
29
  });
27
30
  const handleClickReject = () => {
28
31
  history === null || history === void 0 ? void 0 : history.back();
@@ -4,6 +4,7 @@ import './index.less';
4
4
  import ConsentDetail from '../../popup/ConsentDetail';
5
5
  import tel from './tel.png';
6
6
  import { useSxpDataSource } from '../../../../core/hooks';
7
+ import { getUserConsentResult, setUserConsentResult } from '../../../../core/utils/localStore';
7
8
  const Swipe = (_a) => {
8
9
  var { isTel, open, content, style, consentPopupCate, swipeIcon } = _a, props = __rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "swipeIcon"]);
9
10
  const touchInfo = useRef();
@@ -18,12 +19,14 @@ const Swipe = (_a) => {
18
19
  return consentPopupCate || (open && style && !consentResult);
19
20
  }, [consentPopupCate, open, style, consentResult]);
20
21
  useEffect(() => {
21
- !consentPopupCate && open && style && handleGetAccount();
22
+ !consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
22
23
  }, []);
23
24
  const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
24
25
  const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
25
- if (res)
26
+ if (res) {
26
27
  setConsentResult(true);
28
+ setUserConsentResult();
29
+ }
27
30
  });
28
31
  const handleTouchStart = (event) => {
29
32
  const touch = event.touches[0];
@@ -557,8 +557,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
557
557
  isReload,
558
558
  renderToggleButton
559
559
  ]);
560
- return (react_1.default.createElement("div", { id: 'sxp-render' }, (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (react_1.default.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
561
- react_1.default.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (react_1.default.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` })) },
560
+ return (react_1.default.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' }, (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (react_1.default.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
561
+ react_1.default.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (react_1.default.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` })) },
562
562
  waterFallData && (react_1.default.createElement(Navbar_1.default, { icon: left_png_1.default, 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: () => {
563
563
  const isEq = (0, lodash_1.isEqual)(rtcList, cacheRtcList);
564
564
  if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
@@ -3,9 +3,12 @@ export declare const FAKE_USER_STATE = "FAKE_USER_STATE";
3
3
  export declare const AGREE_POLICY = "AGREE_POLICY";
4
4
  export declare const SLIDE_SKIP_STATE = "SLIDE_SKIP_STATE";
5
5
  export declare const CCONTSENT_STATE = "CCONTSENT_STATE";
6
+ export declare const USER_CONSENT_RESULT_KEY = "USER_CONSENT_RESULT";
6
7
  export declare const storeAndLoadFeUserId: () => string;
7
8
  export declare const removeFeUserId: () => void;
8
9
  export declare const getFeUserState: () => boolean;
9
10
  export declare const getSlideSkipState: () => boolean;
10
11
  export declare const setSlideSkipState: () => void;
11
12
  export declare const getContsentState: () => boolean;
13
+ export declare const getUserConsentResult: () => boolean;
14
+ export declare const setUserConsentResult: () => void;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getContsentState = exports.setSlideSkipState = exports.getSlideSkipState = exports.getFeUserState = exports.removeFeUserId = exports.storeAndLoadFeUserId = exports.CCONTSENT_STATE = exports.SLIDE_SKIP_STATE = exports.AGREE_POLICY = exports.FAKE_USER_STATE = exports.FAKE_USER_KEY = void 0;
3
+ exports.setUserConsentResult = exports.getUserConsentResult = exports.getContsentState = exports.setSlideSkipState = exports.getSlideSkipState = exports.getFeUserState = exports.removeFeUserId = exports.storeAndLoadFeUserId = exports.USER_CONSENT_RESULT_KEY = exports.CCONTSENT_STATE = exports.SLIDE_SKIP_STATE = exports.AGREE_POLICY = exports.FAKE_USER_STATE = exports.FAKE_USER_KEY = void 0;
4
4
  const lodash_1 = require("lodash");
5
5
  const tool_1 = require("./tool");
6
6
  exports.FAKE_USER_KEY = 'SXP_FAKE_USER_ID';
@@ -8,6 +8,7 @@ exports.FAKE_USER_STATE = 'FAKE_USER_STATE';
8
8
  exports.AGREE_POLICY = 'AGREE_POLICY';
9
9
  exports.SLIDE_SKIP_STATE = 'SLIDE_SKIP_STATE';
10
10
  exports.CCONTSENT_STATE = 'CCONTSENT_STATE';
11
+ exports.USER_CONSENT_RESULT_KEY = 'USER_CONSENT_RESULT';
11
12
  const storeAndLoadFeUserId = () => {
12
13
  let fakeUserId = window.localStorage.getItem(exports.FAKE_USER_KEY);
13
14
  if ((0, lodash_1.isEmpty)(fakeUserId)) {
@@ -46,3 +47,12 @@ const getContsentState = () => {
46
47
  return (0, lodash_1.isEmpty)(contsentState);
47
48
  };
48
49
  exports.getContsentState = getContsentState;
50
+ const getUserConsentResult = () => {
51
+ const contsentState = window.localStorage.getItem(exports.USER_CONSENT_RESULT_KEY);
52
+ return contsentState === 'true';
53
+ };
54
+ exports.getUserConsentResult = getUserConsentResult;
55
+ const setUserConsentResult = () => {
56
+ window.localStorage.setItem(exports.USER_CONSENT_RESULT_KEY, 'true');
57
+ };
58
+ exports.setUserConsentResult = setUserConsentResult;
@@ -7,6 +7,7 @@ const ConsentDetail_1 = tslib_1.__importDefault(require("../../popup/ConsentDeta
7
7
  const tel_png_1 = tslib_1.__importDefault(require("./tel.png"));
8
8
  const tool_1 = require("../../../../core/utils/tool");
9
9
  const hooks_1 = require("../../../../core/hooks");
10
+ const localStore_1 = require("../../../../core/utils/localStore");
10
11
  const Click = (_a) => {
11
12
  var { isTel, open, content, style, consentPopupCate, acceptButton, rejectButton, showRejectButton } = _a, props = tslib_1.__rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "acceptButton", "rejectButton", "showRejectButton"]);
12
13
  const { getAccount, accountSonsent } = (0, hooks_1.useSxpDataSource)();
@@ -19,12 +20,14 @@ const Click = (_a) => {
19
20
  return consentPopupCate || (open && style && !consentResult);
20
21
  }, [consentPopupCate, open, style, consentResult]);
21
22
  (0, react_1.useEffect)(() => {
22
- !consentPopupCate && open && style && handleGetAccount();
23
+ !consentPopupCate && open && style && !(0, localStore_1.getUserConsentResult)() && handleGetAccount();
23
24
  }, []);
24
25
  const handleClickAccept = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
25
26
  const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
26
- if (res)
27
+ if (res) {
27
28
  setConsentResult(true);
29
+ (0, localStore_1.setUserConsentResult)();
30
+ }
28
31
  });
29
32
  const handleClickReject = () => {
30
33
  history === null || history === void 0 ? void 0 : history.back();
@@ -6,6 +6,7 @@ require("./index.less");
6
6
  const ConsentDetail_1 = tslib_1.__importDefault(require("../../popup/ConsentDetail"));
7
7
  const tel_png_1 = tslib_1.__importDefault(require("./tel.png"));
8
8
  const hooks_1 = require("../../../../core/hooks");
9
+ const localStore_1 = require("../../../../core/utils/localStore");
9
10
  const Swipe = (_a) => {
10
11
  var { isTel, open, content, style, consentPopupCate, swipeIcon } = _a, props = tslib_1.__rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "swipeIcon"]);
11
12
  const touchInfo = (0, react_1.useRef)();
@@ -20,12 +21,14 @@ const Swipe = (_a) => {
20
21
  return consentPopupCate || (open && style && !consentResult);
21
22
  }, [consentPopupCate, open, style, consentResult]);
22
23
  (0, react_1.useEffect)(() => {
23
- !consentPopupCate && open && style && handleGetAccount();
24
+ !consentPopupCate && open && style && !(0, localStore_1.getUserConsentResult)() && handleGetAccount();
24
25
  }, []);
25
26
  const handleClickAccept = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
26
27
  const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
27
- if (res)
28
+ if (res) {
28
29
  setConsentResult(true);
30
+ (0, localStore_1.setUserConsentResult)();
31
+ }
29
32
  });
30
33
  const handleTouchStart = (event) => {
31
34
  const touch = event.touches[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.15.7",
3
+ "version": "1.15.8",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",