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.cjs +99 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +4 -3
- package/dist/index.js +99 -15
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +5 -5
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +5 -5
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +99 -15
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +5 -5
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/index.js +10 -10
- package/es/core/hooks/useVisibleHeight.js +88 -3
- package/lib/core/components/SxpPageRender/index.js +10 -10
- package/lib/core/hooks/useVisibleHeight.js +88 -3
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -19001,12 +19001,98 @@ const NavBack = ({ data, minusHeight, tagHeight, onClick }) => {
|
|
|
19001
19001
|
var NavBack$1 = React.memo(NavBack);
|
|
19002
19002
|
|
|
19003
19003
|
const useVisibleHeight = () => {
|
|
19004
|
+
var _a, _b;
|
|
19004
19005
|
const [visibleHeight, setVisibleHeight] = React.useState(0);
|
|
19006
|
+
const getDvhInPx = () => {
|
|
19007
|
+
const detector = document.createElement('div');
|
|
19008
|
+
detector.style.position = 'fixed';
|
|
19009
|
+
detector.style.bottom = `${getHeightWithSafeArea()}px`;
|
|
19010
|
+
detector.style.left = '0';
|
|
19011
|
+
detector.style.height = '100dvh';
|
|
19012
|
+
detector.style.visibility = 'hidden';
|
|
19013
|
+
detector.style.zIndex = '-1';
|
|
19014
|
+
document.body.appendChild(detector);
|
|
19015
|
+
const dvhInPx = detector.clientHeight;
|
|
19016
|
+
document.body.removeChild(detector);
|
|
19017
|
+
return dvhInPx;
|
|
19018
|
+
};
|
|
19019
|
+
const getVhInPx = () => {
|
|
19020
|
+
const detector = document.createElement('div');
|
|
19021
|
+
detector.style.position = 'fixed';
|
|
19022
|
+
detector.style.bottom = `${getHeightWithSafeArea()}px`;
|
|
19023
|
+
detector.style.left = '0';
|
|
19024
|
+
detector.style.height = '100vh';
|
|
19025
|
+
detector.style.visibility = 'hidden';
|
|
19026
|
+
detector.style.zIndex = '-1';
|
|
19027
|
+
document.body.appendChild(detector);
|
|
19028
|
+
const dvhInPx = detector.clientHeight;
|
|
19029
|
+
document.body.removeChild(detector);
|
|
19030
|
+
return dvhInPx;
|
|
19031
|
+
};
|
|
19032
|
+
const getFillAvailableInPx = () => {
|
|
19033
|
+
const detector = document.createElement('div');
|
|
19034
|
+
detector.style.position = 'fixed';
|
|
19035
|
+
detector.style.bottom = `${getHeightWithSafeArea()}px`;
|
|
19036
|
+
detector.style.left = '0';
|
|
19037
|
+
detector.style.height = '-webkit-fill-available';
|
|
19038
|
+
detector.style.visibility = 'hidden';
|
|
19039
|
+
detector.style.zIndex = '-1';
|
|
19040
|
+
document.body.appendChild(detector);
|
|
19041
|
+
const dvhInPx = detector.clientHeight;
|
|
19042
|
+
document.body.removeChild(detector);
|
|
19043
|
+
return dvhInPx;
|
|
19044
|
+
};
|
|
19045
|
+
const getHeightWithSafeArea = () => {
|
|
19046
|
+
const root = document.documentElement;
|
|
19047
|
+
const value = getComputedStyle(root).getPropertyValue('--safe-area-inset-bottom');
|
|
19048
|
+
// 处理可能的值(可能是 '0px', '34px' 等)
|
|
19049
|
+
const numericValue = parseInt(value) || 0;
|
|
19050
|
+
return numericValue;
|
|
19051
|
+
};
|
|
19052
|
+
const dvhToPx = (dvh) => {
|
|
19053
|
+
return Math.round((dvh / 100) * document.documentElement.clientHeight);
|
|
19054
|
+
};
|
|
19055
|
+
const systemInfo = {
|
|
19056
|
+
visualViewport: (_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.height,
|
|
19057
|
+
innerHeight: window.innerHeight,
|
|
19058
|
+
clientHeight: document.documentElement.clientHeight,
|
|
19059
|
+
screenHeight: window.screen.height,
|
|
19060
|
+
bodyHeight: (_b = document === null || document === void 0 ? void 0 : document.body) === null || _b === void 0 ? void 0 : _b.clientHeight,
|
|
19061
|
+
agent: navigator.userAgent,
|
|
19062
|
+
version: '1.19.14',
|
|
19063
|
+
safeArea: getHeightWithSafeArea(),
|
|
19064
|
+
dvh: dvhToPx(100),
|
|
19065
|
+
dvhInPx: getDvhInPx(),
|
|
19066
|
+
vhInPx: getVhInPx(),
|
|
19067
|
+
fillAvailableInPx: getFillAvailableInPx()
|
|
19068
|
+
};
|
|
19069
|
+
console.log(systemInfo, 'fundebug-init--------------------->systemInfo');
|
|
19070
|
+
if ('fundebug' in window) {
|
|
19071
|
+
window === null || window === void 0 ? void 0 : window.fundebug.notify('Collect_Info', 'init', { metaData: { systemInfo, otherInfo: {} } });
|
|
19072
|
+
}
|
|
19005
19073
|
const updateHeight = React.useCallback(() => {
|
|
19006
|
-
var _a;
|
|
19007
|
-
const
|
|
19074
|
+
var _a, _b, _c;
|
|
19075
|
+
const systemInfo = {
|
|
19076
|
+
visualViewport: (_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.height,
|
|
19077
|
+
innerHeight: window.innerHeight,
|
|
19078
|
+
clientHeight: document.documentElement.clientHeight,
|
|
19079
|
+
screenHeight: window.screen.height,
|
|
19080
|
+
bodyHeight: (_b = document === null || document === void 0 ? void 0 : document.body) === null || _b === void 0 ? void 0 : _b.clientHeight,
|
|
19081
|
+
agent: navigator.userAgent,
|
|
19082
|
+
version: '1.19.15',
|
|
19083
|
+
safeArea: getHeightWithSafeArea(),
|
|
19084
|
+
dvh: dvhToPx(100),
|
|
19085
|
+
dvhInPx: getDvhInPx(),
|
|
19086
|
+
vhInPx: getVhInPx(),
|
|
19087
|
+
fillAvailableInPx: getFillAvailableInPx()
|
|
19088
|
+
};
|
|
19089
|
+
console.log(systemInfo, 'fundebug-resize--------------------->systemInfo');
|
|
19090
|
+
if ('fundebug' in window) {
|
|
19091
|
+
window === null || window === void 0 ? void 0 : window.fundebug.notify('Collect_Info', 'resize', { metaData: { systemInfo, otherInfo: {} } });
|
|
19092
|
+
}
|
|
19093
|
+
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);
|
|
19008
19094
|
setVisibleHeight(height);
|
|
19009
|
-
}, []);
|
|
19095
|
+
}, [getHeightWithSafeArea, dvhToPx, getDvhInPx, getVhInPx, getFillAvailableInPx]);
|
|
19010
19096
|
React.useEffect(() => {
|
|
19011
19097
|
// 初始计算
|
|
19012
19098
|
updateHeight();
|
|
@@ -19247,24 +19333,22 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
|
19247
19333
|
const numericValue = parseInt(value) || 0;
|
|
19248
19334
|
return numericValue;
|
|
19249
19335
|
};
|
|
19250
|
-
const
|
|
19251
|
-
// 获取窗口高度
|
|
19252
|
-
// 动态检测安全区域
|
|
19336
|
+
const getDvhInPx = () => {
|
|
19253
19337
|
const detector = document.createElement('div');
|
|
19254
19338
|
detector.style.position = 'fixed';
|
|
19255
|
-
detector.style.bottom =
|
|
19339
|
+
detector.style.bottom = `${getHeightWithSafeArea()}px`;
|
|
19256
19340
|
detector.style.left = '0';
|
|
19257
|
-
detector.style.
|
|
19341
|
+
detector.style.height = '100dvh';
|
|
19258
19342
|
detector.style.visibility = 'hidden';
|
|
19343
|
+
detector.style.zIndex = '-1';
|
|
19259
19344
|
document.body.appendChild(detector);
|
|
19260
|
-
const
|
|
19261
|
-
const safeAreaBottom = parseFloat(computedStyle.paddingBottom) || 0;
|
|
19345
|
+
const dvhInPx = detector.clientHeight;
|
|
19262
19346
|
document.body.removeChild(detector);
|
|
19263
|
-
return
|
|
19347
|
+
return dvhInPx;
|
|
19264
19348
|
};
|
|
19265
19349
|
const height = React.useMemo(() => {
|
|
19266
|
-
return
|
|
19267
|
-
}, [minusHeight, visibleHeight, tagHeight,
|
|
19350
|
+
return getDvhInPx() - minusHeight - tagHeight - getHeightWithSafeArea();
|
|
19351
|
+
}, [minusHeight, visibleHeight, tagHeight, getHeightWithSafeArea, containerHeight, getDvhInPx]);
|
|
19268
19352
|
const visList = React.useMemo(() => {
|
|
19269
19353
|
var _a;
|
|
19270
19354
|
const list = activeIndex === 0 && !waterFallData && !isEditor && !isDiyH5
|
|
@@ -19747,10 +19831,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
|
19747
19831
|
renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
|
|
19748
19832
|
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)),
|
|
19749
19833
|
React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
|
|
19750
|
-
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: '
|
|
19834
|
+
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)' } }))))),
|
|
19751
19835
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting) && (React.createElement("div", { style: {
|
|
19752
19836
|
position: 'fixed',
|
|
19753
|
-
bottom: '
|
|
19837
|
+
bottom: 'var(--safe-area-inset-bottom,0px)',
|
|
19754
19838
|
left: 0,
|
|
19755
19839
|
right: 0,
|
|
19756
19840
|
width: '100%',
|