@ray-js/ipc-player-integration 0.0.49-beta.3 → 0.0.49-beta.4

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.
@@ -1,11 +1,12 @@
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, { useEffect, useMemo, useRef, useState } from 'react';
4
+ import React, { useContext, 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';
9
10
  import { TrialBadge, useTrialBadge } from '../widgets/trialBadge';
10
11
  import { pauseTimeToHideAllComponent, startTimeToHideAllComponent } from './constant';
11
12
 
@@ -59,6 +60,11 @@ const BottomLeftContent = _ref => {
59
60
  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;
60
61
  }, [bottomLeftContent]);
61
62
  const [shouldHide] = useComponentHideState();
63
+ // 透明隐藏只跟随真实隐藏态:refreshElement 重测脉冲仍走 shouldHide 驱动 ±1px 高度,
64
+ // 但不应把工具栏短暂隐掉,否则缩起/展开等触发重测时会肉眼可见地闪一下
65
+ const {
66
+ componentHideState
67
+ } = useContext(UIEventContext);
62
68
  const {
63
69
  showTrialBadge,
64
70
  handleTrialSubscribe,
@@ -231,8 +237,8 @@ const BottomLeftContent = _ref => {
231
237
  display: 'flex',
232
238
  flexDirection: 'column',
233
239
  justifyContent: 'flex-start',
234
- opacity: shouldHide ? 0 : 1,
235
- pointerEvents: shouldHide ? 'none' : 'auto'
240
+ opacity: componentHideState ? 0 : 1,
241
+ pointerEvents: componentHideState ? 'none' : 'auto'
236
242
  }
237
243
  }, showBadge && /*#__PURE__*/React.createElement(View, {
238
244
  style: {
package/lib/ui/ui.js CHANGED
@@ -434,6 +434,18 @@ 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
+
437
449
  // 竖屏全屏副作用处理
438
450
  useEffect(() => {
439
451
  if (isVerticalFullLayout && screenType === 'vertical') {
@@ -909,7 +921,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
909
921
  value: {
910
922
  event: eventRef.current,
911
923
  componentHideState,
912
- refreshElement
924
+ refreshElement: refreshElement || regionRefresh
913
925
  }
914
926
  }, /*#__PURE__*/React.createElement(View, {
915
927
  className: clsx('ipc-player-content', isSmallScreen && 'ipc-player-content-small-screen', className),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.49-beta.3",
3
+ "version": "0.0.49-beta.4",
4
4
  "description": "IPC 融合播放器",
5
5
  "main": "lib/index",
6
6
  "files": [