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 +54 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +54 -16
- 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 +54 -16
- 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/context/SxpDataSourceProvider.js +19 -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/Click/material.js +1 -1
- package/es/materials/sxp/consentPopup/Swipe/index.js +5 -2
- package/es/materials/sxp/consentPopup/Swipe/material.js +1 -1
- package/lib/core/components/SxpPageRender/index.js +2 -2
- package/lib/core/context/SxpDataSourceProvider.js +19 -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/Click/material.js +1 -1
- package/lib/materials/sxp/consentPopup/Swipe/index.js +5 -2
- package/lib/materials/sxp/consentPopup/Swipe/material.js +1 -1
- 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
|
@@ -721,6 +737,24 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
721
737
|
.then((res) => res.json())
|
722
738
|
.catch((err) => Promise.reject(err));
|
723
739
|
}, [bffDataSource, fakeUserId]);
|
740
|
+
// bff API admin 请求方法
|
741
|
+
const bffFetchAdmin = useCallback((path, options) => {
|
742
|
+
if (!bffDataSource)
|
743
|
+
return;
|
744
|
+
const url = bffDataSource.url;
|
745
|
+
if (options === null || options === void 0 ? void 0 : options.query) {
|
746
|
+
const queryString = qs.stringify(options.query);
|
747
|
+
path = `${path}?${queryString}`;
|
748
|
+
}
|
749
|
+
return window
|
750
|
+
.fetch(`${url}/admin/${path}`, {
|
751
|
+
headers: Object.assign({ 'Content-Type': 'application/json' }, bffDataSource.headers),
|
752
|
+
method: options.method,
|
753
|
+
body: JSON.stringify(options.body)
|
754
|
+
})
|
755
|
+
.then((res) => res.json())
|
756
|
+
.catch((err) => Promise.reject(err));
|
757
|
+
}, [bffDataSource]);
|
724
758
|
// 获取推荐视频数据
|
725
759
|
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
726
760
|
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
@@ -749,7 +783,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
749
783
|
const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
|
750
784
|
var _v, _w, _x, _y, _z, _0;
|
751
785
|
query.pageNum = pageNum;
|
752
|
-
result = yield (
|
786
|
+
result = yield (bffFetchAdmin === null || bffFetchAdmin === void 0 ? void 0 : bffFetchAdmin('recommend/direct_page', { method: 'POST', body: query }));
|
753
787
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
754
788
|
return undefined;
|
755
789
|
}
|
@@ -789,7 +823,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
789
823
|
return Object.assign(Object.assign({}, result.data), { recList: list });
|
790
824
|
}
|
791
825
|
return result === null || result === void 0 ? void 0 : result.data;
|
792
|
-
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId]);
|
826
|
+
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin]);
|
793
827
|
const loadVideos = useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
|
794
828
|
var _1, _2, _3, _4;
|
795
829
|
if (rtcList.length <= 0) {
|
@@ -16903,12 +16937,14 @@ const Click$1 = (_a) => {
|
|
16903
16937
|
return consentPopupCate || (open && style && !consentResult);
|
16904
16938
|
}, [consentPopupCate, open, style, consentResult]);
|
16905
16939
|
useEffect(() => {
|
16906
|
-
!consentPopupCate && open && style && handleGetAccount();
|
16940
|
+
!consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
|
16907
16941
|
}, []);
|
16908
16942
|
const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
|
16909
16943
|
const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
|
16910
|
-
if (res)
|
16944
|
+
if (res) {
|
16911
16945
|
setConsentResult(true);
|
16946
|
+
setUserConsentResult();
|
16947
|
+
}
|
16912
16948
|
});
|
16913
16949
|
const handleClickReject = () => {
|
16914
16950
|
history === null || history === void 0 ? void 0 : history.back();
|
@@ -16930,7 +16966,7 @@ var ClickComponent = memo(Click$1);
|
|
16930
16966
|
* @Author: binruan@chatlabs.com
|
16931
16967
|
* @Date: 2025-01-14 16:22:35
|
16932
16968
|
* @LastEditors: binruan@chatlabs.com
|
16933
|
-
* @LastEditTime: 2025-
|
16969
|
+
* @LastEditTime: 2025-02-26 11:44:00
|
16934
16970
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\consentPopup\Click\material.tsx
|
16935
16971
|
*
|
16936
16972
|
*/
|
@@ -16945,7 +16981,7 @@ const Click = createMaterial(ClickComponent, {
|
|
16945
16981
|
},
|
16946
16982
|
defaulSetting: {
|
16947
16983
|
props: {
|
16948
|
-
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 "Accept all cookies". If you click on "Reject all cookies", 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 "Cookies Settings" below or at the bottom of any Fendi.com webpage. For more information, read our Cookie Policy.</p><p></p>',
|
16984
|
+
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 "Accept all cookies". If you click on "Reject all cookies", 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 "Cookies Settings" below or at the bottom of any Fendi.com webpage. For more information, read our Cookie Policy.</span></span></p><p></p>',
|
16949
16985
|
acceptButton: {
|
16950
16986
|
text: 'Accept all cookies',
|
16951
16987
|
style: {
|
@@ -17047,12 +17083,14 @@ const Swipe$1 = (_a) => {
|
|
17047
17083
|
return consentPopupCate || (open && style && !consentResult);
|
17048
17084
|
}, [consentPopupCate, open, style, consentResult]);
|
17049
17085
|
useEffect(() => {
|
17050
|
-
!consentPopupCate && open && style && handleGetAccount();
|
17086
|
+
!consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
|
17051
17087
|
}, []);
|
17052
17088
|
const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
|
17053
17089
|
const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
|
17054
|
-
if (res)
|
17090
|
+
if (res) {
|
17055
17091
|
setConsentResult(true);
|
17092
|
+
setUserConsentResult();
|
17093
|
+
}
|
17056
17094
|
});
|
17057
17095
|
const handleTouchStart = (event) => {
|
17058
17096
|
const touch = event.touches[0];
|
@@ -17089,7 +17127,7 @@ var SwipeComponent = memo(Swipe$1);
|
|
17089
17127
|
* @Author: binruan@chatlabs.com
|
17090
17128
|
* @Date: 2025-01-14 16:22:35
|
17091
17129
|
* @LastEditors: binruan@chatlabs.com
|
17092
|
-
* @LastEditTime: 2025-02-
|
17130
|
+
* @LastEditTime: 2025-02-26 11:39:59
|
17093
17131
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\consentPopup\Swipe\material.tsx
|
17094
17132
|
*
|
17095
17133
|
*/
|
@@ -17104,7 +17142,7 @@ const Swipe = createMaterial(SwipeComponent, {
|
|
17104
17142
|
},
|
17105
17143
|
defaulSetting: {
|
17106
17144
|
props: {
|
17107
|
-
content: '<p><span style="font-
|
17145
|
+
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 'Accept all cookies'. If you click on 'Reject all cookies', 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 'Cookies Settings' below or at the bottom of any Fendi.com webpage. For more information, <u>read our Cookie Policy</u>.</span></span></p>'
|
17108
17146
|
},
|
17109
17147
|
style: {
|
17110
17148
|
backgroundColor: '#fff',
|
@@ -18391,7 +18429,7 @@ var NavBack$1 = memo(NavBack);
|
|
18391
18429
|
* @Author: binruan@chatlabs.com
|
18392
18430
|
* @Date: 2024-03-20 10:27:31
|
18393
18431
|
* @LastEditors: binruan@chatlabs.com
|
18394
|
-
* @LastEditTime: 2025-02-25
|
18432
|
+
* @LastEditTime: 2025-02-25 16:50:19
|
18395
18433
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
18396
18434
|
*
|
18397
18435
|
*/
|
@@ -18930,8 +18968,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18930
18968
|
isReload,
|
18931
18969
|
renderToggleButton
|
18932
18970
|
]);
|
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", {
|
18971
|
+
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' } },
|
18972
|
+
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
18973
|
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
18974
|
const isEq = isEqual(rtcList, cacheRtcList);
|
18937
18975
|
if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
|