@ray-js/ipc-player-integration 0.0.70 → 0.0.71-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 (120) hide show
  1. package/README.md +6 -0
  2. package/lib/ctx/ctx.js +12 -17
  3. package/lib/ctx/ctx.test.js +54 -19
  4. package/lib/ctx/intercom.test.d.ts +1 -0
  5. package/lib/ctx/intercom.test.js +85 -0
  6. package/lib/index.d.ts +4 -0
  7. package/lib/index.js +3 -1
  8. package/lib/renderer/capabilities.d.ts +8 -0
  9. package/lib/renderer/capabilities.js +19 -0
  10. package/lib/renderer/context.d.ts +5 -0
  11. package/lib/renderer/context.js +6 -0
  12. package/lib/renderer/directionControl.d.ts +6 -0
  13. package/lib/renderer/directionControl.js +3 -0
  14. package/lib/renderer/font-manifest.json +9 -0
  15. package/lib/renderer/font.less +5 -0
  16. package/lib/renderer/glyphs.d.ts +1 -0
  17. package/lib/renderer/glyphs.js +256 -0
  18. package/lib/renderer/index.module.less +48 -0
  19. package/lib/renderer/overlay.d.ts +6 -0
  20. package/lib/renderer/overlay.js +18 -0
  21. package/lib/renderer/ptzZoom.d.ts +6 -0
  22. package/lib/renderer/ptzZoom.js +3 -0
  23. package/lib/renderer/text.d.ts +4 -0
  24. package/lib/renderer/text.js +32 -0
  25. package/lib/renderer/text.module.less +4 -0
  26. package/lib/renderer/viewport.d.ts +7 -0
  27. package/lib/renderer/viewport.js +24 -0
  28. package/lib/res/lynx-signal/index.d.ts +1 -0
  29. package/lib/res/lynx-signal/index.js +22 -0
  30. package/lib/res/lynx-signal/signalFour0.png +0 -0
  31. package/lib/res/lynx-signal/signalFour1.png +0 -0
  32. package/lib/res/lynx-signal/signalFour2.png +0 -0
  33. package/lib/res/lynx-signal/signalFour3.png +0 -0
  34. package/lib/res/lynx-signal/signalFour4.png +0 -0
  35. package/lib/res/lynx-signal/signalThree0.png +0 -0
  36. package/lib/res/lynx-signal/signalThree1.png +0 -0
  37. package/lib/res/lynx-signal/signalThree2.png +0 -0
  38. package/lib/res/lynx-signal/signalThree3.png +0 -0
  39. package/lib/res/player-charging.png +0 -0
  40. package/lib/res/player-more-arrow.png +0 -0
  41. package/lib/res/player-solar.png +0 -0
  42. package/lib/ui/bottomLeftContent.js +121 -53
  43. package/lib/ui/bottomRightContent.js +10 -5
  44. package/lib/ui/scrollHintArrow.d.ts +23 -0
  45. package/lib/ui/scrollHintArrow.js +83 -0
  46. package/lib/ui/topLeftContent.js +4 -2
  47. package/lib/ui/topRightContent.js +4 -2
  48. package/lib/ui/ui.d.ts +5 -0
  49. package/lib/ui/ui.js +46 -23
  50. package/lib/widgets/battery/battery.js +7 -5
  51. package/lib/widgets/battery/batteryFull.js +7 -5
  52. package/lib/widgets/battery/statusIcon.d.ts +6 -0
  53. package/lib/widgets/battery/statusIcon.js +36 -0
  54. package/lib/widgets/battery/statusIcon.less +24 -0
  55. package/lib/widgets/captureResult/captureResult.js +2 -1
  56. package/lib/widgets/captureToast/captureToast.d.ts +10 -0
  57. package/lib/widgets/captureToast/captureToast.js +58 -0
  58. package/lib/widgets/floodlight/floodlight.js +2 -1
  59. package/lib/widgets/flowLowTip/flowLowTip.js +2 -1
  60. package/lib/widgets/fullScreen/fullScreen.js +2 -1
  61. package/lib/widgets/fullScreen/fullTravelRouteControl.d.ts +1 -1
  62. package/lib/widgets/fullScreen/fullTravelRouteControl.js +1 -1
  63. package/lib/widgets/fullScreen/verticalScreen.js +2 -1
  64. package/lib/widgets/moveInteractiveControl/controlButton.js +2 -1
  65. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.js +16 -5
  66. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.less +24 -4
  67. package/lib/widgets/multiCamera/landscapeTip.js +8 -2
  68. package/lib/widgets/multiCamera/moveablePtzControl.js +5 -3
  69. package/lib/widgets/multiCamera/multiPtz.js +2 -1
  70. package/lib/widgets/multiCamera/ptzMoveableTip.js +8 -2
  71. package/lib/widgets/multiCamera/switchLayout.js +2 -1
  72. package/lib/widgets/multiCamera/tileMultiPtz.js +2 -1
  73. package/lib/widgets/multiCamera/tileSwitchLayout.js +2 -1
  74. package/lib/widgets/multiCamera/tileTip.js +8 -2
  75. package/lib/widgets/muted/muted.js +2 -1
  76. package/lib/widgets/muted/muted.test.js +66 -52
  77. package/lib/widgets/ptz/ptz.js +2 -1
  78. package/lib/widgets/ptz/ptzControl.js +4 -3
  79. package/lib/widgets/ptzControlTip/ptzControlTip.js +9 -4
  80. package/lib/widgets/ptzControlTip/ptzControlTip.less +6 -0
  81. package/lib/widgets/realTimeMagnification/realTimeMagnification.js +2 -1
  82. package/lib/widgets/recordVideo/recordVideo.js +47 -169
  83. package/lib/widgets/recordVideo/recordVideo.lifecycle.test.js +4 -2
  84. package/lib/widgets/recordVideo/recordVideo.test.js +169 -2
  85. package/lib/widgets/recordVideo/recordVideoTimer.d.ts +3 -0
  86. package/lib/widgets/recordVideo/recordVideoTimer.js +26 -0
  87. package/lib/widgets/resolution/fullResolutionControl.js +29 -19
  88. package/lib/widgets/resolution/resolution.js +3 -2
  89. package/lib/widgets/screenshot/screenshot.js +48 -122
  90. package/lib/widgets/screenshot/screenshot.permissions.test.d.ts +1 -0
  91. package/lib/widgets/screenshot/screenshot.permissions.test.js +137 -0
  92. package/lib/widgets/screenshot/screenshot.test.js +108 -113
  93. package/lib/widgets/signal4G/signal4G.js +4 -1
  94. package/lib/widgets/siren/siren.js +2 -1
  95. package/lib/widgets/tempHumidity/tempHumidity.js +2 -1
  96. package/lib/widgets/toggleVerticalFull/toggleVerticalFull.js +2 -1
  97. package/lib/widgets/trialBadge/index.js +8 -3
  98. package/lib/widgets/trialBadge/index.less +24 -0
  99. package/lib/widgets/tryExperience/tryExperience.js +2 -1
  100. package/lib/widgets/videoBitKBP/videoBitKBP.js +2 -1
  101. package/lib/widgets/voiceIntercom/voiceIntercom.js +57 -81
  102. package/lib/widgets/voiceIntercom/voiceIntercom.less +35 -0
  103. package/lib/widgets/voiceIntercom/voiceIntercom.test.d.ts +1 -0
  104. package/lib/widgets/voiceIntercom/voiceIntercom.test.js +135 -0
  105. package/lib/widgets/zoomTurntable/lynxDockLayout.d.ts +6 -0
  106. package/lib/widgets/zoomTurntable/lynxDockLayout.js +30 -0
  107. package/lib/widgets/zoomTurntable/turntable/index.d.ts +5 -7
  108. package/lib/widgets/zoomTurntable/turntable/index.js +3 -1
  109. package/lib/widgets/zoomTurntable/turntable/lynx.d.ts +5 -0
  110. package/lib/widgets/zoomTurntable/turntable/lynx.js +273 -0
  111. package/lib/widgets/zoomTurntable/turntable/lynx.less +9 -0
  112. package/lib/widgets/zoomTurntable/turntable/lynxModel.d.ts +37 -0
  113. package/lib/widgets/zoomTurntable/turntable/lynxModel.js +122 -0
  114. package/lib/widgets/zoomTurntable/turntable/lynxPaint.d.ts +3 -0
  115. package/lib/widgets/zoomTurntable/turntable/lynxPaint.js +36 -0
  116. package/lib/widgets/zoomTurntable/zoomTurntableDock.d.ts +5 -3
  117. package/lib/widgets/zoomTurntable/zoomTurntableDock.js +4 -4
  118. package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +32 -19
  119. package/lib/widgets/zoomTurntable/zoomTurntableTip.js +17 -3
  120. package/package.json +15 -7
