pb-sxp-ui 1.19.11 → 1.19.13
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 +5 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -26
- 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 +5 -26
- 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/hooks/useVisibleHeight.js +2 -1
- package/lib/core/components/SxpPageRender/index.js +2 -2
- package/lib/core/hooks/useVisibleHeight.js +2 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -19002,30 +19002,9 @@ var NavBack$1 = React.memo(NavBack);
|
|
|
19002
19002
|
|
|
19003
19003
|
const useVisibleHeight = () => {
|
|
19004
19004
|
const [visibleHeight, setVisibleHeight] = React.useState(0);
|
|
19005
|
-
const getVisibleContentHeight = () => {
|
|
19006
|
-
// 方法优先级:
|
|
19007
|
-
// 1. visualViewport.height (最准确)
|
|
19008
|
-
// 2. window.innerHeight (次之)
|
|
19009
|
-
// 3. document.documentElement.clientHeight (fallback)
|
|
19010
|
-
if (typeof window === 'undefined')
|
|
19011
|
-
return 0;
|
|
19012
|
-
let height = window.innerHeight;
|
|
19013
|
-
// 优先使用 visualViewport
|
|
19014
|
-
if (window.visualViewport) {
|
|
19015
|
-
height = window.visualViewport.height;
|
|
19016
|
-
}
|
|
19017
|
-
// 验证高度合理性
|
|
19018
|
-
if (height <= 0 || height > window.screen.height) {
|
|
19019
|
-
height = window.innerHeight;
|
|
19020
|
-
}
|
|
19021
|
-
// 最终 fallback
|
|
19022
|
-
if (height <= 0) {
|
|
19023
|
-
height = document.documentElement.clientHeight;
|
|
19024
|
-
}
|
|
19025
|
-
return height;
|
|
19026
|
-
};
|
|
19027
19005
|
const updateHeight = React.useCallback(() => {
|
|
19028
|
-
|
|
19006
|
+
var _a;
|
|
19007
|
+
const height = ((_a = document === null || document === void 0 ? void 0 : document.documentElement) === null || _a === void 0 ? void 0 : _a.clientHeight) || (window === null || window === void 0 ? void 0 : window.innerHeight);
|
|
19029
19008
|
setVisibleHeight(height);
|
|
19030
19009
|
}, []);
|
|
19031
19010
|
React.useEffect(() => {
|
|
@@ -19092,7 +19071,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
|
19092
19071
|
const fbcRef = React.useRef('');
|
|
19093
19072
|
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();
|
|
19094
19073
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
|
19095
|
-
useVisibleHeight();
|
|
19074
|
+
const visibleHeight = useVisibleHeight();
|
|
19096
19075
|
const isShowFingerTip = React.useMemo(() => {
|
|
19097
19076
|
return data.length > 0 && !loading && (getFeUserState() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
|
|
19098
19077
|
}, [data, loading, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip]);
|
|
@@ -19284,8 +19263,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
|
19284
19263
|
return safeAreaBottom;
|
|
19285
19264
|
};
|
|
19286
19265
|
const height = React.useMemo(() => {
|
|
19287
|
-
return
|
|
19288
|
-
}, [minusHeight,
|
|
19266
|
+
return visibleHeight - minusHeight - tagHeight - getHeightWithSafeArea2();
|
|
19267
|
+
}, [minusHeight, visibleHeight, tagHeight, getHeightWithSafeArea2, containerHeight]);
|
|
19289
19268
|
const visList = React.useMemo(() => {
|
|
19290
19269
|
var _a;
|
|
19291
19270
|
const list = activeIndex === 0 && !waterFallData && !isEditor && !isDiyH5
|