pb-sxp-ui 1.19.10 → 1.19.12
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 +11 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +4 -0
- package/dist/index.js +11 -25
- 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 +11 -25
- 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 +8 -2
- package/es/core/hooks/useVisibleHeight.js +2 -1
- package/lib/core/components/SxpPageRender/index.js +8 -2
- package/lib/core/hooks/useVisibleHeight.js +2 -1
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
|
@@ -18995,30 +18995,9 @@ Made in Italy` })));
|
|
|
18995
18995
|
|
|
18996
18996
|
const useVisibleHeight = () => {
|
|
18997
18997
|
const [visibleHeight, setVisibleHeight] = React.useState(0);
|
|
18998
|
-
const getVisibleContentHeight = () => {
|
|
18999
|
-
// 方法优先级:
|
|
19000
|
-
// 1. visualViewport.height (最准确)
|
|
19001
|
-
// 2. window.innerHeight (次之)
|
|
19002
|
-
// 3. document.documentElement.clientHeight (fallback)
|
|
19003
|
-
if (typeof window === 'undefined')
|
|
19004
|
-
return 0;
|
|
19005
|
-
let height = window.innerHeight;
|
|
19006
|
-
// 优先使用 visualViewport
|
|
19007
|
-
if (window.visualViewport) {
|
|
19008
|
-
height = window.visualViewport.height;
|
|
19009
|
-
}
|
|
19010
|
-
// 验证高度合理性
|
|
19011
|
-
if (height <= 0 || height > window.screen.height) {
|
|
19012
|
-
height = window.innerHeight;
|
|
19013
|
-
}
|
|
19014
|
-
// 最终 fallback
|
|
19015
|
-
if (height <= 0) {
|
|
19016
|
-
height = document.documentElement.clientHeight;
|
|
19017
|
-
}
|
|
19018
|
-
return height;
|
|
19019
|
-
};
|
|
19020
18998
|
const updateHeight = React.useCallback(() => {
|
|
19021
|
-
|
|
18999
|
+
var _a;
|
|
19000
|
+
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);
|
|
19022
19001
|
setVisibleHeight(height);
|
|
19023
19002
|
}, []);
|
|
19024
19003
|
React.useEffect(() => {
|
|
@@ -19255,6 +19234,13 @@ Made in Italy` })));
|
|
|
19255
19234
|
return minusHeight;
|
|
19256
19235
|
}, [globalConfig]);
|
|
19257
19236
|
const getHeightWithSafeArea = () => {
|
|
19237
|
+
const root = document.documentElement;
|
|
19238
|
+
const value = getComputedStyle(root).getPropertyValue('--safe-area-inset-bottom');
|
|
19239
|
+
// 处理可能的值(可能是 '0px', '34px' 等)
|
|
19240
|
+
const numericValue = parseInt(value) || 0;
|
|
19241
|
+
return numericValue;
|
|
19242
|
+
};
|
|
19243
|
+
const getHeightWithSafeArea2 = () => {
|
|
19258
19244
|
// 获取窗口高度
|
|
19259
19245
|
// 动态检测安全区域
|
|
19260
19246
|
const detector = document.createElement('div');
|
|
@@ -19270,8 +19256,8 @@ Made in Italy` })));
|
|
|
19270
19256
|
return safeAreaBottom;
|
|
19271
19257
|
};
|
|
19272
19258
|
const height = React.useMemo(() => {
|
|
19273
|
-
return visibleHeight - minusHeight - tagHeight;
|
|
19274
|
-
}, [minusHeight, visibleHeight, tagHeight]);
|
|
19259
|
+
return visibleHeight - minusHeight - tagHeight - getHeightWithSafeArea2();
|
|
19260
|
+
}, [minusHeight, visibleHeight, tagHeight, getHeightWithSafeArea2]);
|
|
19275
19261
|
const visList = React.useMemo(() => {
|
|
19276
19262
|
var _a;
|
|
19277
19263
|
const list = activeIndex === 0 && !waterFallData && !isEditor && !isDiyH5
|