pb-sxp-ui 1.19.14 → 1.19.16

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.js CHANGED
@@ -7,7 +7,6 @@ import EventEmitter from 'eventemitter3';
7
7
  import { css } from '@emotion/css';
8
8
  import * as ReactDOM from 'react-dom';
9
9
  import ReactDOM__default from 'react-dom';
10
- import fundebug from 'fundebug-javascript';
11
10
 
12
11
  /******************************************************************************
13
12
  Copyright (c) Microsoft Corporation.
@@ -18979,8 +18978,6 @@ const NavBack = ({ data, minusHeight, tagHeight, onClick }) => {
18979
18978
  };
18980
18979
  var NavBack$1 = memo(NavBack);
18981
18980
 
18982
- if (fundebug)
18983
- fundebug.apikey = '522a79b0a6242a8ad683cc045ec9e65bbac3a0f620561ac49d39eaad4f303618';
18984
18981
  const useVisibleHeight = () => {
18985
18982
  var _a, _b;
18986
18983
  const [visibleHeight, setVisibleHeight] = useState(0);
@@ -19040,7 +19037,7 @@ const useVisibleHeight = () => {
19040
19037
  screenHeight: window.screen.height,
19041
19038
  bodyHeight: (_b = document === null || document === void 0 ? void 0 : document.body) === null || _b === void 0 ? void 0 : _b.clientHeight,
19042
19039
  agent: navigator.userAgent,
19043
- version: '1.19.14',
19040
+ version: '1.19.16',
19044
19041
  safeArea: getHeightWithSafeArea(),
19045
19042
  dvh: dvhToPx(100),
19046
19043
  dvhInPx: getDvhInPx(),
@@ -19048,7 +19045,9 @@ const useVisibleHeight = () => {
19048
19045
  fillAvailableInPx: getFillAvailableInPx()
19049
19046
  };
19050
19047
  console.log(systemInfo, 'fundebug-init--------------------->systemInfo');
19051
- fundebug.notify('Collect_Info', 'init', { metaData: { systemInfo, otherInfo: {} } });
19048
+ if ('fundebug' in window) {
19049
+ window === null || window === void 0 ? void 0 : window.fundebug.notify('Collect_Info', 'init', { metaData: { systemInfo, otherInfo: {} } });
19050
+ }
19052
19051
  const updateHeight = useCallback(() => {
19053
19052
  var _a, _b, _c;
19054
19053
  const systemInfo = {
@@ -19058,7 +19057,7 @@ const useVisibleHeight = () => {
19058
19057
  screenHeight: window.screen.height,
19059
19058
  bodyHeight: (_b = document === null || document === void 0 ? void 0 : document.body) === null || _b === void 0 ? void 0 : _b.clientHeight,
19060
19059
  agent: navigator.userAgent,
19061
- version: '1.19.14',
19060
+ version: '1.19.15',
19062
19061
  safeArea: getHeightWithSafeArea(),
19063
19062
  dvh: dvhToPx(100),
19064
19063
  dvhInPx: getDvhInPx(),
@@ -19066,7 +19065,9 @@ const useVisibleHeight = () => {
19066
19065
  fillAvailableInPx: getFillAvailableInPx()
19067
19066
  };
19068
19067
  console.log(systemInfo, 'fundebug-resize--------------------->systemInfo');
19069
- fundebug.notify('Collect_Info', 'resize', { metaData: { systemInfo, otherInfo: {} } });
19068
+ if ('fundebug' in window) {
19069
+ window === null || window === void 0 ? void 0 : window.fundebug.notify('Collect_Info', 'resize', { metaData: { systemInfo, otherInfo: {} } });
19070
+ }
19070
19071
  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);
19071
19072
  setVisibleHeight(height);
19072
19073
  }, [getHeightWithSafeArea, dvhToPx, getDvhInPx, getVhInPx, getFillAvailableInPx]);
@@ -19310,9 +19311,22 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
19310
19311
  const numericValue = parseInt(value) || 0;
19311
19312
  return numericValue;
19312
19313
  };
19314
+ const getDvhInPx = () => {
19315
+ const detector = document.createElement('div');
19316
+ detector.style.position = 'fixed';
19317
+ detector.style.bottom = `${getHeightWithSafeArea()}px`;
19318
+ detector.style.left = '0';
19319
+ detector.style.height = '100dvh';
19320
+ detector.style.visibility = 'hidden';
19321
+ detector.style.zIndex = '-1';
19322
+ document.body.appendChild(detector);
19323
+ const dvhInPx = detector.clientHeight;
19324
+ document.body.removeChild(detector);
19325
+ return dvhInPx;
19326
+ };
19313
19327
  const height = useMemo(() => {
19314
- return visibleHeight - minusHeight - tagHeight - getHeightWithSafeArea();
19315
- }, [minusHeight, visibleHeight, tagHeight, getHeightWithSafeArea, containerHeight]);
19328
+ return getDvhInPx() - minusHeight - tagHeight - getHeightWithSafeArea();
19329
+ }, [minusHeight, visibleHeight, tagHeight, getHeightWithSafeArea, containerHeight, getDvhInPx]);
19316
19330
  const visList = useMemo(() => {
19317
19331
  var _a;
19318
19332
  const list = activeIndex === 0 && !waterFallData && !isEditor && !isDiyH5