@ray-js/ipc-player-integration 0.0.49-beta.4 → 0.0.49
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/lib/ui/bottomLeftContent.js +3 -9
- package/lib/ui/ui.js +1 -13
- package/package.json +1 -1
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
3
3
|
import "core-js/modules/esnext.iterator.find.js";
|
|
4
|
-
import React, {
|
|
4
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
5
5
|
import { CoverView, ScrollView, View } from '@ray-js/ray';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { useStore } from '../ctx/store';
|
|
8
8
|
import { useComponentHideState } from './hooks';
|
|
9
|
-
import { UIEventContext } from './context';
|
|
10
9
|
import { TrialBadge, useTrialBadge } from '../widgets/trialBadge';
|
|
11
10
|
import { pauseTimeToHideAllComponent, startTimeToHideAllComponent } from './constant';
|
|
12
11
|
|
|
@@ -60,11 +59,6 @@ const BottomLeftContent = _ref => {
|
|
|
60
59
|
return (_gRawData = tryExp === null || tryExp === void 0 || (_tryExp$initProps5 = tryExp.initProps) === null || _tryExp$initProps5 === void 0 ? void 0 : _tryExp$initProps5.gRawData) !== null && _gRawData !== void 0 ? _gRawData : false;
|
|
61
60
|
}, [bottomLeftContent]);
|
|
62
61
|
const [shouldHide] = useComponentHideState();
|
|
63
|
-
// 透明隐藏只跟随真实隐藏态:refreshElement 重测脉冲仍走 shouldHide 驱动 ±1px 高度,
|
|
64
|
-
// 但不应把工具栏短暂隐掉,否则缩起/展开等触发重测时会肉眼可见地闪一下
|
|
65
|
-
const {
|
|
66
|
-
componentHideState
|
|
67
|
-
} = useContext(UIEventContext);
|
|
68
62
|
const {
|
|
69
63
|
showTrialBadge,
|
|
70
64
|
handleTrialSubscribe,
|
|
@@ -237,8 +231,8 @@ const BottomLeftContent = _ref => {
|
|
|
237
231
|
display: 'flex',
|
|
238
232
|
flexDirection: 'column',
|
|
239
233
|
justifyContent: 'flex-start',
|
|
240
|
-
opacity:
|
|
241
|
-
pointerEvents:
|
|
234
|
+
opacity: shouldHide ? 0 : 1,
|
|
235
|
+
pointerEvents: shouldHide ? 'none' : 'auto'
|
|
242
236
|
}
|
|
243
237
|
}, showBadge && /*#__PURE__*/React.createElement(View, {
|
|
244
238
|
style: {
|
package/lib/ui/ui.js
CHANGED
|
@@ -434,18 +434,6 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
434
434
|
};
|
|
435
435
|
}, [handDisablePlayerTap]);
|
|
436
436
|
|
|
437
|
-
// 缩起/展开后四角 CoverView 的原生热区不随布局高度变化重测,停留在旧位置吞掉点击(首次缩起必现);
|
|
438
|
-
// 复用 refreshElement 通道翻转各 wrap 的 ±1px 重排跟位。120ms:iOS 原生异步测量 50ms 内可能不落盘。
|
|
439
|
-
const [regionRefresh, setRegionRefresh] = useState(false);
|
|
440
|
-
useEffect(() => {
|
|
441
|
-
// 仅竖屏下发:缩起/展开只存在于竖屏;旋转进横屏也会翻转 isVerticalFullLayout,
|
|
442
|
-
// 脉冲会打断横屏 widget(ptz/对讲等)0.3s 出入场动画。从 store 同步读,避开 React 提交顺序竞态
|
|
443
|
-
if (getDefaultStore().get(instance.screenType) !== 'vertical') return undefined;
|
|
444
|
-
setRegionRefresh(true);
|
|
445
|
-
const nudgeTimer = setTimeout(() => setRegionRefresh(false), 120);
|
|
446
|
-
return () => clearTimeout(nudgeTimer);
|
|
447
|
-
}, [isVerticalFullLayout]);
|
|
448
|
-
|
|
449
437
|
// 竖屏全屏副作用处理
|
|
450
438
|
useEffect(() => {
|
|
451
439
|
if (isVerticalFullLayout && screenType === 'vertical') {
|
|
@@ -921,7 +909,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
921
909
|
value: {
|
|
922
910
|
event: eventRef.current,
|
|
923
911
|
componentHideState,
|
|
924
|
-
refreshElement
|
|
912
|
+
refreshElement
|
|
925
913
|
}
|
|
926
914
|
}, /*#__PURE__*/React.createElement(View, {
|
|
927
915
|
className: clsx('ipc-player-content', isSmallScreen && 'ipc-player-content-small-screen', className),
|