pb-sxp-ui 1.19.4 → 1.19.6
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 +17 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -15
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +5 -5
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +5 -5
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +17 -15
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +5 -5
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/ExpandableText.js +2 -0
- package/es/core/components/SxpPageRender/RenderCard.js +3 -3
- package/es/core/components/SxpPageRender/index.js +4 -4
- package/es/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.js +6 -1
- package/lib/core/components/SxpPageRender/ExpandableText.js +2 -0
- package/lib/core/components/SxpPageRender/RenderCard.js +3 -3
- package/lib/core/components/SxpPageRender/index.js +4 -4
- package/lib/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.js +6 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -684,6 +684,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
684
684
|
const [chatlabsId, setChatlabsId] = React.useState();
|
|
685
685
|
const finalPageData = React.useMemo(() => pageData !== null && pageData !== void 0 ? pageData : data, [pageData, data]);
|
|
686
686
|
const pixelPvStatusRef = React.useRef(false);
|
|
687
|
+
React.useEffect(() => {
|
|
688
|
+
var _a, _b;
|
|
689
|
+
setGlobalConfig((_b = (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf) === null || _b === void 0 ? void 0 : _b.globalConfig);
|
|
690
|
+
}, [data]);
|
|
687
691
|
const isShowConsent = React.useMemo(() => {
|
|
688
692
|
var _a, _b, _c, _d;
|
|
689
693
|
return (((((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === 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.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent) &&
|
|
@@ -1577,7 +1581,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
1577
1581
|
refreshFeSession,
|
|
1578
1582
|
getAccount,
|
|
1579
1583
|
accountSonsent,
|
|
1580
|
-
isDiyH5
|
|
1584
|
+
isDiyH5,
|
|
1585
|
+
pixelPvStatusRef
|
|
1581
1586
|
} }, isShowConsent ? (React.createElement(Consent$4, Object.assign({}, (_e = (_d = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.props))) : (render({
|
|
1582
1587
|
rtcList,
|
|
1583
1588
|
mutateLike: bffMutateLike,
|
|
@@ -10529,6 +10534,8 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
|
10529
10534
|
if (!realRef.current || !clampRef.current || !isPost || !text || isShowMore)
|
|
10530
10535
|
return;
|
|
10531
10536
|
requestAnimationFrame(() => {
|
|
10537
|
+
if (!realRef.current)
|
|
10538
|
+
return;
|
|
10532
10539
|
realRef.current.style.position = 'relative';
|
|
10533
10540
|
const realHeight = realRef.current.getBoundingClientRect().height;
|
|
10534
10541
|
const clampHeight = clampRef.current.getBoundingClientRect().height;
|
|
@@ -18826,7 +18833,7 @@ function withBindDataSource(Component) {
|
|
|
18826
18833
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
|
18827
18834
|
*
|
|
18828
18835
|
*/
|
|
18829
|
-
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive, isNineProduct }) => {
|
|
18836
|
+
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType = [], isActive, isNineProduct }) => {
|
|
18830
18837
|
var _a, _b, _c, _d, _e;
|
|
18831
18838
|
const { schema } = useEditor();
|
|
18832
18839
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
|
@@ -18845,10 +18852,10 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive,
|
|
|
18845
18852
|
const renderComp = React.useMemo(() => {
|
|
18846
18853
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
|
18847
18854
|
// 如果includesCtaType有值,则只渲染includesCtaType包含的cta类型组件,用于在页面某处只显示某一组件
|
|
18848
|
-
if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type)))
|
|
18855
|
+
if ((includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.length) > 0 && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type)))
|
|
18849
18856
|
return;
|
|
18850
18857
|
// 默认不渲染category为cta类型的组件,该类型的组件只用于某一处
|
|
18851
|
-
if (!includesCtaType && ((_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.category) === 'cta')
|
|
18858
|
+
if ((!includesCtaType || (includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.length) === 0) && ((_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.category) === 'cta')
|
|
18852
18859
|
return;
|
|
18853
18860
|
if ((((_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.type) === 'CommodityDiro' && !((_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindProduct)) ||
|
|
18854
18861
|
(((_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.type) === 'Commodity' && !((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct)) ||
|
|
@@ -19016,10 +19023,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
|
19016
19023
|
const [isReload, setIsReload] = React.useState(new Date().getTime());
|
|
19017
19024
|
const skipLinkRef = React.useRef(false);
|
|
19018
19025
|
const [pageNum, setPageNum] = React.useState(2);
|
|
19019
|
-
|
|
19026
|
+
React.useState(false);
|
|
19020
19027
|
const videoWidgetRef = React.useRef(null);
|
|
19021
19028
|
const fbcRef = React.useRef('');
|
|
19022
|
-
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, isNoMoreData, channel, refreshFeSession, isDiyH5 } = useSxpDataSource();
|
|
19029
|
+
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, isNoMoreData, channel, refreshFeSession, isDiyH5, pixelPvStatusRef } = useSxpDataSource();
|
|
19023
19030
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
|
19024
19031
|
const isShowFingerTip = React.useMemo(() => {
|
|
19025
19032
|
return data.length > 0 && !loading && (getFeUserState() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
|
|
@@ -19299,7 +19306,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
|
19299
19306
|
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _j !== void 0 ? _j : 40}px` } },
|
|
19300
19307
|
React.createElement(Nudge, { nudge: nudge }),
|
|
19301
19308
|
((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) && !isNineProduct ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
|
19302
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex }))) : null,
|
|
19309
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, includesCtaType: [] }))) : null,
|
|
19303
19310
|
React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
|
|
19304
19311
|
React.createElement(ExpandableText$1, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.title) !== null && _l !== void 0 ? _l : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
|
|
19305
19312
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
|
|
@@ -19479,13 +19486,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
|
19479
19486
|
}
|
|
19480
19487
|
window.OptanonWrapper = function () {
|
|
19481
19488
|
const activeGroups = window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups;
|
|
19482
|
-
if (activeGroups && (activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.length) > 2)
|
|
19483
|
-
setIsShowCookieSetting(true);
|
|
19484
|
-
// if (!activeGroups?.includes('4')) {
|
|
19485
|
-
// deleteCookie('_fbp', '/', extractRootDomain(window.location.hostname));
|
|
19486
|
-
// (window as any)?.fbq('consent', 'revoke');
|
|
19487
|
-
// }
|
|
19488
|
-
}
|
|
19489
|
+
if (activeGroups && (activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.length) > 2) ;
|
|
19489
19490
|
};
|
|
19490
19491
|
const handleClick = (event) => {
|
|
19491
19492
|
var _a, _b;
|
|
@@ -19500,6 +19501,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
|
19500
19501
|
if (activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.includes('4')) {
|
|
19501
19502
|
window === null || window === void 0 ? void 0 : window.loadMetaPixel(false, SXP_CONFIG === null || SXP_CONFIG === void 0 ? void 0 : SXP_CONFIG.meta_conversion_api_pid);
|
|
19502
19503
|
window === null || window === void 0 ? void 0 : window.fbq('consent', 'grant');
|
|
19504
|
+
pixelPvStatusRef.current = true;
|
|
19503
19505
|
if (fbcRef.current && !(beForeactiveGroups === null || beForeactiveGroups === void 0 ? void 0 : beForeactiveGroups.includes('4'))) ;
|
|
19504
19506
|
}
|
|
19505
19507
|
else {
|
|
@@ -19674,7 +19676,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
|
19674
19676
|
React.createElement(WaterFall$1, Object.assign({}, (_u = (_t = (_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.item) === null || _u === void 0 ? void 0 : _u.props)),
|
|
19675
19677
|
React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
|
|
19676
19678
|
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 } }))))),
|
|
19677
|
-
|
|
19679
|
+
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting) && (React.createElement("div", { style: {
|
|
19678
19680
|
position: 'fixed',
|
|
19679
19681
|
bottom: 0,
|
|
19680
19682
|
left: 0,
|