@ray-js/ipc-player-integration 0.0.67-beta.2 → 0.0.68-beta.0

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.
Files changed (149) hide show
  1. package/README.md +6 -0
  2. package/lib/ctx/ctx.composition.js +3 -13
  3. package/lib/ctx/ctx.js +35 -48
  4. package/lib/ctx/multiCameraCtx.d.ts +0 -2
  5. package/lib/ctx/multiCameraCtx.js +1 -17
  6. package/lib/i18n/index.d.ts +0 -12
  7. package/lib/i18n/strings.d.ts +0 -6
  8. package/lib/i18n/strings.js +0 -6
  9. package/lib/index.d.ts +4 -0
  10. package/lib/index.js +3 -1
  11. package/lib/interface.d.ts +3 -18
  12. package/lib/renderer/capabilities.d.ts +8 -0
  13. package/lib/renderer/capabilities.js +19 -0
  14. package/lib/renderer/context.d.ts +5 -0
  15. package/lib/renderer/context.js +6 -0
  16. package/lib/renderer/directionControl.d.ts +6 -0
  17. package/lib/renderer/directionControl.js +3 -0
  18. package/lib/renderer/font-manifest.json +9 -0
  19. package/lib/renderer/font.less +5 -0
  20. package/lib/renderer/glyphs.d.ts +1 -0
  21. package/lib/renderer/glyphs.js +256 -0
  22. package/lib/renderer/index.module.less +48 -0
  23. package/lib/renderer/overlay.d.ts +4 -0
  24. package/lib/renderer/overlay.js +6 -0
  25. package/lib/renderer/ptzZoom.d.ts +6 -0
  26. package/lib/renderer/ptzZoom.js +3 -0
  27. package/lib/renderer/text.d.ts +4 -0
  28. package/lib/renderer/text.js +32 -0
  29. package/lib/renderer/text.module.less +4 -0
  30. package/lib/renderer/viewport.d.ts +7 -0
  31. package/lib/renderer/viewport.js +24 -0
  32. package/lib/res/lynx-signal/index.d.ts +1 -0
  33. package/lib/res/lynx-signal/index.js +22 -0
  34. package/lib/res/lynx-signal/signalFour0.png +0 -0
  35. package/lib/res/lynx-signal/signalFour1.png +0 -0
  36. package/lib/res/lynx-signal/signalFour2.png +0 -0
  37. package/lib/res/lynx-signal/signalFour3.png +0 -0
  38. package/lib/res/lynx-signal/signalFour4.png +0 -0
  39. package/lib/res/lynx-signal/signalThree0.png +0 -0
  40. package/lib/res/lynx-signal/signalThree1.png +0 -0
  41. package/lib/res/lynx-signal/signalThree2.png +0 -0
  42. package/lib/res/lynx-signal/signalThree3.png +0 -0
  43. package/lib/res/player-charging.png +0 -0
  44. package/lib/res/player-more-arrow.png +0 -0
  45. package/lib/res/player-solar.png +0 -0
  46. package/lib/ui/bottomLeftContent.js +122 -56
  47. package/lib/ui/bottomRightContent.js +10 -5
  48. package/lib/ui/scrollHintArrow.d.ts +23 -0
  49. package/lib/ui/scrollHintArrow.js +83 -0
  50. package/lib/ui/topLeftContent.js +4 -2
  51. package/lib/ui/topRightContent.js +4 -2
  52. package/lib/ui/ui.d.ts +5 -0
  53. package/lib/ui/ui.js +93 -100
  54. package/lib/utils/navigation.d.ts +1 -2
  55. package/lib/utils/navigation.js +3 -13
  56. package/lib/widgets/battery/battery.js +7 -5
  57. package/lib/widgets/battery/batteryFull.js +7 -5
  58. package/lib/widgets/battery/statusIcon.d.ts +6 -0
  59. package/lib/widgets/battery/statusIcon.js +36 -0
  60. package/lib/widgets/battery/statusIcon.less +24 -0
  61. package/lib/widgets/captureToast/captureToast.d.ts +9 -0
  62. package/lib/widgets/captureToast/captureToast.js +73 -0
  63. package/lib/widgets/floodlight/floodlight.js +2 -1
  64. package/lib/widgets/flowLowTip/flowLowTip.js +2 -1
  65. package/lib/widgets/fullScreen/fullScreen.js +44 -31
  66. package/lib/widgets/fullScreen/fullTravelRouteControl.d.ts +2 -2
  67. package/lib/widgets/fullScreen/fullTravelRouteControl.js +3 -6
  68. package/lib/widgets/fullScreen/verticalScreen.js +2 -1
  69. package/lib/widgets/index.d.ts +0 -1
  70. package/lib/widgets/index.js +1 -2
  71. package/lib/widgets/moveInteractiveControl/controlButton.js +2 -1
  72. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.js +16 -5
  73. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.less +24 -4
  74. package/lib/widgets/multiCamera/index.less +0 -1
  75. package/lib/widgets/multiCamera/landscapeTip.js +5 -2
  76. package/lib/widgets/multiCamera/moveablePtzControl.js +9 -7
  77. package/lib/widgets/multiCamera/multiPtz.js +3 -2
  78. package/lib/widgets/multiCamera/ptzMoveableTip.js +5 -2
  79. package/lib/widgets/multiCamera/switchLayout.js +2 -1
  80. package/lib/widgets/multiCamera/tileMultiPtz.js +3 -2
  81. package/lib/widgets/multiCamera/tileSwitchLayout.js +2 -1
  82. package/lib/widgets/multiCamera/tileTip.js +5 -2
  83. package/lib/widgets/muted/muted.js +2 -1
  84. package/lib/widgets/muted/muted.test.js +66 -52
  85. package/lib/widgets/ptz/ptz.js +2 -1
  86. package/lib/widgets/ptz/ptzControl.js +4 -3
  87. package/lib/widgets/ptzControlTip/ptzControlTip.js +9 -4
  88. package/lib/widgets/ptzControlTip/ptzControlTip.less +6 -0
  89. package/lib/widgets/realTimeMagnification/realTimeMagnification.js +2 -1
  90. package/lib/widgets/recordVideo/recordVideo.js +32 -178
  91. package/lib/widgets/recordVideo/recordVideo.less +74 -17
  92. package/lib/widgets/recordVideo/recordVideo.test.js +169 -3
  93. package/lib/widgets/recordVideo/recordVideoTimer.d.ts +3 -0
  94. package/lib/widgets/recordVideo/recordVideoTimer.js +26 -0
  95. package/lib/widgets/resolution/fullResolutionControl.js +29 -19
  96. package/lib/widgets/resolution/resolution.js +3 -2
  97. package/lib/widgets/screenshot/screenshot.js +35 -125
  98. package/lib/widgets/screenshot/screenshot.less +40 -1
  99. package/lib/widgets/screenshot/screenshot.test.js +108 -113
  100. package/lib/widgets/signal4G/signal4G.js +4 -1
  101. package/lib/widgets/siren/siren.js +2 -1
  102. package/lib/widgets/tempHumidity/tempHumidity.js +2 -1
  103. package/lib/widgets/toggleVerticalFull/toggleVerticalFull.js +2 -1
  104. package/lib/widgets/trialBadge/index.d.ts +1 -2
  105. package/lib/widgets/trialBadge/index.js +17 -20
  106. package/lib/widgets/trialBadge/index.less +24 -0
  107. package/lib/widgets/trialBadge/useTrialBadge.d.ts +2 -3
  108. package/lib/widgets/trialBadge/useTrialBadge.js +3 -21
  109. package/lib/widgets/tryExperience/tryExperience.js +2 -1
  110. package/lib/widgets/videoBitKBP/videoBitKBP.js +2 -1
  111. package/lib/widgets/voiceIntercom/voiceIntercom.js +50 -24
  112. package/lib/widgets/voiceIntercom/voiceIntercom.less +16 -0
  113. package/lib/widgets/zoomTurntable/lynxDockLayout.d.ts +6 -0
  114. package/lib/widgets/zoomTurntable/lynxDockLayout.js +30 -0
  115. package/lib/widgets/zoomTurntable/turntable/index.d.ts +5 -7
  116. package/lib/widgets/zoomTurntable/turntable/index.js +3 -1
  117. package/lib/widgets/zoomTurntable/turntable/lynx.d.ts +5 -0
  118. package/lib/widgets/zoomTurntable/turntable/lynx.js +273 -0
  119. package/lib/widgets/zoomTurntable/turntable/lynx.less +9 -0
  120. package/lib/widgets/zoomTurntable/turntable/lynxModel.d.ts +37 -0
  121. package/lib/widgets/zoomTurntable/turntable/lynxModel.js +122 -0
  122. package/lib/widgets/zoomTurntable/turntable/lynxPaint.d.ts +3 -0
  123. package/lib/widgets/zoomTurntable/turntable/lynxPaint.js +36 -0
  124. package/lib/widgets/zoomTurntable/zoomTurntableDock.d.ts +5 -3
  125. package/lib/widgets/zoomTurntable/zoomTurntableDock.js +4 -4
  126. package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +32 -19
  127. package/lib/widgets/zoomTurntable/zoomTurntableTip.js +24 -3
  128. package/package.json +15 -7
  129. package/lib/ctx/ctx.album.test.d.ts +0 -1
  130. package/lib/ctx/ctx.album.test.js +0 -197
  131. package/lib/ctx/multiCameraCtx.test.d.ts +0 -1
  132. package/lib/ctx/multiCameraCtx.test.js +0 -65
  133. package/lib/ui/absoluteContent.d.ts +0 -2
  134. package/lib/ui/absoluteContent.js +0 -3
  135. package/lib/utils/captureResult.d.ts +0 -12
  136. package/lib/utils/captureResult.js +0 -70
  137. package/lib/utils/captureResult.test.d.ts +0 -1
  138. package/lib/utils/captureResult.test.js +0 -223
  139. package/lib/utils/fullLinkTracking.d.ts +0 -5
  140. package/lib/utils/fullLinkTracking.js +0 -71
  141. package/lib/widgets/captureResult/captureResult.d.ts +0 -16
  142. package/lib/widgets/captureResult/captureResult.js +0 -85
  143. package/lib/widgets/captureResult/captureResult.less +0 -144
  144. package/lib/widgets/captureResult/captureResult.test.d.ts +0 -1
  145. package/lib/widgets/captureResult/captureResult.test.js +0 -84
  146. package/lib/widgets/captureResult/index.d.ts +0 -2
  147. package/lib/widgets/captureResult/index.js +0 -2
  148. package/lib/widgets/recordVideo/recordVideo.lifecycle.test.d.ts +0 -1
  149. package/lib/widgets/recordVideo/recordVideo.lifecycle.test.js +0 -106
