pb-sxp-ui 1.15.6 → 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 +35 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +35 -13
- 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 +35 -13
- 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.d.ts +3 -3
- package/es/core/components/SxpPageRender/index.js +4 -4
- package/es/core/utils/localStore.d.ts +3 -0
- package/es/core/utils/localStore.js +8 -0
- package/es/materials/sxp/consentPopup/Click/index.d.ts +5 -1
- package/es/materials/sxp/consentPopup/Click/index.js +5 -2
- package/es/materials/sxp/consentPopup/Swipe/index.d.ts +5 -1
- package/es/materials/sxp/consentPopup/Swipe/index.js +5 -2
- package/es/materials/sxp/popup/ConsentDetail/index.d.ts +5 -1
- package/es/materials/sxp/popup/ConsentDetail/index.js +2 -1
- package/lib/core/components/SxpPageRender/index.d.ts +3 -3
- package/lib/core/components/SxpPageRender/index.js +3 -3
- package/lib/core/utils/localStore.d.ts +3 -0
- package/lib/core/utils/localStore.js +11 -1
- package/lib/materials/sxp/consentPopup/Click/index.d.ts +5 -1
- package/lib/materials/sxp/consentPopup/Click/index.js +5 -2
- package/lib/materials/sxp/consentPopup/Swipe/index.d.ts +5 -1
- package/lib/materials/sxp/consentPopup/Swipe/index.js +5 -2
- package/lib/materials/sxp/popup/ConsentDetail/index.d.ts +5 -1
- package/lib/materials/sxp/popup/ConsentDetail/index.js +2 -1
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
@@ -477,11 +477,20 @@
|
|
477
477
|
return window.localStorage.getItem(feRealSessionIdKey);
|
478
478
|
};
|
479
479
|
|
480
|
+
/*
|
481
|
+
* @Author: binruan@chatlabs.com
|
482
|
+
* @Date: 2024-03-20 10:27:31
|
483
|
+
* @LastEditors: binruan@chatlabs.com
|
484
|
+
* @LastEditTime: 2025-02-25 16:43:21
|
485
|
+
* @FilePath: \pb-sxp-ui\src\core\utils\localStore.ts
|
486
|
+
*
|
487
|
+
*/
|
480
488
|
const FAKE_USER_KEY = 'SXP_FAKE_USER_ID';
|
481
|
-
const FAKE_USER_STATE = 'FAKE_USER_STATE';
|
489
|
+
const FAKE_USER_STATE = 'FAKE_USER_STATE'; // 新用户仅显示一次滑动提示
|
482
490
|
const AGREE_POLICY = 'AGREE_POLICY';
|
483
|
-
const SLIDE_SKIP_STATE = 'SLIDE_SKIP_STATE';
|
484
|
-
const CCONTSENT_STATE = 'CCONTSENT_STATE';
|
491
|
+
const SLIDE_SKIP_STATE = 'SLIDE_SKIP_STATE'; // 新用户滑动下一个视频跳转外链状态(触发过一次就不再触发)
|
492
|
+
const CCONTSENT_STATE = 'CCONTSENT_STATE'; // 新用户仅显示一次contsent弹窗
|
493
|
+
const USER_CONSENT_RESULT_KEY = 'USER_CONSENT_RESULT'; // 用户已授权consent弹窗
|
485
494
|
const storeAndLoadFeUserId = () => {
|
486
495
|
let fakeUserId = window.localStorage.getItem(FAKE_USER_KEY);
|
487
496
|
if (lodash.isEmpty(fakeUserId)) {
|
@@ -511,6 +520,13 @@
|
|
511
520
|
}
|
512
521
|
return lodash.isEmpty(contsentState);
|
513
522
|
};
|
523
|
+
const getUserConsentResult = () => {
|
524
|
+
const contsentState = window.localStorage.getItem(USER_CONSENT_RESULT_KEY);
|
525
|
+
return contsentState === 'true';
|
526
|
+
};
|
527
|
+
const setUserConsentResult = () => {
|
528
|
+
window.localStorage.setItem(USER_CONSENT_RESULT_KEY, 'true');
|
529
|
+
};
|
514
530
|
|
515
531
|
/*
|
516
532
|
* @Author: binruan@chatlabs.com
|
@@ -12107,9 +12123,10 @@ Made in Italy` })));
|
|
12107
12123
|
];
|
12108
12124
|
|
12109
12125
|
const ConsentDetail$1 = (_a) => {
|
12126
|
+
var _b;
|
12110
12127
|
var { content, isTel, style } = _a; __rest(_a, ["content", "isTel", "style"]);
|
12111
12128
|
return (React.createElement("article", { className: 'consentDetail-article', dangerouslySetInnerHTML: {
|
12112
|
-
__html:
|
12129
|
+
__html: (_b = content === null || content === void 0 ? void 0 : content.html) !== null && _b !== void 0 ? _b : content
|
12113
12130
|
}, onClick: (e) => {
|
12114
12131
|
e.stopPropagation();
|
12115
12132
|
}, style: style }));
|
@@ -16917,12 +16934,14 @@ Made in Italy` })));
|
|
16917
16934
|
return consentPopupCate || (open && style && !consentResult);
|
16918
16935
|
}, [consentPopupCate, open, style, consentResult]);
|
16919
16936
|
React.useEffect(() => {
|
16920
|
-
!consentPopupCate && open && style && handleGetAccount();
|
16937
|
+
!consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
|
16921
16938
|
}, []);
|
16922
16939
|
const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
|
16923
16940
|
const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
|
16924
|
-
if (res)
|
16941
|
+
if (res) {
|
16925
16942
|
setConsentResult(true);
|
16943
|
+
setUserConsentResult();
|
16944
|
+
}
|
16926
16945
|
});
|
16927
16946
|
const handleClickReject = () => {
|
16928
16947
|
history === null || history === void 0 ? void 0 : history.back();
|
@@ -17061,12 +17080,14 @@ Made in Italy` })));
|
|
17061
17080
|
return consentPopupCate || (open && style && !consentResult);
|
17062
17081
|
}, [consentPopupCate, open, style, consentResult]);
|
17063
17082
|
React.useEffect(() => {
|
17064
|
-
!consentPopupCate && open && style && handleGetAccount();
|
17083
|
+
!consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
|
17065
17084
|
}, []);
|
17066
17085
|
const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
|
17067
17086
|
const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
|
17068
|
-
if (res)
|
17087
|
+
if (res) {
|
17069
17088
|
setConsentResult(true);
|
17089
|
+
setUserConsentResult();
|
17090
|
+
}
|
17070
17091
|
});
|
17071
17092
|
const handleTouchStart = (event) => {
|
17072
17093
|
const touch = event.touches[0];
|
@@ -18405,7 +18426,7 @@ Made in Italy` })));
|
|
18405
18426
|
* @Author: binruan@chatlabs.com
|
18406
18427
|
* @Date: 2024-03-20 10:27:31
|
18407
18428
|
* @LastEditors: binruan@chatlabs.com
|
18408
|
-
* @LastEditTime: 2025-02-
|
18429
|
+
* @LastEditTime: 2025-02-25 16:50:19
|
18409
18430
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
18410
18431
|
*
|
18411
18432
|
*/
|
@@ -18944,8 +18965,8 @@ Made in Italy` })));
|
|
18944
18965
|
isReload,
|
18945
18966
|
renderToggleButton
|
18946
18967
|
]);
|
18947
|
-
return (React.createElement(
|
18948
|
-
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", {
|
18968
|
+
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' } },
|
18969
|
+
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` })) },
|
18949
18970
|
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: () => {
|
18950
18971
|
const isEq = lodash.isEqual(rtcList, cacheRtcList);
|
18951
18972
|
if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
|
@@ -19007,6 +19028,7 @@ Made in Italy` })));
|
|
19007
19028
|
React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
|
19008
19029
|
openMultiPosts && (React.createElement(MultiPosts$2, Object.assign({}, (_x = (_w = (_v = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.item) === null || _x === void 0 ? void 0 : _x.props, (_0 = (_z = (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.item) === null || _0 === void 0 ? void 0 : _0.event, { style: { position: 'fixed', top: 0, left: 0, right: 0 } })))))));
|
19009
19030
|
};
|
19031
|
+
var SxpPageRender$1 = React.memo(SxpPageRender);
|
19010
19032
|
|
19011
19033
|
const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
|
19012
19034
|
return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
|
@@ -19499,7 +19521,7 @@ Made in Italy` })));
|
|
19499
19521
|
React.createElement(SxpDataSourceProvider$1, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter, data: data, dataList: dataList, onUpdateSchema: (d) => setSchema(d), onUpdateChannel: (d) => setChannel(d), render: ({ rtcList, tagList, pageData }) => {
|
19500
19522
|
var _a;
|
19501
19523
|
return (React.createElement(React.Fragment, null,
|
19502
|
-
React.createElement(SxpPageRender, Object.assign({ defaultData: data }, (_a = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER })),
|
19524
|
+
React.createElement(SxpPageRender$1, Object.assign({ defaultData: data }, (_a = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER })),
|
19503
19525
|
React.createElement(Popup, null)));
|
19504
19526
|
} })));
|
19505
19527
|
};
|
@@ -19518,7 +19540,7 @@ Made in Italy` })));
|
|
19518
19540
|
exports.Modal = Modal$1;
|
19519
19541
|
exports.SxpDataSourceProvider = SxpDataSourceProvider$1;
|
19520
19542
|
exports.SxpPageCore = index;
|
19521
|
-
exports.SxpPageRender = SxpPageRender;
|
19543
|
+
exports.SxpPageRender = SxpPageRender$1;
|
19522
19544
|
exports.core = index$2;
|
19523
19545
|
exports.default = Pagebuilder;
|
19524
19546
|
exports.materials = _materials_;
|