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 +30 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +30 -10
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +4 -4
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +30 -10
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +4 -4
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/index.js +2 -2
- package/es/core/utils/localStore.d.ts +3 -0
- package/es/core/utils/localStore.js +8 -0
- package/es/materials/sxp/consentPopup/Click/index.js +5 -2
- package/es/materials/sxp/consentPopup/Swipe/index.js +5 -2
- package/lib/core/components/SxpPageRender/index.js +2 -2
- package/lib/core/utils/localStore.d.ts +3 -0
- package/lib/core/utils/localStore.js +11 -1
- package/lib/materials/sxp/consentPopup/Click/index.js +5 -2
- package/lib/materials/sxp/consentPopup/Swipe/index.js +5 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -462,11 +462,20 @@ const getFeSessionId = () => {
|
|
462
462
|
return window.localStorage.getItem(feRealSessionIdKey);
|
463
463
|
};
|
464
464
|
|
465
|
+
/*
|
466
|
+
* @Author: binruan@chatlabs.com
|
467
|
+
* @Date: 2024-03-20 10:27:31
|
468
|
+
* @LastEditors: binruan@chatlabs.com
|
469
|
+
* @LastEditTime: 2025-02-25 16:43:21
|
470
|
+
* @FilePath: \pb-sxp-ui\src\core\utils\localStore.ts
|
471
|
+
*
|
472
|
+
*/
|
465
473
|
const FAKE_USER_KEY = 'SXP_FAKE_USER_ID';
|
466
|
-
const FAKE_USER_STATE = 'FAKE_USER_STATE';
|
474
|
+
const FAKE_USER_STATE = 'FAKE_USER_STATE'; // 新用户仅显示一次滑动提示
|
467
475
|
const AGREE_POLICY = 'AGREE_POLICY';
|
468
|
-
const SLIDE_SKIP_STATE = 'SLIDE_SKIP_STATE';
|
469
|
-
const CCONTSENT_STATE = 'CCONTSENT_STATE';
|
476
|
+
const SLIDE_SKIP_STATE = 'SLIDE_SKIP_STATE'; // 新用户滑动下一个视频跳转外链状态(触发过一次就不再触发)
|
477
|
+
const CCONTSENT_STATE = 'CCONTSENT_STATE'; // 新用户仅显示一次contsent弹窗
|
478
|
+
const USER_CONSENT_RESULT_KEY = 'USER_CONSENT_RESULT'; // 用户已授权consent弹窗
|
470
479
|
const storeAndLoadFeUserId = () => {
|
471
480
|
let fakeUserId = window.localStorage.getItem(FAKE_USER_KEY);
|
472
481
|
if (isEmpty(fakeUserId)) {
|
@@ -496,6 +505,13 @@ const getContsentState = () => {
|
|
496
505
|
}
|
497
506
|
return isEmpty(contsentState);
|
498
507
|
};
|
508
|
+
const getUserConsentResult = () => {
|
509
|
+
const contsentState = window.localStorage.getItem(USER_CONSENT_RESULT_KEY);
|
510
|
+
return contsentState === 'true';
|
511
|
+
};
|
512
|
+
const setUserConsentResult = () => {
|
513
|
+
window.localStorage.setItem(USER_CONSENT_RESULT_KEY, 'true');
|
514
|
+
};
|
499
515
|
|
500
516
|
/*
|
501
517
|
* @Author: binruan@chatlabs.com
|
@@ -16903,12 +16919,14 @@ const Click$1 = (_a) => {
|
|
16903
16919
|
return consentPopupCate || (open && style && !consentResult);
|
16904
16920
|
}, [consentPopupCate, open, style, consentResult]);
|
16905
16921
|
useEffect(() => {
|
16906
|
-
!consentPopupCate && open && style && handleGetAccount();
|
16922
|
+
!consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
|
16907
16923
|
}, []);
|
16908
16924
|
const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
|
16909
16925
|
const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
|
16910
|
-
if (res)
|
16926
|
+
if (res) {
|
16911
16927
|
setConsentResult(true);
|
16928
|
+
setUserConsentResult();
|
16929
|
+
}
|
16912
16930
|
});
|
16913
16931
|
const handleClickReject = () => {
|
16914
16932
|
history === null || history === void 0 ? void 0 : history.back();
|
@@ -17047,12 +17065,14 @@ const Swipe$1 = (_a) => {
|
|
17047
17065
|
return consentPopupCate || (open && style && !consentResult);
|
17048
17066
|
}, [consentPopupCate, open, style, consentResult]);
|
17049
17067
|
useEffect(() => {
|
17050
|
-
!consentPopupCate && open && style && handleGetAccount();
|
17068
|
+
!consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
|
17051
17069
|
}, []);
|
17052
17070
|
const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
|
17053
17071
|
const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
|
17054
|
-
if (res)
|
17072
|
+
if (res) {
|
17055
17073
|
setConsentResult(true);
|
17074
|
+
setUserConsentResult();
|
17075
|
+
}
|
17056
17076
|
});
|
17057
17077
|
const handleTouchStart = (event) => {
|
17058
17078
|
const touch = event.touches[0];
|
@@ -18391,7 +18411,7 @@ var NavBack$1 = memo(NavBack);
|
|
18391
18411
|
* @Author: binruan@chatlabs.com
|
18392
18412
|
* @Date: 2024-03-20 10:27:31
|
18393
18413
|
* @LastEditors: binruan@chatlabs.com
|
18394
|
-
* @LastEditTime: 2025-02-25
|
18414
|
+
* @LastEditTime: 2025-02-25 16:50:19
|
18395
18415
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
18396
18416
|
*
|
18397
18417
|
*/
|
@@ -18930,8 +18950,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18930
18950
|
isReload,
|
18931
18951
|
renderToggleButton
|
18932
18952
|
]);
|
18933
|
-
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' } },
|
18934
|
-
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", {
|
18953
|
+
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' } },
|
18954
|
+
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` })) },
|
18935
18955
|
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: () => {
|
18936
18956
|
const isEq = isEqual(rtcList, cacheRtcList);
|
18937
18957
|
if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
|