pb-sxp-ui 1.19.13 → 1.19.14
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 +92 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +4 -3
- package/dist/index.js +92 -22
- 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 +95 -26
- 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 +4 -17
- package/es/core/hooks/useVisibleHeight.js +87 -3
- package/lib/core/components/SxpPageRender/index.js +4 -17
- package/lib/core/hooks/useVisibleHeight.js +88 -3
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -10,6 +10,7 @@ var qs = require('qs');
|
|
|
10
10
|
var EventEmitter = require('eventemitter3');
|
|
11
11
|
var css = require('@emotion/css');
|
|
12
12
|
var ReactDOM = require('react-dom');
|
|
13
|
+
var fundebug = require('fundebug-javascript');
|
|
13
14
|
|
|
14
15
|
function _interopNamespaceDefault(e) {
|
|
15
16
|
var n = Object.create(null);
|
|
@@ -19000,13 +19001,97 @@ const NavBack = ({ data, minusHeight, tagHeight, onClick }) => {
|
|
|
19000
19001
|
};
|
|
19001
19002
|
var NavBack$1 = React.memo(NavBack);
|
|
19002
19003
|
|
|
19004
|
+
if (fundebug)
|
|
19005
|
+
fundebug.apikey = '522a79b0a6242a8ad683cc045ec9e65bbac3a0f620561ac49d39eaad4f303618';
|
|
19003
19006
|
const useVisibleHeight = () => {
|
|
19007
|
+
var _a, _b;
|
|
19004
19008
|
const [visibleHeight, setVisibleHeight] = React.useState(0);
|
|
19009
|
+
const getDvhInPx = () => {
|
|
19010
|
+
const detector = document.createElement('div');
|
|
19011
|
+
detector.style.position = 'fixed';
|
|
19012
|
+
detector.style.bottom = `${getHeightWithSafeArea()}px`;
|
|
19013
|
+
detector.style.left = '0';
|
|
19014
|
+
detector.style.height = '100dvh';
|
|
19015
|
+
detector.style.visibility = 'hidden';
|
|
19016
|
+
detector.style.zIndex = '-1';
|
|
19017
|
+
document.body.appendChild(detector);
|
|
19018
|
+
const dvhInPx = detector.clientHeight;
|
|
19019
|
+
document.body.removeChild(detector);
|
|
19020
|
+
return dvhInPx;
|
|
19021
|
+
};
|
|
19022
|
+
const getVhInPx = () => {
|
|
19023
|
+
const detector = document.createElement('div');
|
|
19024
|
+
detector.style.position = 'fixed';
|
|
19025
|
+
detector.style.bottom = `${getHeightWithSafeArea()}px`;
|
|
19026
|
+
detector.style.left = '0';
|
|
19027
|
+
detector.style.height = '100vh';
|
|
19028
|
+
detector.style.visibility = 'hidden';
|
|
19029
|
+
detector.style.zIndex = '-1';
|
|
19030
|
+
document.body.appendChild(detector);
|
|
19031
|
+
const dvhInPx = detector.clientHeight;
|
|
19032
|
+
document.body.removeChild(detector);
|
|
19033
|
+
return dvhInPx;
|
|
19034
|
+
};
|
|
19035
|
+
const getFillAvailableInPx = () => {
|
|
19036
|
+
const detector = document.createElement('div');
|
|
19037
|
+
detector.style.position = 'fixed';
|
|
19038
|
+
detector.style.bottom = `${getHeightWithSafeArea()}px`;
|
|
19039
|
+
detector.style.left = '0';
|
|
19040
|
+
detector.style.height = '-webkit-fill-available';
|
|
19041
|
+
detector.style.visibility = 'hidden';
|
|
19042
|
+
detector.style.zIndex = '-1';
|
|
19043
|
+
document.body.appendChild(detector);
|
|
19044
|
+
const dvhInPx = detector.clientHeight;
|
|
19045
|
+
document.body.removeChild(detector);
|
|
19046
|
+
return dvhInPx;
|
|
19047
|
+
};
|
|
19048
|
+
const getHeightWithSafeArea = () => {
|
|
19049
|
+
const root = document.documentElement;
|
|
19050
|
+
const value = getComputedStyle(root).getPropertyValue('--safe-area-inset-bottom');
|
|
19051
|
+
// 处理可能的值(可能是 '0px', '34px' 等)
|
|
19052
|
+
const numericValue = parseInt(value) || 0;
|
|
19053
|
+
return numericValue;
|
|
19054
|
+
};
|
|
19055
|
+
const dvhToPx = (dvh) => {
|
|
19056
|
+
return Math.round((dvh / 100) * document.documentElement.clientHeight);
|
|
19057
|
+
};
|
|
19058
|
+
const systemInfo = {
|
|
19059
|
+
visualViewport: (_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.height,
|
|
19060
|
+
innerHeight: window.innerHeight,
|
|
19061
|
+
clientHeight: document.documentElement.clientHeight,
|
|
19062
|
+
screenHeight: window.screen.height,
|
|
19063
|
+
bodyHeight: (_b = document === null || document === void 0 ? void 0 : document.body) === null || _b === void 0 ? void 0 : _b.clientHeight,
|
|
19064
|
+
agent: navigator.userAgent,
|
|
19065
|
+
version: '1.19.14',
|
|
19066
|
+
safeArea: getHeightWithSafeArea(),
|
|
19067
|
+
dvh: dvhToPx(100),
|
|
19068
|
+
dvhInPx: getDvhInPx(),
|
|
19069
|
+
vhInPx: getVhInPx(),
|
|
19070
|
+
fillAvailableInPx: getFillAvailableInPx()
|
|
19071
|
+
};
|
|
19072
|
+
console.log(systemInfo, 'fundebug-init--------------------->systemInfo');
|
|
19073
|
+
fundebug.notify('Collect_Info', 'init', { metaData: { systemInfo, otherInfo: {} } });
|
|
19005
19074
|
const updateHeight = React.useCallback(() => {
|
|
19006
|
-
var _a;
|
|
19007
|
-
const
|
|
19075
|
+
var _a, _b, _c;
|
|
19076
|
+
const systemInfo = {
|
|
19077
|
+
visualViewport: (_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.height,
|
|
19078
|
+
innerHeight: window.innerHeight,
|
|
19079
|
+
clientHeight: document.documentElement.clientHeight,
|
|
19080
|
+
screenHeight: window.screen.height,
|
|
19081
|
+
bodyHeight: (_b = document === null || document === void 0 ? void 0 : document.body) === null || _b === void 0 ? void 0 : _b.clientHeight,
|
|
19082
|
+
agent: navigator.userAgent,
|
|
19083
|
+
version: '1.19.14',
|
|
19084
|
+
safeArea: getHeightWithSafeArea(),
|
|
19085
|
+
dvh: dvhToPx(100),
|
|
19086
|
+
dvhInPx: getDvhInPx(),
|
|
19087
|
+
vhInPx: getVhInPx(),
|
|
19088
|
+
fillAvailableInPx: getFillAvailableInPx()
|
|
19089
|
+
};
|
|
19090
|
+
console.log(systemInfo, 'fundebug-resize--------------------->systemInfo');
|
|
19091
|
+
fundebug.notify('Collect_Info', 'resize', { metaData: { systemInfo, otherInfo: {} } });
|
|
19092
|
+
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
19093
|
setVisibleHeight(height);
|
|
19009
|
-
}, []);
|
|
19094
|
+
}, [getHeightWithSafeArea, dvhToPx, getDvhInPx, getVhInPx, getFillAvailableInPx]);
|
|
19010
19095
|
React.useEffect(() => {
|
|
19011
19096
|
// 初始计算
|
|
19012
19097
|
updateHeight();
|
|
@@ -19247,24 +19332,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
|
19247
19332
|
const numericValue = parseInt(value) || 0;
|
|
19248
19333
|
return numericValue;
|
|
19249
19334
|
};
|
|
19250
|
-
const getHeightWithSafeArea2 = () => {
|
|
19251
|
-
// 获取窗口高度
|
|
19252
|
-
// 动态检测安全区域
|
|
19253
|
-
const detector = document.createElement('div');
|
|
19254
|
-
detector.style.position = 'fixed';
|
|
19255
|
-
detector.style.bottom = '0';
|
|
19256
|
-
detector.style.left = '0';
|
|
19257
|
-
detector.style.paddingBottom = 'env(safe-area-inset-bottom)';
|
|
19258
|
-
detector.style.visibility = 'hidden';
|
|
19259
|
-
document.body.appendChild(detector);
|
|
19260
|
-
const computedStyle = window.getComputedStyle(detector);
|
|
19261
|
-
const safeAreaBottom = parseFloat(computedStyle.paddingBottom) || 0;
|
|
19262
|
-
document.body.removeChild(detector);
|
|
19263
|
-
return safeAreaBottom;
|
|
19264
|
-
};
|
|
19265
19335
|
const height = React.useMemo(() => {
|
|
19266
|
-
return visibleHeight - minusHeight - tagHeight -
|
|
19267
|
-
}, [minusHeight, visibleHeight, tagHeight,
|
|
19336
|
+
return visibleHeight - minusHeight - tagHeight - getHeightWithSafeArea();
|
|
19337
|
+
}, [minusHeight, visibleHeight, tagHeight, getHeightWithSafeArea, containerHeight]);
|
|
19268
19338
|
const visList = React.useMemo(() => {
|
|
19269
19339
|
var _a;
|
|
19270
19340
|
const list = activeIndex === 0 && !waterFallData && !isEditor && !isDiyH5
|
|
@@ -19747,10 +19817,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
|
19747
19817
|
renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
|
|
19748
19818
|
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
19819
|
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: '
|
|
19820
|
+
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
19821
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting) && (React.createElement("div", { style: {
|
|
19752
19822
|
position: 'fixed',
|
|
19753
|
-
bottom: '
|
|
19823
|
+
bottom: 'var(--safe-area-inset-bottom,0px)',
|
|
19754
19824
|
left: 0,
|
|
19755
19825
|
right: 0,
|
|
19756
19826
|
width: '100%',
|