@@ -0,0 +1,137 @@
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';
5
+ import { Screenshot } from './screenshot';
6
+ jest.mock('@ray-js/ray', () => ({
7
+ View: 'div',
8
+ Text: 'span',
9
+ 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
+ }));
17
+ jest.mock('@ray-js/ray-ipc-utils', () => ({
18
+ goToIpcPageNativeRoute: jest.fn()
19
+ }));
20
+ jest.mock('../../utils/device', () => ({
21
+ getDeviceInfo: jest.fn()
22
+ }));
23
+ jest.mock('../../i18n', () => ({
24
+ __esModule: true,
25
+ default: {
26
+ getLang: key => key
27
+ }
28
+ }));
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'
36
+ });
37
+ authorizeStatus.mockImplementation(_ref => {
38
+ let {
39
+ fail
40
+ } = _ref;
41
+ return fail({
42
+ errorCode: 9004
43
+ });
44
+ });
45
+ authorize.mockImplementation(_ref2 => {
46
+ let {
47
+ fail
48
+ } = _ref2;
49
+ return fail({
50
+ errorCode: 9004
51
+ });
52
+ });
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
+ const overlay = renderHook(() => config.content(config.initProps));
113
+ expect(overlay.result.current.props.children.props).toEqual(expect.objectContaining({
114
+ count: 3,
115
+ thumbnailPath: 'thingfile://capture_lens1.jpg'
116
+ }));
117
+ overlay.unmount();
118
+ unmount();
119
+ });
120
+ it('keeps the permission rejection path before taking a snapshot', async () => {
121
+ getSystemInfoSync.mockReturnValue({
122
+ platform: 'ios',
123
+ system: 'iOS 18'
124
+ });
125
+ const props = createProps();
126
+ const {
127
+ result,
128
+ unmount
129
+ } = renderHook(() => Screenshot(props));
130
+ await act(async () => {
131
+ await result.current.props.onClick();
132
+ });
133
+ expect(props.IPCPlayerContext.snapshot).not.toHaveBeenCalled();
134
+ expect(props.addContent).not.toHaveBeenCalled();
135
+ expect(showModal).toHaveBeenCalledTimes(1);
136
+ unmount();
137
+ });
@@ -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) {
@@ -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';
@@ -22,6 +24,7 @@ export const TrialBadge = _ref => {
22
24
  onSubscribe,
23
25
  onCountdownEnd
24
26
  } = _ref;
27
+ const renderMode = usePlayerRenderMode();
25
28
  useEffect(() => {
26
29
  onView === null || onView === void 0 || onView();
27
30
  }, [onView]);
@@ -64,14 +67,16 @@ export const TrialBadge = _ref => {
64
67
  }, [trialRemainingSec]);
65
68
  const countdownText = formatCountdown(remainingSec);
66
69
  return /*#__PURE__*/React.createElement(View, {
67
- className: clsx('ipc-player-trial-badge', className)
70
+ className: clsx('ipc-player-trial-badge', className, {
71
+ 'ipc-player-trial-badge--lynx': renderMode === 'lynx'
72
+ })
68
73
  }, /*#__PURE__*/React.createElement(Image, {
69
74
  className: "ipc-player-trial-badge-icon",
70
75
  src: tryOpen,
71
76
  mode: "heightFix"
72
77
  }), /*#__PURE__*/React.createElement(Text, {
73
78
  className: "ipc-player-trial-badge-status"
74
- }, Strings.getLang('ipc_player_trial_in_use')), /*#__PURE__*/React.createElement(Text, {
79
+ }, Strings.getLang('ipc_player_trial_in_use').replace(/\s*[||]\s*$/, '')), /*#__PURE__*/React.createElement(Text, {
75
80
  className: "ipc-player-trial-badge-divider"
76
81
  }, "|"), /*#__PURE__*/React.createElement(Text, {
77
82
  className: "ipc-player-trial-badge-preview"
@@ -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,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';