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/index.css CHANGED
@@ -65,6 +65,7 @@ a:active {
65
65
  }
66
66
 
67
67
  :root {
68
+ --safe-area-inset-bottom: constant(safe-area-inset-bottom);
68
69
  --safe-area-inset-bottom: env(safe-area-inset-bottom);
69
70
  }
70
71
  .pb-appoint-form {
@@ -1075,7 +1076,7 @@ a:active {
1075
1076
  padding-top: 18px;
1076
1077
  padding-left: 18px;
1077
1078
  padding-right: 18px;
1078
- padding-bottom: calc(18px + env(safe-area-inset-bottom));
1079
+ padding-bottom: calc(18px + var(--safe-area-inset-bottom, 0px));
1079
1080
  }
1080
1081
  .waterfallFlow__title {
1081
1082
  text-align: center;
@@ -1554,7 +1555,7 @@ a:active {
1554
1555
  top: 0;
1555
1556
  left: 0;
1556
1557
  right: 0;
1557
- bottom: env(safe-area-inset-bottom);
1558
+ bottom: var(--safe-area-inset-bottom, 0px);
1558
1559
  width: 100%;
1559
1560
  -webkit-box-sizing: border-box;
1560
1561
  box-sizing: border-box;
@@ -2466,7 +2467,7 @@ button.swiper-pagination-bullet {
2466
2467
  left: 0;
2467
2468
  top: 0;
2468
2469
  right: 0;
2469
- bottom: env(safe-area-inset-bottom);
2470
+ bottom: var(--safe-area-inset-bottom, 0px);
2470
2471
  z-index: 100;
2471
2472
  -webkit-box-orient: vertical;
2472
2473
  -webkit-box-direction: normal;
package/dist/index.js CHANGED
@@ -18979,12 +18979,98 @@ const NavBack = ({ data, minusHeight, tagHeight, onClick }) => {
18979
18979
  var NavBack$1 = memo(NavBack);
18980
18980
 
18981
18981
  const useVisibleHeight = () => {
18982
+ var _a, _b;
18982
18983
  const [visibleHeight, setVisibleHeight] = useState(0);
18984
+ const getDvhInPx = () => {
18985
+ const detector = document.createElement('div');
18986
+ detector.style.position = 'fixed';
18987
+ detector.style.bottom = `${getHeightWithSafeArea()}px`;
18988
+ detector.style.left = '0';
18989
+ detector.style.height = '100dvh';
18990
+ detector.style.visibility = 'hidden';
18991
+ detector.style.zIndex = '-1';
18992
+ document.body.appendChild(detector);
18993
+ const dvhInPx = detector.clientHeight;
18994
+ document.body.removeChild(detector);
18995
+ return dvhInPx;
18996
+ };
18997
+ const getVhInPx = () => {
18998
+ const detector = document.createElement('div');
18999
+ detector.style.position = 'fixed';
19000
+ detector.style.bottom = `${getHeightWithSafeArea()}px`;
19001
+ detector.style.left = '0';
19002
+ detector.style.height = '100vh';
19003
+ detector.style.visibility = 'hidden';
19004
+ detector.style.zIndex = '-1';
19005
+ document.body.appendChild(detector);
19006
+ const dvhInPx = detector.clientHeight;
19007
+ document.body.removeChild(detector);
19008
+ return dvhInPx;
19009
+ };
19010
+ const getFillAvailableInPx = () => {
19011
+ const detector = document.createElement('div');
19012
+ detector.style.position = 'fixed';
19013
+ detector.style.bottom = `${getHeightWithSafeArea()}px`;
19014
+ detector.style.left = '0';
19015
+ detector.style.height = '-webkit-fill-available';
19016
+ detector.style.visibility = 'hidden';
19017
+ detector.style.zIndex = '-1';
19018
+ document.body.appendChild(detector);
19019
+ const dvhInPx = detector.clientHeight;
19020
+ document.body.removeChild(detector);
19021
+ return dvhInPx;
19022
+ };
19023
+ const getHeightWithSafeArea = () => {
19024
+ const root = document.documentElement;
19025
+ const value = getComputedStyle(root).getPropertyValue('--safe-area-inset-bottom');
19026
+ // 处理可能的值(可能是 '0px', '34px' 等)
19027
+ const numericValue = parseInt(value) || 0;
19028
+ return numericValue;
19029
+ };
19030
+ const dvhToPx = (dvh) => {
19031
+ return Math.round((dvh / 100) * document.documentElement.clientHeight);
19032
+ };
19033
+ const systemInfo = {
19034
+ visualViewport: (_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.height,
19035
+ innerHeight: window.innerHeight,
19036
+ clientHeight: document.documentElement.clientHeight,
19037
+ screenHeight: window.screen.height,
19038
+ bodyHeight: (_b = document === null || document === void 0 ? void 0 : document.body) === null || _b === void 0 ? void 0 : _b.clientHeight,
19039
+ agent: navigator.userAgent,
19040
+ version: '1.19.14',
19041
+ safeArea: getHeightWithSafeArea(),
19042
+ dvh: dvhToPx(100),
19043
+ dvhInPx: getDvhInPx(),
19044
+ vhInPx: getVhInPx(),
19045
+ fillAvailableInPx: getFillAvailableInPx()
19046
+ };
19047
+ console.log(systemInfo, 'fundebug-init--------------------->systemInfo');
19048
+ if ('fundebug' in window) {
19049
+ window === null || window === void 0 ? void 0 : window.fundebug.notify('Collect_Info', 'init', { metaData: { systemInfo, otherInfo: {} } });
19050
+ }
18983
19051
  const updateHeight = useCallback(() => {
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);
19052
+ var _a, _b, _c;
19053
+ const systemInfo = {
19054
+ visualViewport: (_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.height,
19055
+ innerHeight: window.innerHeight,
19056
+ clientHeight: document.documentElement.clientHeight,
19057
+ screenHeight: window.screen.height,
19058
+ bodyHeight: (_b = document === null || document === void 0 ? void 0 : document.body) === null || _b === void 0 ? void 0 : _b.clientHeight,
19059
+ agent: navigator.userAgent,
19060
+ version: '1.19.15',
19061
+ safeArea: getHeightWithSafeArea(),
19062
+ dvh: dvhToPx(100),
19063
+ dvhInPx: getDvhInPx(),
19064
+ vhInPx: getVhInPx(),
19065
+ fillAvailableInPx: getFillAvailableInPx()
19066
+ };
19067
+ console.log(systemInfo, 'fundebug-resize--------------------->systemInfo');
19068
+ if ('fundebug' in window) {
19069
+ window === null || window === void 0 ? void 0 : window.fundebug.notify('Collect_Info', 'resize', { metaData: { systemInfo, otherInfo: {} } });
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);
18986
19072
  setVisibleHeight(height);
18987
- }, []);
19073
+ }, [getHeightWithSafeArea, dvhToPx, getDvhInPx, getVhInPx, getFillAvailableInPx]);
18988
19074
  useEffect(() => {
18989
19075
  // 初始计算
18990
19076
  updateHeight();
@@ -19225,24 +19311,22 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
19225
19311
  const numericValue = parseInt(value) || 0;
19226
19312
  return numericValue;
19227
19313
  };
19228
- const getHeightWithSafeArea2 = () => {
19229
- // 获取窗口高度
19230
- // 动态检测安全区域
19314
+ const getDvhInPx = () => {
19231
19315
  const detector = document.createElement('div');
19232
19316
  detector.style.position = 'fixed';
19233
- detector.style.bottom = '0';
19317
+ detector.style.bottom = `${getHeightWithSafeArea()}px`;
19234
19318
  detector.style.left = '0';
19235
- detector.style.paddingBottom = 'env(safe-area-inset-bottom)';
19319
+ detector.style.height = '100dvh';
19236
19320
  detector.style.visibility = 'hidden';
19321
+ detector.style.zIndex = '-1';
19237
19322
  document.body.appendChild(detector);
19238
- const computedStyle = window.getComputedStyle(detector);
19239
- const safeAreaBottom = parseFloat(computedStyle.paddingBottom) || 0;
19323
+ const dvhInPx = detector.clientHeight;
19240
19324
  document.body.removeChild(detector);
19241
- return safeAreaBottom;
19325
+ return dvhInPx;
19242
19326
  };
19243
19327
  const height = useMemo(() => {
19244
- return visibleHeight - minusHeight - tagHeight - getHeightWithSafeArea2();
19245
- }, [minusHeight, visibleHeight, tagHeight, getHeightWithSafeArea2, containerHeight]);
19328
+ return getDvhInPx() - minusHeight - tagHeight - getHeightWithSafeArea();
19329
+ }, [minusHeight, visibleHeight, tagHeight, getHeightWithSafeArea, containerHeight, getDvhInPx]);
19246
19330
  const visList = useMemo(() => {
19247
19331
  var _a;
19248
19332
  const list = activeIndex === 0 && !waterFallData && !isEditor && !isDiyH5
@@ -19725,10 +19809,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
19725
19809
  renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
19726
19810
  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)),
19727
19811
  React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
19728
- 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)' } }))))),
19812
+ 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)' } }))))),
19729
19813
  (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting) && (React.createElement("div", { style: {
19730
19814
  position: 'fixed',
19731
- bottom: 'env(safe-area-inset-bottom)',
19815
+ bottom: 'var(--safe-area-inset-bottom,0px)',
19732
19816
  left: 0,
19733
19817
  right: 0,
19734
19818
  width: '100%',