pb-sxp-ui 1.19.13 → 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.
package/dist/pb-ui.js CHANGED
@@ -18994,12 +18994,98 @@ Made in Italy` })));
18994
18994
  var NavBack$1 = React.memo(NavBack);
18995
18995
 
18996
18996
  const useVisibleHeight = () => {
18997
+ var _a, _b;
18997
18998
  const [visibleHeight, setVisibleHeight] = React.useState(0);
18999
+ const getDvhInPx = () => {
19000
+ const detector = document.createElement('div');
19001
+ detector.style.position = 'fixed';
19002
+ detector.style.bottom = `${getHeightWithSafeArea()}px`;
19003
+ detector.style.left = '0';
19004
+ detector.style.height = '100dvh';
19005
+ detector.style.visibility = 'hidden';
19006
+ detector.style.zIndex = '-1';
19007
+ document.body.appendChild(detector);
19008
+ const dvhInPx = detector.clientHeight;
19009
+ document.body.removeChild(detector);
19010
+ return dvhInPx;
19011
+ };
19012
+ const getVhInPx = () => {
19013
+ const detector = document.createElement('div');
19014
+ detector.style.position = 'fixed';
19015
+ detector.style.bottom = `${getHeightWithSafeArea()}px`;
19016
+ detector.style.left = '0';
19017
+ detector.style.height = '100vh';
19018
+ detector.style.visibility = 'hidden';
19019
+ detector.style.zIndex = '-1';
19020
+ document.body.appendChild(detector);
19021
+ const dvhInPx = detector.clientHeight;
19022
+ document.body.removeChild(detector);
19023
+ return dvhInPx;
19024
+ };
19025
+ const getFillAvailableInPx = () => {
19026
+ const detector = document.createElement('div');
19027
+ detector.style.position = 'fixed';
19028
+ detector.style.bottom = `${getHeightWithSafeArea()}px`;
19029
+ detector.style.left = '0';
19030
+ detector.style.height = '-webkit-fill-available';
19031
+ detector.style.visibility = 'hidden';
19032
+ detector.style.zIndex = '-1';
19033
+ document.body.appendChild(detector);
19034
+ const dvhInPx = detector.clientHeight;
19035
+ document.body.removeChild(detector);
19036
+ return dvhInPx;
19037
+ };
19038
+ const getHeightWithSafeArea = () => {
19039
+ const root = document.documentElement;
19040
+ const value = getComputedStyle(root).getPropertyValue('--safe-area-inset-bottom');
19041
+ // 处理可能的值(可能是 '0px', '34px' 等)
19042
+ const numericValue = parseInt(value) || 0;
19043
+ return numericValue;
19044
+ };
19045
+ const dvhToPx = (dvh) => {
19046
+ return Math.round((dvh / 100) * document.documentElement.clientHeight);
19047
+ };
19048
+ const systemInfo = {
19049
+ visualViewport: (_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.height,
19050
+ innerHeight: window.innerHeight,
19051
+ clientHeight: document.documentElement.clientHeight,
19052
+ screenHeight: window.screen.height,
19053
+ bodyHeight: (_b = document === null || document === void 0 ? void 0 : document.body) === null || _b === void 0 ? void 0 : _b.clientHeight,
19054
+ agent: navigator.userAgent,
19055
+ version: '1.19.14',
19056
+ safeArea: getHeightWithSafeArea(),
19057
+ dvh: dvhToPx(100),
19058
+ dvhInPx: getDvhInPx(),
19059
+ vhInPx: getVhInPx(),
19060
+ fillAvailableInPx: getFillAvailableInPx()
19061
+ };
19062
+ console.log(systemInfo, 'fundebug-init--------------------->systemInfo');
19063
+ if ('fundebug' in window) {
19064
+ window === null || window === void 0 ? void 0 : window.fundebug.notify('Collect_Info', 'init', { metaData: { systemInfo, otherInfo: {} } });
19065
+ }
18998
19066
  const updateHeight = React.useCallback(() => {
18999
- var _a;
19000
- 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);
19067
+ var _a, _b, _c;
19068
+ const systemInfo = {
19069
+ visualViewport: (_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.height,
19070
+ innerHeight: window.innerHeight,
19071
+ clientHeight: document.documentElement.clientHeight,
19072
+ screenHeight: window.screen.height,
19073
+ bodyHeight: (_b = document === null || document === void 0 ? void 0 : document.body) === null || _b === void 0 ? void 0 : _b.clientHeight,
19074
+ agent: navigator.userAgent,
19075
+ version: '1.19.15',
19076
+ safeArea: getHeightWithSafeArea(),
19077
+ dvh: dvhToPx(100),
19078
+ dvhInPx: getDvhInPx(),
19079
+ vhInPx: getVhInPx(),
19080
+ fillAvailableInPx: getFillAvailableInPx()
19081
+ };
19082
+ console.log(systemInfo, 'fundebug-resize--------------------->systemInfo');
19083
+ if ('fundebug' in window) {
19084
+ window === null || window === void 0 ? void 0 : window.fundebug.notify('Collect_Info', 'resize', { metaData: { systemInfo, otherInfo: {} } });
19085
+ }
19086
+ 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);
19001
19087
  setVisibleHeight(height);
19002
- }, []);
19088
+ }, [getHeightWithSafeArea, dvhToPx, getDvhInPx, getVhInPx, getFillAvailableInPx]);
19003
19089
  React.useEffect(() => {
19004
19090
  // 初始计算
19005
19091
  updateHeight();
@@ -19240,24 +19326,22 @@ Made in Italy` })));
19240
19326
  const numericValue = parseInt(value) || 0;
