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.
@@ -215,6 +215,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
215
215
  return minusHeight;
216
216
  }, [globalConfig]);
217
217
  const getHeightWithSafeArea = () => {
218
+ const root = document.documentElement;
219
+ const value = getComputedStyle(root).getPropertyValue('--safe-area-inset-bottom');
220
+ const numericValue = parseInt(value) || 0;
221
+ return numericValue;
222
+ };
223
+ const getHeightWithSafeArea2 = () => {
218
224
  const detector = document.createElement('div');
219
225
  detector.style.position = 'fixed';
220
226
  detector.style.bottom = '0';
@@ -228,8 +234,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
228
234
  return safeAreaBottom;
229
235
  };
230
236
  const height = useMemo(() => {
231
- return visibleHeight - minusHeight - tagHeight;
232
- }, [minusHeight, visibleHeight, tagHeight]);
237
+ return visibleHeight - minusHeight - tagHeight - getHeightWithSafeArea2();
238
+ }, [minusHeight, visibleHeight, tagHeight, getHeightWithSafeArea2]);
233
239
  const visList = useMemo(() => {
234
240
  var _a;
235
241
  const list = activeIndex === 0 && !waterFallData && !isEditor && !isDiyH5
@@ -17,7 +17,8 @@ export const useVisibleHeight = () => {
17
17
  return height;
18
18
  };
19
19
  const updateHeight = useCallback(() => {
20
- const height = getVisibleContentHeight();
20
+ var _a;
21
+ 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);
21
22
  setVisibleHeight(height);
22
23
  }, []);
23
24
  useEffect(() => {
@@ -218,6 +218,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
218
218
  return minusHeight;
219
219
  }, [globalConfig]);
220
220
  const getHeightWithSafeArea = () => {
221
+ const root = document.documentElement;
222
+ const value = getComputedStyle(root).getPropertyValue('--safe-area-inset-bottom');
223
+ const numericValue = parseInt(value) || 0;
224
+ return numericValue;
225
+ };
226
+ const getHeightWithSafeArea2 = () => {
221
227
  const detector = document.createElement('div');
222
228
  detector.style.position = 'fixed';
223
229
  detector.style.bottom = '0';
@@ -231,8 +237,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
231
237
  return safeAreaBottom;
232
238
  };
233
239
  const height = (0, react_1.useMemo)(() => {
234
- return visibleHeight - minusHeight - tagHeight;
235
- }, [minusHeight, visibleHeight, tagHeight]);
240
+ return visibleHeight - minusHeight - tagHeight - getHeightWithSafeArea2();
241
+ }, [minusHeight, visibleHeight, tagHeight, getHeightWithSafeArea2]);
236
242
  const visList = (0, react_1.useMemo)(() => {
237
243
  var _a;
238
244
  const list = activeIndex === 0 && !waterFallData && !isEditor && !isDiyH5
@@ -20,7 +20,8 @@ const useVisibleHeight = () => {
20
20
  return height;
21
21
  };
22
22
  const updateHeight = (0, react_1.useCallback)(() => {
23
- const height = getVisibleContentHeight();
23
+ var _a;
24
+ 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);
24
25
  setVisibleHeight(height);
25
26
  }, []);
26
27
  (0, react_1.useEffect)(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.19.10",
3
+ "version": "1.19.12",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",