@@ -1,24 +1,29 @@
1
- import { act, renderHook } from '@testing-library/react-hooks/dom';
2
- import { atom } from 'jotai';
3
- import { authorize, authorizeStatus, getFileSystemManager, getSystemInfoSync, showModal } from '@ray-js/ray';
4
- import { getDeviceInfo } from '../../utils/device';
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import "core-js/modules/esnext.iterator.constructor.js";
3
+ import "core-js/modules/esnext.iterator.filter.js";
4
+ import "core-js/modules/esnext.iterator.map.js";
5
+ import React from 'react';
6
+ import ReactDOM from 'react-dom';
7
+ import { act, Simulate } from 'react-dom/test-utils';
8
+ import { atom, getDefaultStore } from 'jotai';
5
9
  import { Screenshot } from './screenshot';
10
+ import { PlayerRenderModeContext } from '../../renderer/context';
6
11
  jest.mock('@ray-js/ray', () => ({
7
12
  View: 'div',
13
+ CoverView: 'div',
8
14
  Text: 'span',
9
15
  Image: 'img',
10
- getSystemInfoSync: jest.fn(),
11
- getFileSystemManager: jest.fn(),
12
- authorize: jest.fn(),
13
- authorizeStatus: jest.fn(),
14
- showModal: jest.fn(),
15
- openAppSystemSettingPage: jest.fn()
16
+ getSystemInfoSync: () => ({
17
+ platform: 'ios',
18
+ system: 'iOS 18'
19
+ })
16
20
  }));
