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 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
- const height = getVisibleContentHeight();
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(() => {
@@ -19262,6 +19241,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
19262
19241
  return minusHeight;
19263
19242
  }, [globalConfig]);
19264
19243
  const getHeightWithSafeArea = () => {
19244
+ const root = document.documentElement;
19245
+ const value = getComputedStyle(root).getPropertyValue('--safe-area-inset-bottom');
19246
+ // 处理可能的值(可能是 '0px', '34px' 等)
19247
+ const numericValue = parseInt(value) || 0;
19248
+ return numericValue;
19249
+ };
19250
+ const getHeightWithSafeArea2 = () => {
19265
19251
  // 获取窗口高度
19266
19252
  // 动态检测安全区域
19267
19253
  const detector = document.createElement('div');
@@ -19277,8 +19263,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
19277
19263
  return safeAreaBottom;
19278
19264
  };
19279
19265
  const height = React.useMemo(() => {
19280
- return visibleHeight - minusHeight - tagHeight;
19281
- }, [minusHeight, visibleHeight, tagHeight]);
19266
+ return visibleHeight - minusHeight - tagHeight - getHeightWithSafeArea2();
19267
+ }, [minusHeight, visibleHeight, tagHeight, getHeightWithSafeArea2]);
19282
19268
  const visList = React.useMemo(() => {
19283
19269
  var _a;
19284
19270
  const list = activeIndex === 0 && !waterFallData && !isEditor && !isDiyH5