19241
19327
  return numericValue;
19242
19328
  };
19243
- const getHeightWithSafeArea2 = () => {
19244
- // 获取窗口高度
19245
- // 动态检测安全区域
19329
+ const getDvhInPx = () => {
19246
19330
  const detector = document.createElement('div');
19247
19331
  detector.style.position = 'fixed';
19248
- detector.style.bottom = '0';
19332
+ detector.style.bottom = `${getHeightWithSafeArea()}px`;
19249
19333
  detector.style.left = '0';
19250
- detector.style.paddingBottom = 'env(safe-area-inset-bottom)';
19334
+ detector.style.height = '100dvh';
19251
19335
  detector.style.visibility = 'hidden';
19336
+ detector.style.zIndex = '-1';
19252
19337
  document.body.appendChild(detector);
19253
- const computedStyle = window.getComputedStyle(detector);
19254
- const safeAreaBottom = parseFloat(computedStyle.paddingBottom) || 0;
19338
+ const dvhInPx = detector.clientHeight;
19255
19339
  document.body.removeChild(detector);
19256
- return safeAreaBottom;
19340
+ return dvhInPx;
19257
19341
  };
19258
19342
  const height = React.useMemo(() => {
19259
- return visibleHeight - minusHeight - tagHeight - getHeightWithSafeArea2();
19260
- }, [minusHeight, visibleHeight, tagHeight, getHeightWithSafeArea2, containerHeight]);
19343
+ return getDvhInPx() - minusHeight - tagHeight - getHeightWithSafeArea();
19344
+ }, [minusHeight, visibleHeight, tagHeight, getHeightWithSafeArea, containerHeight, getDvhInPx]);
19261
19345
  const visList = React.useMemo(() => {
19262
19346
  var _a;
19263
19347
  const list = activeIndex === 0 && !waterFallData && !isEditor && !isDiyH5
@@ -19740,10 +19824,10 @@ Made in Italy` })));
19740
19824
  renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
19741
19825
  React.createElement(WaterFall$1, Object.assign({}, (_u = (_t = (_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.item) === null || _u === void 0 ? void 0 : _u.props)),
19742
19826
  React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
19743
- openMultiPosts && (React.createElement(MultiPosts$2, Object.assign({}, (_x = (_w = (_v = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.item) === null || _x === void 0 ? void 0 : _x.props, (_0 = (_z = (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.item) === null || _0 === void 0 ? void 0 : _0.event, { style: { position: 'fixed', top: 0, left: 0, right: 0, bottom: 'env(safe-area-inset-bottom)' } }))))),
19827
+ openMultiPosts && (React.createElement(MultiPosts$2, Object.assign({}, (_x = (_w = (_v = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.item) === null || _x === void 0 ? void 0 : _x.props, (_0 = (_z = (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.item) === null || _0 === void 0 ? void 0 : _0.event, { style: { position: 'fixed', top: 0, left: 0, right: 0, bottom: 'var(--safe-area-inset-bottom,0px)' } }))))),
19744
19828
  (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting) && (React.createElement("div", { style: {
19745
19829
  position: 'fixed',
19746
- bottom: 'env(safe-area-inset-bottom)',
19830
+ bottom: 'var(--safe-area-inset-bottom,0px)',
19747
19831
  left: 0,
19748
19832
  right: 0,
19749
19833
  width: '100%',