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/index.css
CHANGED
package/dist/index.js
CHANGED
|
@@ -18980,30 +18980,9 @@ var NavBack$1 = memo(NavBack);
|
|
|
18980
18980
|
|
|
18981
18981
|
const useVisibleHeight = () => {
|
|
18982
18982
|
const [visibleHeight, setVisibleHeight] = useState(0);
|
|
18983
|
-
const getVisibleContentHeight = () => {
|
|
18984
|
-
// 方法优先级:
|
|
18985
|
-
// 1. visualViewport.height (最准确)
|
|
18986
|
-
// 2. window.innerHeight (次之)
|
|
18987
|
-
// 3. document.documentElement.clientHeight (fallback)
|
|
18988
|
-
if (typeof window === 'undefined')
|
|
18989
|
-
return 0;
|
|
18990
|
-
let height = window.innerHeight;
|
|
18991
|
-
// 优先使用 visualViewport
|
|
18992
|
-
if (window.visualViewport) {
|
|
18993
|
-
height = window.visualViewport.height;
|
|
18994
|
-
}
|
|
18995
|
-
// 验证高度合理性
|
|
18996
|
-
if (height <= 0 || height > window.screen.height) {
|
|
18997
|
-
height = window.innerHeight;
|
|
18998
|
-
}
|
|
18999
|
-
// 最终 fallback
|
|
19000
|
-
if (height <= 0) {
|
|
19001
|
-
height = document.documentElement.clientHeight;
|
|
19002
|
-
}
|
|
19003
|
-
return height;
|
|
19004
|
-
};
|
|
19005
18983
|
const updateHeight = useCallback(() => {
|
|
19006
|
-
|
|
18984
|
+
var _a;
|
|
18985
|
+
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);
|
|
19007
18986
|
setVisibleHeight(height);
|
|
19008
18987
|
}, []);
|
|
19009
18988
|
useEffect(() => {
|
|
@@ -19240,6 +19219,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
|
19240
19219
|
return minusHeight;
|
|
19241
19220
|
}, [globalConfig]);
|
|
19242
19221
|
const getHeightWithSafeArea = () => {
|
|
19222
|
+
const root = document.documentElement;
|
|
19223
|
+
const value = getComputedStyle(root).getPropertyValue('--safe-area-inset-bottom');
|
|
19224
|
+
// 处理可能的值(可能是 '0px', '34px' 等)
|
|
19225
|
+
const numericValue = parseInt(value) || 0;
|
|
19226
|
+
return numericValue;
|
|
19227
|
+
};
|
|
19228
|
+
const getHeightWithSafeArea2 = () => {
|
|
19243
19229
|
// 获取窗口高度
|
|
19244
19230
|
// 动态检测安全区域
|
|
19245
19231
|
const detector = document.createElement('div');
|
|
@@ -19255,8 +19241,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
|
19255
19241
|
return safeAreaBottom;
|
|
19256
19242
|
};
|
|
19257
19243
|
const height = useMemo(() => {
|
|
19258
|
-
return visibleHeight - minusHeight - tagHeight;
|
|
19259
|
-
}, [minusHeight, visibleHeight, tagHeight]);
|
|
19244
|
+
return visibleHeight - minusHeight - tagHeight - getHeightWithSafeArea2();
|
|
19245
|
+
}, [minusHeight, visibleHeight, tagHeight, getHeightWithSafeArea2]);
|
|
19260
19246
|
const visList = useMemo(() => {
|
|
19261
19247
|
var _a;
|
|
19262
19248
|
const list = activeIndex === 0 && !waterFallData && !isEditor && !isDiyH5
|