17
21
  jest.mock('@ray-js/ray-ipc-utils', () => ({
18
22
  goToIpcPageNativeRoute: jest.fn()
19
23
  }));
20
- jest.mock('../../utils/device', () => ({
21
- getDeviceInfo: jest.fn()
24
+ jest.mock('@ray-js/ray-ipc-utils/lib/interface', () => ({}));
25
+ jest.mock('../../utils/authorize/album', () => ({
26
+ ensureAlbumPermission: async () => true
22
27
  }));
23
28
  jest.mock('../../i18n', () => ({
24
29
  __esModule: true,
@@ -26,110 +31,100 @@ jest.mock('../../i18n', () => ({
26
31
  getLang: key => key
27
32
  }
28
33
  }));
29
- jest.mock('./screenshot.less', () => ({}));
30
- jest.mock('../captureResult/captureResult.less', () => ({}));
31
- beforeEach(() => {
32
- jest.clearAllMocks();
33
- getSystemInfoSync.mockReturnValue({
34
- platform: 'android',
35
- system: 'android 12'
34
+ describe('screenshot overlay survives toolbar orientation remounts', () => {
35
+ let container;
36
+ beforeEach(() => {
37
+ jest.useFakeTimers();
38
+ jest.setSystemTime(10000);
39
+ container = document.createElement('div');
40
+ document.body.appendChild(container);
36
41
  });
37
- authorizeStatus.mockImplementation(_ref => {
38
- let {
39
- fail
40
- } = _ref;
41
- return fail({
42
- errorCode: 9004
42
+ afterEach(() => {
43
+ act(() => {
44
+ ReactDOM.unmountComponentAtNode(container);
43
45
  });
46
+ container.remove();
47
+ jest.clearAllTimers();
48
+ jest.useRealTimers();
44
49
  });
45
- authorize.mockImplementation(_ref2 => {
46
- let {
47
- fail
48
- } = _ref2;
49
- return fail({
50
- errorCode: 9004
50
+ it.each(['webview', 'lynx'])('updates landscape -> portrait -> landscape geometry in %s', async mode => {
51
+ const screenType = atom('full');
52
+ const store = getDefaultStore();
53
+ let remount;
54
+ let updateContents;
55
+ const props = {
56
+ screenType,
57
+ brandColor: atom('#000000'),
58
+ devId: 'test-device',
59
+ saveToAlbum: false,
60
+ event: {
61
+ emit: jest.fn()
62
+ },
63
+ toast: jest.fn(),
64
+ IPCPlayerContext: {
65
+ snapshot: _ref => {
66
+ let {
67
+ success
68
+ } = _ref;
69
+ return success({
70
+ tempImagePath: 'shot.jpg'
71
+ });
72
+ }
73
+ },
74
+ addContent: (_area, item) => updateContents(items => [...items, item]),
75
+ deleteContent: (_area, id) => updateContents(items => items.filter(item => item.id !== id))
76
+ };
77
+ const Harness = () => {
78
+ const [items, setItems] = React.useState([]);
79
+ const [generation, setGeneration] = React.useState(0);
80
+ updateContents = setItems;
81
+ remount = () => setGeneration(value => value + 1);
82
+ return /*#__PURE__*/React.createElement(PlayerRenderModeContext.Provider, {
83
+ value: mode
84
+ }, /*#__PURE__*/React.createElement(Screenshot, _extends({
85
+ key: generation
86
+ }, props)), items.map(item => item.absoluteNoCoverView ? /*#__PURE__*/React.createElement(item.content, _extends({
87
+ key: item.id
88
+ }, item.initProps)) : /*#__PURE__*/React.createElement("div", {
89
+ key: item.id,
90
+ className: item.absoluteContentClassName,
91
+ style: item.absolutePosition
92
+ }, /*#__PURE__*/React.createElement(item.content, item.initProps))));
93
+ };
94
+ const overlay = () => container.querySelector('.ipc-player-plugin-screenshot-toast-wrap');
95
+ act(() => {
96
+ ReactDOM.render(/*#__PURE__*/React.createElement(Harness, null), container);
51
97
  });
98
+ await act(async () => {
99
+ Simulate.click(container.firstElementChild);
100
+ });
101
+ expect(overlay().style.width).toBe('400px');
102
+ act(() => {
103
+ jest.advanceTimersByTime(2000);
104
+ });
105
+ act(() => {
106
+ store.set(screenType, 'vertical');
107
+ remount();
108
+ });
109
+ expect(overlay().style.width).toBe('auto');
110
+ expect(overlay().style.left).toBe('16px');
111
+ expect(overlay().style.right).toBe('16px');
112
+ act(() => {
113
+ jest.advanceTimersByTime(1000);
114
+ });
115
+ act(() => {
116
+ store.set(screenType, 'full');
117
+ remount();
118
+ });
119
+ expect(overlay().style.width).toBe('400px');
120
+ expect(overlay().style.left).toBe('50%');
121
+ act(() => {
122
+ jest.advanceTimersByTime(1999);
123
+ });
124
+ expect(overlay()).not.toBeNull();
125
+ act(() => {
126
+ jest.advanceTimersByTime(1);
127
+ });
128
+ expect(overlay()).toBeNull();
52
129
  });
53
- getFileSystemManager.mockReturnValue({
54
- access: jest.fn(_ref3 => {
55
- let {
56
- success
57
- } = _ref3;
58
- return success();
59
- })
60
- });
61
- getDeviceInfo.mockResolvedValue({
62
- configMetas: {
63
- tyabimr4v3: {
64
- split_info: [{
65
- index: 1
66
- }, {
67
- index: 2
68
- }, {
69
- index: 3
70
- }]
71
- }
72
- }
73
- });
74
- });
75
- const createProps = () => ({
76
- IPCPlayerContext: {
77
- snapshot: jest.fn(_ref4 => {
78
- let {
79
- success
80
- } = _ref4;
81
- return success({
82
- tempImagePath: 'thingfile://capture.jpg'
83
- });
84
- })
85
- },
86
- addContent: jest.fn(),
87
- deleteContent: jest.fn(),
88
- saveToAlbum: 0,
89
- devId: 'camera-1',
90
- toast: jest.fn(),
91
- screenType: atom('vertical'),
92
- brandColor: atom('#000000'),
93
- multiLens: true,
94
- event: {
95
- emit: jest.fn()
96
- }
97
- });
98
- it('keeps multi-lens results when legacy album authorization is unavailable', async () => {
99
- const props = createProps();
100
- const {
101
- result,
102
- unmount
103
- } = renderHook(() => Screenshot(props));
104
- await act(async () => {
105
- await result.current.props.onClick();
106
- });
107
- expect(authorizeStatus).not.toHaveBeenCalled();
108
- expect(props.IPCPlayerContext.snapshot).toHaveBeenCalledWith(expect.objectContaining({
109
- saveToAlbum: 0
110
- }));
111
- const [, config] = props.addContent.mock.calls[0];
112
- expect(config.content().props).toEqual(expect.objectContaining({
113
- count: 3,
114
- thumbnailPath: 'thingfile://capture_lens1.jpg'
115
- }));
116
- unmount();
117
- });
118
- it('keeps the permission rejection path before taking a snapshot', async () => {
119
- getSystemInfoSync.mockReturnValue({
120
- platform: 'ios',
121
- system: 'iOS 18'
122
- });
123
- const props = createProps();
124
- const {
125
- result,
126
- unmount
127
- } = renderHook(() => Screenshot(props));
128
- await act(async () => {
129
- await result.current.props.onClick();
130
- });
131
- expect(props.IPCPlayerContext.snapshot).not.toHaveBeenCalled();
132
- expect(props.addContent).not.toHaveBeenCalled();
133
- expect(showModal).toHaveBeenCalledTimes(1);
134
- unmount();
135
130
  });
@@ -3,12 +3,15 @@ import { View, Image } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
4
  import { useSignal4G } from '../../hooks';
5
5
  import { signalSvgMap } from '../../res';
6
+ import { signalPngMap } from '../../res/lynx-signal';
7
+ import { usePlayerRenderMode } from '../../renderer/context';
6
8
  import './signal4G.less';
7
9
  export const Signal4G = props => {
8
10
  const {
9
11
  className,
10
12
  devId
11
13
  } = props;
14
+ const isLynx = usePlayerRenderMode() === 'lynx';
12
15
  const {
13
16
  dpValue,
14
17
  signalKey
@@ -22,7 +25,7 @@ export const Signal4G = props => {
22
25
  className: clsx('ipc-player-plugin-signal4g')
23
26
  }, /*#__PURE__*/React.createElement(Image, {
24
27
  className: clsx('ipc-player-plugin-signal4g-icon'),
25
- src: signalSvgMap[signalKey],
28
+ src: isLynx ? signalPngMap[signalKey] : signalSvgMap[signalKey],
26
29
  mode: "aspectFit"
27
30
  })));
28
31
  };
@@ -1,6 +1,7 @@
1
- import { View, Text } from '@ray-js/ray';
1
+ import { View } from '@ray-js/ray';
2
2
  import React, { useContext } from 'react';
3
3
  import clsx from 'clsx';
4
+ import { PlayerText as Text } from '../../renderer/text';
4
5
  import { useDpState } from '../../hooks';
5
6
  import { useStore } from '../../ctx/store';
6
7
  import { UIEventContext } from '../../ui/context';
@@ -1,8 +1,9 @@
1
1
  import "core-js/modules/esnext.iterator.constructor.js";
2
2
  import "core-js/modules/esnext.iterator.map.js";
3
3
  import React, { useMemo } from 'react';
4
- import { View, Text } from '@ray-js/ray';
4
+ import { View } from '@ray-js/ray';
5
5
  import clsx from 'clsx';
6
+ import { PlayerText as Text } from '../../renderer/text';
6
7
  import { useTemperature, useHumidity, useEc, useWaterTemperature, useDpSupport } from '../../hooks';
7
8
  import { IPC_EC, IPC_WATER_TEMPERATURE, SENSOR_HUMIDITY, SENSOR_TEMPERATURE } from '../../utils/content/dpCode';
8
9
  import './tempHumidity.less';
@@ -1,6 +1,7 @@
1
- import { Text, View } from '@ray-js/ray';
1
+ import { View } from '@ray-js/ray';
2
2
  import clsx from 'clsx';
3
3
  import React from 'react';
4
+ import { PlayerText as Text } from '../../renderer/text';
4
5
  import { useStore } from '../../ctx/store';
5
6
  import './toggleVerticalFull.less';
6
7
  export function ToggleVerticalFull(props) {
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import './index.less';
3
3
  type Props = {
4
4
  className?: string;
5
- onView?: () => void;
6
5
  /** 主题色(用于「开通」按钮背景)。默认与 player brandColor 一致 */
7
6
  brandColor?: string;
8
7
  /** 试看倒计时初始秒数,来源于 smartImageQualityState.trialRemainingSec */
@@ -12,5 +11,5 @@ type Props = {
12
11
  /** 倒计时归零时触发,本组件保证整个生命周期内只回调一次 */
13
12
  onCountdownEnd?: () => void;
14
13
  };
15
- export declare const TrialBadge: ({ className, onView, brandColor, trialRemainingSec, onSubscribe, onCountdownEnd, }: Props) => React.JSX.Element;
14
+ export declare const TrialBadge: ({ className, brandColor, trialRemainingSec, onSubscribe, onCountdownEnd, }: Props) => React.JSX.Element;
16
15
  export { useTrialBadge } from './useTrialBadge';
@@ -1,6 +1,8 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
- import { Image, Text, View } from '@ray-js/ray';
2
+ import { Image, View } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
+ import { usePlayerRenderMode } from '../../renderer/context';
5
+ import { PlayerText as Text } from '../../renderer/text';
4
6
  import Strings from '../../i18n';
5
7
  import tryOpen from '../../res/try/try_open.png';
6
8
  import './index.less';
@@ -16,15 +18,12 @@ const formatCountdown = seconds => {
16
18
  export const TrialBadge = _ref => {
17
19
  let {
18
20
  className,
19
- onView,
20
21
  brandColor = FALLBACK_BRAND_COLOR,
21
22
  trialRemainingSec = 0,
22
23
  onSubscribe,
23
24
  onCountdownEnd
24
25
  } = _ref;
25
- useEffect(() => {
26
- onView === null || onView === void 0 || onView();
27
- }, [onView]);
26
+ const renderMode = usePlayerRenderMode();
28
27
  const [remainingSec, setRemainingSec] = useState(Math.max(0, Math.floor(trialRemainingSec)));
29
28
  const endedRef = useRef(false);
30
29
  const onCountdownEndRef = useRef(onCountdownEnd);
@@ -64,14 +63,16 @@ export const TrialBadge = _ref => {
64
63
  }, [trialRemainingSec]);
65
64
  const countdownText = formatCountdown(remainingSec);
66
65
  return /*#__PURE__*/React.createElement(View, {
67
- className: clsx('ipc-player-trial-badge', className)
66
+ className: clsx('ipc-player-trial-badge', className, {
67
+ 'ipc-player-trial-badge--lynx': renderMode === 'lynx'
68
+ })
68
69
  }, /*#__PURE__*/React.createElement(Image, {
69
70
  className: "ipc-player-trial-badge-icon",
70
71
  src: tryOpen,
71
72
  mode: "heightFix"
72
73
  }), /*#__PURE__*/React.createElement(Text, {
73
74
  className: "ipc-player-trial-badge-status"
74
- }, Strings.getLang('ipc_player_trial_in_use')), /*#__PURE__*/React.createElement(Text, {
75
+ }, Strings.getLang('ipc_player_trial_in_use').replace(/\s*[||]\s*$/, '')), /*#__PURE__*/React.createElement(Text, {
75
76
  className: "ipc-player-trial-badge-divider"
76
77
  }, "|"), /*#__PURE__*/React.createElement(Text, {
77
78
  className: "ipc-player-trial-badge-preview"
@@ -81,19 +82,15 @@ export const TrialBadge = _ref => {
81
82
  backgroundColor: brandColor
82
83
  },
83
84
  onClick: () => {
84
- try {
85
- ty.event({
86
- eventId: 'thing_qbwpX5zfbKOSjD4jz1tPv61rqrhGX7iV',
87
- event: {
88
- business_type: 'ipc',
89
- scene_type: 'smart_image_quality',
90
- feat_type: 'go_pay',
91
- biz: 'preview_mini'
92
- }
93
- });
94
- } catch (error) {
95
- console.warn('[IPC] trial subscription tracking failed:', error);
96
- }
85
+ ty.event({
86
+ eventId: 'thing_qbwpX5zfbKOSjD4jz1tPv61rqrhGX7iV',
87
+ event: {
88
+ business_type: 'ipc',
89
+ scene_type: 'smart_image_quality',
90
+ feat_type: 'go_pay',
91
+ biz: 'preview_mini'
92
+ }
93
+ });
97
94
  onSubscribe === null || onSubscribe === void 0 || onSubscribe();
98
95
  }
99
96
  }, /*#__PURE__*/React.createElement(Text, {
@@ -66,3 +66,27 @@
66
66
  font-weight: 600;
67
67
  line-height: 1;
68
68
  }
69
+
70
+ // Lynx 不支持 inline-flex 的 WebView 排版语义,显式声明横向 flex。
71
+ .ipc-player-trial-badge--lynx {
72
+ // Match WebView inline-flex: size to content instead of stretching across its parent.
73
+ align-self: flex-start;
74
+ display: flex;
75
+ flex-direction: row;
76
+ background-color: rgba(0, 0, 0, 0.65);
77
+
78
+ .ipc-player-trial-badge-icon {
79
+ width: 20px;
80
+ }
81
+
82
+ .ipc-player-trial-badge-status,
83
+ .ipc-player-trial-badge-divider,
84
+ .ipc-player-trial-badge-preview {
85
+ flex-shrink: 0;
86
+ }
87
+
88
+ .ipc-player-trial-badge-cta {
89
+ display: flex;
90
+ flex-direction: row;
91
+ }
92
+ }
@@ -1,9 +1,8 @@
1
- import type { MutableRefObject } from 'react';
1
+ /// <reference types="react" />
2
2
  import type { EventInstance } from '../../interface';
3
- export declare const useTrialBadge: (event: EventInstance, devId: string, trialRemainingSec: number, viewedRef?: MutableRefObject<boolean>, rtidRef?: MutableRefObject<Map<string, string>>) => {
3
+ export declare const useTrialBadge: (event: EventInstance, devId: string, trialRemainingSec: number) => {
4
4
  showTrialBadge: boolean;
5
5
  setShowTrialBadge: import("react").Dispatch<import("react").SetStateAction<boolean>>;
6
- handleTrialView: () => void;
7
6
  handleTrialSubscribe: () => Promise<void>;
8
7
  handleCountdownEnd: () => Promise<void>;
9
8
  };
@@ -3,17 +3,7 @@ import { setTrailFinish } from '../../utils/ttt';
3
3
  import { gotoSecurityCloudService2 } from '../../utils';
4
4
  import { trialCountdownEnd } from '../../ui/constant';
5
5
  import Strings from '../../i18n';
6
- import { createEntryTracking, reportEntryClick, reportEntryView } from '../../utils/fullLinkTracking';
7
- export const useTrialBadge = (event, devId, trialRemainingSec, viewedRef, rtidRef) => {
8
- const localViewedRef = useRef(false);
9
- const pageViewedRef = viewedRef || localViewedRef;
10
- const localRtidRef = useRef(new Map());
11
- const pageRtidRef = rtidRef || localRtidRef;
12
- const getTracking = useCallback(() => {
13
- const tracking = createEntryTracking(pageRtidRef.current.get(devId));
14
- pageRtidRef.current.set(devId, tracking.utm_rtid);
15
- return tracking;
16
- }, [devId, pageRtidRef]);
6
+ export const useTrialBadge = (event, devId, trialRemainingSec) => {
17
7
  const [showTrialBadge, setShowTrialBadge] = useState(false);
18
8
  const prevTrialSecRef = useRef(trialRemainingSec);
19
9
  useEffect(() => {
@@ -24,23 +14,16 @@ export const useTrialBadge = (event, devId, trialRemainingSec, viewedRef, rtidRe
24
14
  }
25
15
  prevTrialSecRef.current = trialRemainingSec;
26
16
  }, [trialRemainingSec]);
27
- const handleTrialView = useCallback(() => {
28
- if (pageViewedRef.current) return;
29
- pageViewedRef.current = true;
30
- reportEntryView(devId, getTracking());
31
- }, [devId, pageViewedRef, getTracking]);
32
17
  const handleTrialSubscribe = useCallback(async () => {
33
18
  try {
34
- const tracking = getTracking();
35
- await reportEntryClick(devId, tracking);
36
- await gotoSecurityCloudService2(devId, tracking);
19
+ await gotoSecurityCloudService2(devId);
37
20
  } catch (error) {
38
21
  ty.showToast({
39
22
  title: Strings.getLang('ipc_player_fetch_error'),
40
23
  icon: 'none'
41
24
  });
42
25
  }
43
- }, [devId, getTracking]);
26
+ }, [devId]);
44
27
  const handleCountdownEnd = useCallback(async () => {
45
28
  try {
46
29
  setShowTrialBadge(false);
@@ -68,7 +51,6 @@ export const useTrialBadge = (event, devId, trialRemainingSec, viewedRef, rtidRe
68
51
  return {
69
52
  showTrialBadge,
70
53
  setShowTrialBadge,
71
- handleTrialView,
72
54
  handleTrialSubscribe,
73
55
  handleCountdownEnd
74
56
  };
@@ -1,7 +1,8 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import { View, Image, getSystemInfoSync, showToast, Text } from '@ray-js/ray';
2
+ import { View, Image, getSystemInfoSync, showToast } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
4
  import React, { useState, useEffect, useCallback, useRef } from 'react';
5
+ import { PlayerText as Text } from '../../renderer/text';
5
6
  import { useStore } from '../../ctx/store';
6
7
  import Strings from '../../i18n';
7
8
  import { getAIFrameFeature, gotoAIDrawMiniProgram, setAIFrameFeature } from '../../utils';
@@ -1,8 +1,9 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
- import { View, Text, usePageEvent } from '@ray-js/ray';
2
+ import { View, usePageEvent } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
4
  import { getVideoBitrateKbps, requestWifiSignal } from '@ray-js/ray-ipc-utils';
5
5
  import { ClarityType } from '@ray-js/ray-ipc-utils/lib/interface';
6
+ import { PlayerText as Text } from '../../renderer/text';
6
7
  import { PlayState } from '../../interface';
7
8
  import './videoBitKBP.less';
8
9
  import { useStore } from '../../ctx/store';
@@ -1,9 +1,11 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import React, { useRef, useContext, useState, useEffect, forwardRef, useImperativeHandle } from 'react';
3
- import { View, Image, getSystemInfoSync } from '@ray-js/ray';
3
+ import { View, Image, Text, getSystemInfoSync } from '@ray-js/ray';
4
4
  import clsx from 'clsx';
5
5
  import { useStore, getDefaultStore, updateAtom } from '../../ctx/store';
6
6
  import './voiceIntercom.less';
7
+ import { usePlayerRenderMode } from '../../renderer/context';
8
+ import { PlayerText } from '../../renderer/text';
7
9
  import { PlayerStreamStatus, IntercomMode, PlayState } from '../../interface';
8
10
  import { UIEventContext } from '../../ui/context';
9
11
  import { radialGradient } from '../../utils';
@@ -37,6 +39,7 @@ export const VoiceIntercom = /*#__PURE__*/forwardRef((props, ref) => {
37
39
  const {
38
40
  event
39
41
  } = useContext(UIEventContext);
42
+ const renderMode = usePlayerRenderMode();
40
43
  const {
41
44
  recording,
42
45
  mute,
@@ -195,23 +198,45 @@ export const VoiceIntercom = /*#__PURE__*/forwardRef((props, ref) => {
195
198
  }, intercomClassName),
196
199
  onTouchStart: handTouchStart,
197
200
  onTouchEnd: onTouchEnd
198
- }, intercom ? (() => /*#__PURE__*/React.createElement(View, {
199
- className: clsx({
200
- 'ipc-player-plugin-voice-small-ing-intercom': mode !== 'circle'
201
- })
202
- }, /*#__PURE__*/React.createElement(View, {
203
- className: clsx('bars'),
204
- style: {
205
- transform: `scale(${scale})`,
206
- transformOrigin: 'center'
207
- }
208
- }, [0, 1, 2, 3, 4].map(index => /*#__PURE__*/React.createElement(View, {
209
- key: index,
210
- className: clsx('bar'),
211
- style: {
212
- background: talkingColor
201
+ }, intercom ? (() => {
202
+ if (renderMode === 'lynx') {
203
+ return /*#__PURE__*/React.createElement(View, {
204
+ className: clsx('lynx-talking-bars', mode === 'circle' && 'intercom-default-size', mode !== 'circle' && 'ipc-player-plugin-voice-small-intercom', iconClassName),
205
+ style: {
206
+ transform: `scale(${scale})`,
207
+ transformOrigin: 'center'
208
+ }
209
+ }, [0, 1, 2, 3, 4].map(index => {
210
+ const baseHeight = [5, 10, 16, 10, 5][index];
211
+ const factor = 1 + Math.sin((frame + index) / 5) * 0.2;
212
+ return /*#__PURE__*/React.createElement(View, {
213
+ key: index,
214
+ className: "lynx-talking-bar",
215
+ style: {
216
+ height: `${baseHeight * factor}px`,
217
+ background: talkingColor
218
+ }
219
+ });
220
+ }));
213
221
  }
214
- })))))() : (() => {
222
+ return /*#__PURE__*/React.createElement(View, {
223
+ className: clsx({
224
+ 'ipc-player-plugin-voice-small-ing-intercom': mode !== 'circle'
225
+ })
226
+ }, /*#__PURE__*/React.createElement(View, {
227
+ className: clsx('bars'),
228
+ style: {
229
+ transform: `scale(${scale})`,
230
+ transformOrigin: 'center'
231
+ }
232
+ }, [0, 1, 2, 3, 4].map(index => /*#__PURE__*/React.createElement(View, {
233
+ key: index,
234
+ className: clsx('bar'),
235
+ style: {
236
+ background: talkingColor
237
+ }
238
+ }))));
239
+ })() : (() => {
215
240
  if (icon) {
216
241
  if (typeof icon === 'string') {
217
242
  return /*#__PURE__*/React.createElement(View, {
@@ -225,13 +250,14 @@ export const VoiceIntercom = /*#__PURE__*/forwardRef((props, ref) => {
225
250
  className: clsx('icon-image-default-container', iconClassName)
226
251
  }, icon);
227
252
  }
228
- return /*#__PURE__*/React.createElement(View, {
229
- className: clsx('icon-panel',
230
- // 类名按 iconfont 的 font_class 取,不是 name —— 图标库里这枚图标的
231
- // name 是「one-way-intercom」(单向对讲)、font_class 是「yuyin」(unicode e63c),
232
- // 而 CSS 类是按 font_class 生成的。曾经按 name 拼类名,字形永远找不到,
233
- // 重新导出多少次都不会有那个类。别再"顺手改成语义化名字"。
234
- 'icon-panel-yuyin', mode === 'circle' && 'intercom-default-size', mode !== 'circle' && 'ipc-player-plugin-voice-small-intercom', iconClassName)
253
+ const className = clsx('icon-panel',
254
+ // 按 iconfont 的 font_class 使用 yuyin,而不是 name one-way-intercom。
255
+ 'icon-panel-yuyin', mode === 'circle' && 'intercom-default-size', mode !== 'circle' && 'ipc-player-plugin-voice-small-intercom', iconClassName);
256
+ if (renderMode === 'lynx') return /*#__PURE__*/React.createElement(PlayerText, {
257
+ className: className
258
+ });
259
+ return /*#__PURE__*/React.createElement(Text, {
260
+ className: className
235
261
  });
236
262
  })());
237
263
  });
@@ -32,6 +32,22 @@
32
32
  align-items: center;
33
33
  height: 100%;
34
34
  }
35
+
36
+ // Lynx 对讲中状态使用内联帧高度,避开 :nth-child 与 CSS animation 在 Lynx 下的兼容差异。
37
+ .lynx-talking-bars {
38
+ padding: 0 1px;
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ }
43
+
44
+ .lynx-talking-bar {
45
+ width: 2px;
46
+ margin: 0 1px;
47
+ border-radius: 5px;
48
+ transition: height 30ms linear;
49
+ }
50
+
35
51
  .ipc-player-plugin-voice-intercom-img {
36
52
  width: calc(@size * var(--ipc-player-size-scale, 1));
37
53
  height: calc(@size * var(--ipc-player-size-scale, 1));
@@ -0,0 +1,6 @@
1
+ import type { CSSProperties } from 'react';
2
+ /** Keep legacy draw coordinates, but bound the actual native clipping host to the video. */
3
+ export declare function clipZoomDock(position: CSSProperties, horizontalWidth?: number): {
4
+ position: CSSProperties;
5
+ content: CSSProperties;
6
+ };