@ray-js/ipc-player-integration 0.0.50-beta.0 → 0.0.50-beta.1

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,7 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ComponentConfig, UseCtx, WidgetId } from '../../interface';
3
3
  import { FullScreen } from '../../widgets';
4
- import type { ZoomSkill } from '../../widgets/zoomTurntable/lensSkill';
5
4
  type Ctx = ReturnType<UseCtx>;
6
5
  export type InitPlayerWidgetsOptions = {
7
6
  verticalResolutionCustomClick?: boolean;
@@ -18,8 +17,6 @@ export type InitPlayerWidgetsOptions = {
18
17
  * 仅为功能开关;实际渲染还要 ipc_multi_zoom 解析出 cnt > 1,单镜头设备传 true 也不出现。
19
18
  */
20
19
  showZoomTurntable?: boolean;
21
- /** 调试用:直接注入镜头能力(ZoomSkill),跳过 ipc_multi_zoom DP 解析 */
22
- mockZoomSkill?: ZoomSkill | boolean;
23
20
  directionControlProps?: Partial<React.ComponentProps<typeof FullScreen>['directionControlProps']>;
24
21
  hideSmartImageQualityState?: boolean;
25
22
  topLeftContent?: ComponentConfig[];
@@ -60,8 +60,7 @@ export async function initPlayerWidgets(ctx, options) {
60
60
  newDefaultBottomLeftContent[zoomTurntableIndex].hidden = false;
61
61
  // @ts-ignore
62
62
  newDefaultBottomLeftContent[zoomTurntableIndex].initProps = {
63
- showZoomTurntable: true,
64
- mockZoomSkill: options.mockZoomSkill
63
+ showZoomTurntable: true
65
64
  };
66
65
  }
67
66
  }
@@ -97,7 +97,7 @@ describe('ipc_multi_zoom 上报值解析', () => {
97
97
  });
98
98
  expect(zoomBounds(skill)).toEqual([1, 6]);
99
99
  });
