pb-sxp-ui 1.19.14 → 1.19.15

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.
@@ -220,9 +220,22 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
220
220
  const numericValue = parseInt(value) || 0;
221
221
  return numericValue;
222
222
  };
223
+ const getDvhInPx = () => {
224
+ const detector = document.createElement('div');
225
+ detector.style.position = 'fixed';
226
+ detector.style.bottom = `${getHeightWithSafeArea()}px`;
227
+ detector.style.left = '0';
228
+ detector.style.height = '100dvh';
229
+ detector.style.visibility = 'hidden';
230
+ detector.style.zIndex = '-1';
231
+ document.body.appendChild(detector);
232
+ const dvhInPx = detector.clientHeight;
233
+ document.body.removeChild(detector);
234
+ return dvhInPx;
235
+ };
223
236
  const height = useMemo(() => {
224
- return visibleHeight - minusHeight - tagHeight - getHeightWithSafeArea();
225
- }, [minusHeight, visibleHeight, tagHeight, getHeightWithSafeArea, containerHeight]);
237
+ return getDvhInPx() - minusHeight - tagHeight - getHeightWithSafeArea();
238
+ }, [minusHeight, visibleHeight, tagHeight, getHeightWithSafeArea, containerHeight, getDvhInPx]);
226
239
  const visList = useMemo(() => {
227
240
  var _a;
228
241
  const list = activeIndex === 0 && !waterFallData && !isEditor && !isDiyH5
@@ -1,7 +1,4 @@
1
1
  import { useState, useEffect, useCallback } from 'react';
2
- import fundebug from 'fundebug-javascript';
3
- if (fundebug)
4
- fundebug.apikey = '522a79b0a6242a8ad683cc045ec9e65bbac3a0f620561ac49d39eaad4f303618';
5
2
  export const useVisibleHeight = () => {
6
3
  var _a, _b;
7
4
  const [visibleHeight, setVisibleHeight] = useState(0);
@@ -68,7 +65,9 @@ export const useVisibleHeight = () => {
68
65
  fillAvailableInPx: getFillAvailableInPx()
69
66
  };
70
67
  console.log(systemInfo, 'fundebug-init--------------------->systemInfo');
71
- fundebug.notify('Collect_Info', 'init', { metaData: { systemInfo, otherInfo: {} } });
68
+ if ('fundebug' in window) {
69
+ window === null || window === void 0 ? void 0 : window.fundebug.notify('Collect_Info', 'init', { metaData: { systemInfo, otherInfo: {} } });
70
+ }
72
71
  const getVisibleContentHeight = () => {
73
72
  if (typeof window === 'undefined')
74
73
  return 0;
@@ -93,7 +92,7 @@ export const useVisibleHeight = () => {
93
92
  screenHeight: window.screen.height,
94
93
  bodyHeight: (_b = document === null || document === void 0 ? void 0 : document.body) === null || _b === void 0 ? void 0 : _b.clientHeight,
95
94
  agent: navigator.userAgent,
96
- version: '1.19.14',
95
+ version: '1.19.15',
97
96
  safeArea: getHeightWithSafeArea(),
98
97
  dvh: dvhToPx(100),
99
98
  dvhInPx: getDvhInPx(),
@@ -101,7 +100,9 @@ export const useVisibleHeight = () => {
101
100
  fillAvailableInPx: getFillAvailableInPx()
102
101
  };
103
102
  console.log(systemInfo, 'fundebug-resize--------------------->systemInfo');
104
- fundebug.notify('Collect_Info', 'resize', { metaData: { systemInfo, otherInfo: {} } });
103
+ if ('fundebug' in window) {
104
+ window === null || window === void 0 ? void 0 : window.fundebug.notify('Collect_Info', 'resize', { metaData: { systemInfo, otherInfo: {} } });
105
+ }
105
106
  const height = ((_c = document === null || document === void 0 ? void 0 : document.documentElement) === null || _c === void 0 ? void 0 : _c.clientHeight) || (window === null || window === void 0 ? void 0 : window.innerHeight);
106
107
  setVisibleHeight(height);
107
108
  }, [getHeightWithSafeArea, dvhToPx, getDvhInPx, getVhInPx, getFillAvailableInPx]);
@@ -223,9 +223,22 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
223
223
  const numericValue = parseInt(value) || 0;
224
224
  return numericValue;
225
225
  };
226
+ const getDvhInPx = () => {
227
+ const detector = document.createElement('div');
228
+ detector.style.position = 'fixed';
229
+ detector.style.bottom = `${getHeightWithSafeArea()}px`;
230
+ detector.style.left = '0';
231
+ detector.style.height = '100dvh';
232
+ detector.style.visibility = 'hidden';
233
+ detector.style.zIndex = '-1';
234
+ document.body.appendChild(detector);
235
+ const dvhInPx = detector.clientHeight;
236
+ document.body.removeChild(detector);
237
+ return dvhInPx;
238
+ };
226
239
  const height = (0, react_1.useMemo)(() => {
227
- return visibleHeight - minusHeight - tagHeight - getHeightWithSafeArea();
228
- }, [minusHeight, visibleHeight, tagHeight, getHeightWithSafeArea, containerHeight]);
240
+ return getDvhInPx() - minusHeight - tagHeight - getHeightWithSafeArea();
241
+ }, [minusHeight, visibleHeight, tagHeight, getHeightWithSafeArea, containerHeight, getDvhInPx]);
229
242
  const visList = (0, react_1.useMemo)(() => {
230
243
  var _a;
231
244
  const list = activeIndex === 0 && !waterFallData && !isEditor && !isDiyH5
@@ -1,11 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useVisibleHeight = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const react_1 = require("react");
6
- const fundebug_javascript_1 = tslib_1.__importDefault(require("fundebug-javascript"));
7
- if (fundebug_javascript_1.default)
8
- fundebug_javascript_1.default.apikey = '522a79b0a6242a8ad683cc045ec9e65bbac3a0f620561ac49d39eaad4f303618';
9
5
  const useVisibleHeight = () => {
10
6
  var _a, _b;
11
7
  const [visibleHeight, setVisibleHeight] = (0, react_1.useState)(0);
@@ -72,7 +68,9 @@ const useVisibleHeight = () => {
72
68
  fillAvailableInPx: getFillAvailableInPx()
73
69
  };
74
70
  console.log(systemInfo, 'fundebug-init--------------------->systemInfo');
75
- fundebug_javascript_1.default.notify('Collect_Info', 'init', { metaData: { systemInfo, otherInfo: {} } });
71
+ if ('fundebug' in window) {
72
+ window === null || window === void 0 ? void 0 : window.fundebug.notify('Collect_Info', 'init', { metaData: { systemInfo, otherInfo: {} } });
73
+ }
76
74
  const getVisibleContentHeight = () => {
77
75
  if (typeof window === 'undefined')
78
76
  return 0;
@@ -97,7 +95,7 @@ const useVisibleHeight = () => {
97
95
  screenHeight: window.screen.height,
98
96
  bodyHeight: (_b = document === null || document === void 0 ? void 0 : document.body) === null || _b === void 0 ? void 0 : _b.clientHeight,
99
97
  agent: navigator.userAgent,
100
- version: '1.19.14',
98
+ version: '1.19.15',
101
99
  safeArea: getHeightWithSafeArea(),
102
100
  dvh: dvhToPx(100),
103
101
  dvhInPx: getDvhInPx(),
@@ -105,7 +103,9 @@ const useVisibleHeight = () => {
105
103
  fillAvailableInPx: getFillAvailableInPx()
106
104
  };
107
105
  console.log(systemInfo, 'fundebug-resize--------------------->systemInfo');
108
- fundebug_javascript_1.default.notify('Collect_Info', 'resize', { metaData: { systemInfo, otherInfo: {} } });
106
+ if ('fundebug' in window) {
107
+ window === null || window === void 0 ? void 0 : window.fundebug.notify('Collect_Info', 'resize', { metaData: { systemInfo, otherInfo: {} } });
108
+ }
109
109
  const height = ((_c = document === null || document === void 0 ? void 0 : document.documentElement) === null || _c === void 0 ? void 0 : _c.clientHeight) || (window === null || window === void 0 ? void 0 : window.innerHeight);
110
110
  setVisibleHeight(height);
111
111
  }, [getHeightWithSafeArea, dvhToPx, getDvhInPx, getVhInPx, getFillAvailableInPx]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.19.14",
3
+ "version": "1.19.15",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",