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/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
|
@@ -12092,9 +12108,10 @@ var settingRender$9 = [
|
|
12092
12108
|
];
|
12093
12109
|
|
12094
12110
|
const ConsentDetail$1 = (_a) => {
|
12111
|
+
var _b;
|
12095
12112
|
var { content, isTel, style } = _a; __rest(_a, ["content", "isTel", "style"]);
|
12096
12113
|
return (React.createElement("article", { className: 'consentDetail-article', dangerouslySetInnerHTML: {
|
12097
|
-
__html:
|
12114
|
+
__html: (_b = content === null || content === void 0 ? void 0 : content.html) !== null && _b !== void 0 ? _b : content
|
12098
12115
|
}, onClick: (e) => {
|
12099
12116
|
e.stopPropagation();
|
12100
12117
|
}, style: style }));
|
@@ -16902,12 +16919,14 @@ const Click$1 = (_a) => {
|
|
16902
16919
|
return consentPopupCate || (open && style && !consentResult);
|
16903
16920
|
}, [consentPopupCate, open, style, consentResult]);
|
16904
16921
|
useEffect(() => {
|
16905
|
-
!consentPopupCate && open && style && handleGetAccount();
|
16922
|
+
!consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
|
16906
16923
|
}, []);
|
16907
16924
|
const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
|
16908
16925
|
const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
|
16909
|
-
if (res)
|
16926
|
+
if (res) {
|
16910
16927
|
setConsentResult(true);
|
16928
|
+
setUserConsentResult();
|
16929
|
+
}
|
16911
16930
|
});
|
16912
16931
|
const handleClickReject = () => {
|
16913
16932
|
history === null || history === void 0 ? void 0 : history.back();
|
@@ -17046,12 +17065,14 @@ const Swipe$1 = (_a) => {
|
|
17046
17065
|
return consentPopupCate || (open && style && !consentResult);
|
17047
17066
|
}, [consentPopupCate, open, style, consentResult]);
|
17048
17067
|
useEffect(() => {
|
17049
|
-
!consentPopupCate && open && style && handleGetAccount();
|
17068
|
+
!consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
|
17050
17069
|
}, []);
|
17051
17070
|
const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
|
17052
17071
|
const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
|
17053
|
-
if (res)
|
17072
|
+
if (res) {
|
17054
17073
|
setConsentResult(true);
|
17074
|
+
setUserConsentResult();
|
17075
|
+
}
|
17055
17076
|
});
|
17056
17077
|
const handleTouchStart = (event) => {
|
17057
17078
|
const touch = event.touches[0];
|
@@ -18390,7 +18411,7 @@ var NavBack$1 = memo(NavBack);
|
|
18390
18411
|
* @Author: binruan@chatlabs.com
|
18391
18412
|
* @Date: 2024-03-20 10:27:31
|
18392
18413
|
* @LastEditors: binruan@chatlabs.com
|
18393
|
-
* @LastEditTime: 2025-02-
|
18414
|
+
* @LastEditTime: 2025-02-25 16:50:19
|
18394
18415
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
18395
18416
|
*
|
18396
18417
|
*/
|
@@ -18929,8 +18950,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18929
18950
|
isReload,
|
18930
18951
|
renderToggleButton
|
18931
18952
|
]);
|
18932
|
-
return (React.createElement(
|
18933
|
-
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` })) },
|
18934
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: () => {
|
18935
18956
|
const isEq = isEqual(rtcList, cacheRtcList);
|
18936
18957
|
if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
|
@@ -18992,6 +19013,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18992
19013
|
React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
|
18993
19014
|
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 } })))))));
|
18994
19015
|
};
|
19016
|
+
var SxpPageRender$1 = memo(SxpPageRender);
|
18995
19017
|
|
18996
19018
|
const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
|
18997
19019
|
return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
|
@@ -19484,7 +19506,7 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
|
|
19484
19506
|
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 }) => {
|
19485
19507
|
var _a;
|
19486
19508
|
return (React.createElement(React.Fragment, null,
|
19487
|
-
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 })),
|
19509
|
+
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 })),
|
19488
19510
|
React.createElement(Popup, null)));
|
19489
19511
|
} })));
|
19490
19512
|
};
|
@@ -19498,5 +19520,5 @@ var index = memo(SxpPageCore);
|
|
19498
19520
|
* @FilePath: \pb-sxp-ui\src\index.ts
|
19499
19521
|
*/
|
19500
19522
|
|
19501
|
-
export { index$1 as DiyPortalPreview, EditorDataProvider, Modal$1 as Modal, SxpDataSourceProvider$1 as SxpDataSourceProvider, index as SxpPageCore, SxpPageRender, index$2 as core, Pagebuilder as default, _materials_ as materials, useEditorDataProvider };
|
19523
|
+
export { index$1 as DiyPortalPreview, EditorDataProvider, Modal$1 as Modal, SxpDataSourceProvider$1 as SxpDataSourceProvider, index as SxpPageCore, SxpPageRender$1 as SxpPageRender, index$2 as core, Pagebuilder as default, _materials_ as materials, useEditorDataProvider };
|
19502
19524
|
//# sourceMappingURL=index.js.map
|