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.css CHANGED
@@ -62,6 +62,10 @@ a:active {
62
62
  .swiper-button-next,.swiper-button-prev{
63
63
  color: #000;
64
64
  outline: none;
65
+ }
66
+
67
+ :root {
68
+ --safe-area-inset-bottom: env(safe-area-inset-bottom);
65
69
  }
66
70
  .pb-appoint-form {
67
71
  position: relative;
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
- const height = getVisibleContentHeight();
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