100
- it('对象值直接透传(调试注入 mockZoomSkill)', () => {
100
+ it('对象值直接透传(内部 mock 常量)', () => {
101
101
  expect(parseZoomSkill(DOUBLE)).toBe(DOUBLE);
102
102
  });
103
103
  it('空值 / 畸形 JSON 返回 null,不抛错', () => {
@@ -53,7 +53,7 @@ export declare const lensCount: (skill?: ZoomSkill | null) => number;
53
53
  export declare const isZoomSkillValid: (skill?: ZoomSkill | null) => boolean;
54
54
  /**
55
55
  * 解析 ipc_multi_zoom DP 上报的 string 值为镜头能力。
56
- * @param value DP 值;调试注入的对象(mockZoomSkill)直接透传,两条来源共用同一校验链路
56
+ * @param value DP 值;内部 mock 常量是对象、DP 上报是 string,两条来源共用同一校验链路
57
57
  */
58
58
  export declare const parseZoomSkill: (value?: unknown) => ZoomSkill | null;
59
59
  /**
@@ -90,7 +90,7 @@ export const isZoomSkillValid = skill => {
90
90
 
91
91
  /**
92
92
  * 解析 ipc_multi_zoom DP 上报的 string 值为镜头能力。
93
- * @param value DP 值;调试注入的对象(mockZoomSkill)直接透传,两条来源共用同一校验链路
93
+ * @param value DP 值;内部 mock 常量是对象、DP 上报是 string,两条来源共用同一校验链路
94
94
  */
95
95
  export const parseZoomSkill = value => {
96
96
  if (value == null || value === '') return null;
@@ -1,10 +1,7 @@
1
1
  import { ComponentConfigProps } from '../../interface';
2
- import { ZoomSkill } from './lensSkill';
3
2
  type Options = ComponentConfigProps & {
4
3
  /** 业务侧的功能开关;实际是否渲染仍由 ipc_multi_zoom 解析出的 cnt 决定 */
5
4
  showZoomTurntable?: boolean;
6
- /** 调试用:直接注入镜头能力,跳过 ipc_multi_zoom DP 解析 */
7
- mockZoomSkill?: ZoomSkill | boolean;
8
5
  /** 跳过能力加载:Entry 常驻负责加载,Dock 作为消费方传 true 避免重复解析 */
9
6
  skipLoad?: boolean;
10
7
  };
@@ -15,7 +12,7 @@ type Options = ComponentConfigProps & {
15
12
  export declare const useLensZoom: (options: Options) => {
16
13
  /** 是否具备多镜头变焦能力(不具备则整个 widget 不出现) */
17
14
  multiLensReady: boolean;
18
- zoomSkill: ZoomSkill | null;
15
+ zoomSkill: import("./lensSkill").ZoomSkill | null;
19
16
  /** 镜头列表(按 value 升序),用于渲染倍率 tab */
20
17
  lenses: import("./lensSkill").Lens[];
21
18
  lensIndex: number;
@@ -7,6 +7,14 @@ import { setScaleMultipleEvent, zoomLevelChange } from '../../ui/constant';
7
7
  import { MOCK_ZOOM_SKILL, MULTI_ZOOM_DP_CODE, dumpChannelApis, isChannelChangeSupported, isZoomSkillValid, lensCount, parseZoomSkill, queryCurrentLens, showSmallMonitor, subscribeChannelChange, switchLens } from './lensSkill';
8
8
  import { DEFAULT_STEP, D_MIN, buildMarks, buildTickValues, indexOfLensId, matchLens, maxScaleMultiple, toDisplayZoom, toScaleMultiple, zoomBounds } from './lensModel';
9
9
  import { CHANNEL_SETTLE_TIMEOUT, D_MATCH_EPS, GESTURE_SWITCH_DEBOUNCE, SWITCH_LENS_TIMEOUT, zoomTurntableLensChange, zoomTurntableZoomChange } from './constants';
10
+ /**
11
+ * 内部调试开关:置 true 时用 MOCK_ZOOM_SKILL 顶替 ipc_multi_zoom 的上报值。
12
+ *
13
+ * 只在没有该 DP 的设备上自测转盘时临时打开,**提交前必须回到 false**。
14
+ * 不做成 props:mock 是组件内部的调试手段,不该出现在对外 API 上。
15
+ */
16
+ const USE_MOCK_ZOOM_SKILL = false;
17
+
10
18
  /**
11
19
  * 最近一次的本地数字缩放 d,按 devId 记录。
12
20
  * 放模块级:Dock 动态挂载/卸载,组件内 ref 存不住,但它只是派生中间量,不值得占一个 atom。
@@ -57,7 +65,6 @@ export const useLensZoom = options => {
57
65
  devId,
58
66
  event,
59
67
  showZoomTurntable = false,
60
- mockZoomSkill,
61
68
  skipLoad = false,
62
69
  setZoomSkill,
63
70
  setZoomLensIndex,
@@ -94,12 +101,8 @@ export const useLensZoom = options => {
94
101
  // ---------------- 能力加载 ----------------
95
102
  useEffect(() => {
96
103
  if (skipLoad || !devId || !showZoomTurntable) return undefined;
97
-
98
- // mockZoomSkill 接管 DP 值:没有 ipc_multi_zoom 的设备上入口出不来,无法自测
99
- if (mockZoomSkill) {
100
- console.log('[zoomTurntable] mock 模式:跳过 ipc_multi_zoom DP 解析');
101
- }
102
- const raw = mockZoomSkill === true ? MOCK_ZOOM_SKILL : mockZoomSkill || multiZoomDpValue;
104
+ const raw = multiZoomDpValue;
105
+ console.log('[zoomTurntable] ipc_multi_zoom 上报值', JSON.stringify(raw !== null && raw !== void 0 ? raw : null));
103
106
  const skill = parseZoomSkill(raw);
104
107
  if (!isZoomSkillValid(skill)) {
105
108
  // DP 未上报 / 值畸形 / 单镜头设备:能力不可用,入口不出现
@@ -108,7 +111,7 @@ export const useLensZoom = options => {
108
111
  }
109
112
  setZoomSkill(skill);
110
113
  return undefined;
111
- }, [devId, showZoomTurntable, mockZoomSkill, multiZoomDpValue, skipLoad]);
114
+ }, [devId, showZoomTurntable, multiZoomDpValue, skipLoad]);
112
115
 
113
116
  /** 多镜头能力就绪:ipc_multi_zoom 解析出的 cnt > 1(单镜头设备不出现) */
114
117
  const multiLensReady = showZoomTurntable && lensCount(zoomSkill) > 1;
@@ -1,13 +1,10 @@
1
1
  import React from 'react';
2
2
  import { ComponentConfigProps } from '../../interface';
3
- import { ZoomSkill } from './lensSkill';
4
3
  import './zoomTurntableEntry.less';
5
4
  type Props = ComponentConfigProps & {
6
5
  className?: string;
7
6
  /** 业务侧的功能开关;实际是否渲染仍由 ipc_multi_zoom 解析出的 cnt 决定 */
8
7
  showZoomTurntable?: boolean;
9
- /** 调试用:直接注入镜头能力,跳过 ipc_multi_zoom DP 解析 */
10
- mockZoomSkill?: ZoomSkill | boolean;
11
8
  /** 长按判定时长,默认 500ms */
12
9
  longPressDuration?: number;
13
10
  /** 关闭圈选引导 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.50-beta.0",
3
+ "version": "0.0.50-beta.1",
4
4
  "description": "IPC 融合播放器",
5
5
  "main": "lib/index",
6
6
  "files": [