@ray-js/ipc-player-integration 0.0.68-beta.0 → 0.0.70-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 (153) hide show
  1. package/README.md +0 -6
  2. package/lib/ctx/ctx.album.test.d.ts +1 -0
  3. package/lib/ctx/ctx.album.test.js +197 -0
  4. package/lib/ctx/ctx.composition.js +13 -3
  5. package/lib/ctx/ctx.js +48 -35
  6. package/lib/ctx/multiCameraCtx.d.ts +2 -0
  7. package/lib/ctx/multiCameraCtx.js +17 -1
  8. package/lib/ctx/multiCameraCtx.test.d.ts +1 -0
  9. package/lib/ctx/multiCameraCtx.test.js +65 -0
  10. package/lib/i18n/index.d.ts +12 -0
  11. package/lib/i18n/strings.d.ts +6 -0
  12. package/lib/i18n/strings.js +6 -0
  13. package/lib/index.d.ts +0 -4
  14. package/lib/index.js +1 -3
  15. package/lib/interface.d.ts +18 -3
  16. package/lib/ui/absoluteContent.d.ts +2 -0
  17. package/lib/ui/absoluteContent.js +3 -0
  18. package/lib/ui/bottomCoverHeight.d.ts +2 -0
  19. package/lib/ui/bottomCoverHeight.js +6 -0
  20. package/lib/ui/bottomCoverHeight.test.d.ts +1 -0
  21. package/lib/ui/bottomCoverHeight.test.js +15 -0
  22. package/lib/ui/bottomLeftContent.js +65 -123
  23. package/lib/ui/bottomRightContent.js +13 -11
  24. package/lib/ui/topLeftContent.js +2 -4
  25. package/lib/ui/topRightContent.js +2 -4
  26. package/lib/ui/ui.d.ts +0 -5
  27. package/lib/ui/ui.js +100 -93
  28. package/lib/utils/captureResult.d.ts +12 -0
  29. package/lib/utils/captureResult.js +70 -0
  30. package/lib/utils/captureResult.test.d.ts +1 -0
  31. package/lib/utils/captureResult.test.js +223 -0
  32. package/lib/utils/fullLinkTracking.d.ts +5 -0
  33. package/lib/utils/fullLinkTracking.js +71 -0
  34. package/lib/utils/navigation.d.ts +2 -1
  35. package/lib/utils/navigation.js +13 -3
  36. package/lib/widgets/battery/battery.js +5 -7
  37. package/lib/widgets/battery/batteryFull.js +5 -7
  38. package/lib/widgets/captureResult/captureResult.d.ts +16 -0
  39. package/lib/widgets/captureResult/captureResult.js +85 -0
  40. package/lib/widgets/captureResult/captureResult.less +144 -0
  41. package/lib/widgets/captureResult/captureResult.test.d.ts +1 -0
  42. package/lib/widgets/captureResult/captureResult.test.js +84 -0
  43. package/lib/widgets/captureResult/index.d.ts +2 -0
  44. package/lib/widgets/captureResult/index.js +2 -0
  45. package/lib/widgets/floodlight/floodlight.js +1 -2
  46. package/lib/widgets/flowLowTip/flowLowTip.js +1 -2
  47. package/lib/widgets/fullScreen/fullScreen.js +31 -44
  48. package/lib/widgets/fullScreen/fullTravelRouteControl.d.ts +2 -2
  49. package/lib/widgets/fullScreen/fullTravelRouteControl.js +6 -3
  50. package/lib/widgets/fullScreen/verticalScreen.js +1 -2
  51. package/lib/widgets/index.d.ts +1 -0
  52. package/lib/widgets/index.js +2 -1
  53. package/lib/widgets/moveInteractiveControl/controlButton.js +1 -2
  54. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.js +5 -16
  55. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.less +4 -24
  56. package/lib/widgets/multiCamera/index.less +1 -0
  57. package/lib/widgets/multiCamera/landscapeTip.js +2 -5
  58. package/lib/widgets/multiCamera/moveablePtzControl.js +7 -9
  59. package/lib/widgets/multiCamera/multiPtz.js +2 -3
  60. package/lib/widgets/multiCamera/ptzMoveableTip.js +2 -5
  61. package/lib/widgets/multiCamera/switchLayout.js +1 -2
  62. package/lib/widgets/multiCamera/tileMultiPtz.js +2 -3
  63. package/lib/widgets/multiCamera/tileSwitchLayout.js +1 -2
  64. package/lib/widgets/multiCamera/tileTip.js +2 -5
  65. package/lib/widgets/muted/muted.js +1 -2
  66. package/lib/widgets/muted/muted.test.js +52 -66
  67. package/lib/widgets/ptz/ptz.js +1 -2
  68. package/lib/widgets/ptz/ptzControl.js +3 -4
  69. package/lib/widgets/ptzControlTip/ptzControlTip.js +4 -9
  70. package/lib/widgets/ptzControlTip/ptzControlTip.less +0 -6
  71. package/lib/widgets/realTimeMagnification/realTimeMagnification.js +1 -2
  72. package/lib/widgets/recordVideo/recordVideo.js +178 -32
  73. package/lib/widgets/recordVideo/recordVideo.less +17 -74
  74. package/lib/widgets/recordVideo/recordVideo.lifecycle.test.d.ts +1 -0
  75. package/lib/widgets/recordVideo/recordVideo.lifecycle.test.js +106 -0
  76. package/lib/widgets/recordVideo/recordVideo.test.js +3 -169
  77. package/lib/widgets/resolution/fullResolutionControl.js +19 -29
  78. package/lib/widgets/resolution/resolution.js +2 -3
  79. package/lib/widgets/screenshot/screenshot.js +125 -35
  80. package/lib/widgets/screenshot/screenshot.less +1 -40
  81. package/lib/widgets/screenshot/screenshot.test.js +113 -108
  82. package/lib/widgets/signal4G/signal4G.js +1 -4
  83. package/lib/widgets/siren/siren.js +1 -2
  84. package/lib/widgets/tempHumidity/tempHumidity.js +1 -2
  85. package/lib/widgets/toggleVerticalFull/toggleVerticalFull.js +1 -2
  86. package/lib/widgets/trialBadge/index.d.ts +2 -1
  87. package/lib/widgets/trialBadge/index.js +20 -17
  88. package/lib/widgets/trialBadge/index.less +0 -24
  89. package/lib/widgets/trialBadge/useTrialBadge.d.ts +3 -2
  90. package/lib/widgets/trialBadge/useTrialBadge.js +21 -3
  91. package/lib/widgets/tryExperience/tryExperience.js +1 -2
  92. package/lib/widgets/videoBitKBP/videoBitKBP.js +1 -2
  93. package/lib/widgets/voiceIntercom/voiceIntercom.js +24 -50
  94. package/lib/widgets/voiceIntercom/voiceIntercom.less +0 -16
  95. package/lib/widgets/zoomTurntable/turntable/index.d.ts +7 -5
  96. package/lib/widgets/zoomTurntable/turntable/index.js +1 -3
  97. package/lib/widgets/zoomTurntable/zoomTurntableDock.d.ts +3 -5
  98. package/lib/widgets/zoomTurntable/zoomTurntableDock.js +4 -4
  99. package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +19 -32
  100. package/lib/widgets/zoomTurntable/zoomTurntableTip.js +3 -24
  101. package/package.json +7 -15
  102. package/lib/renderer/capabilities.d.ts +0 -8
  103. package/lib/renderer/capabilities.js +0 -19
  104. package/lib/renderer/context.d.ts +0 -5
  105. package/lib/renderer/context.js +0 -6
  106. package/lib/renderer/directionControl.d.ts +0 -6
  107. package/lib/renderer/directionControl.js +0 -3
  108. package/lib/renderer/font-manifest.json +0 -9
  109. package/lib/renderer/font.less +0 -5
  110. package/lib/renderer/glyphs.d.ts +0 -1
  111. package/lib/renderer/glyphs.js +0 -256
  112. package/lib/renderer/index.module.less +0 -48
  113. package/lib/renderer/overlay.d.ts +0 -4
  114. package/lib/renderer/overlay.js +0 -6
  115. package/lib/renderer/ptzZoom.d.ts +0 -6
  116. package/lib/renderer/ptzZoom.js +0 -3
  117. package/lib/renderer/text.d.ts +0 -4
  118. package/lib/renderer/text.js +0 -32
  119. package/lib/renderer/text.module.less +0 -4
  120. package/lib/renderer/viewport.d.ts +0 -7
  121. package/lib/renderer/viewport.js +0 -24
  122. package/lib/res/lynx-signal/index.d.ts +0 -1
  123. package/lib/res/lynx-signal/index.js +0 -22
  124. package/lib/res/lynx-signal/signalFour0.png +0 -0
  125. package/lib/res/lynx-signal/signalFour1.png +0 -0
  126. package/lib/res/lynx-signal/signalFour2.png +0 -0
  127. package/lib/res/lynx-signal/signalFour3.png +0 -0
  128. package/lib/res/lynx-signal/signalFour4.png +0 -0
  129. package/lib/res/lynx-signal/signalThree0.png +0 -0
  130. package/lib/res/lynx-signal/signalThree1.png +0 -0
  131. package/lib/res/lynx-signal/signalThree2.png +0 -0
  132. package/lib/res/lynx-signal/signalThree3.png +0 -0
  133. package/lib/res/player-charging.png +0 -0
  134. package/lib/res/player-more-arrow.png +0 -0
  135. package/lib/res/player-solar.png +0 -0
  136. package/lib/ui/scrollHintArrow.d.ts +0 -23
  137. package/lib/ui/scrollHintArrow.js +0 -83
  138. package/lib/widgets/battery/statusIcon.d.ts +0 -6
  139. package/lib/widgets/battery/statusIcon.js +0 -36
  140. package/lib/widgets/battery/statusIcon.less +0 -24
  141. package/lib/widgets/captureToast/captureToast.d.ts +0 -9
  142. package/lib/widgets/captureToast/captureToast.js +0 -73
  143. package/lib/widgets/recordVideo/recordVideoTimer.d.ts +0 -3
  144. package/lib/widgets/recordVideo/recordVideoTimer.js +0 -26
  145. package/lib/widgets/zoomTurntable/lynxDockLayout.d.ts +0 -6
  146. package/lib/widgets/zoomTurntable/lynxDockLayout.js +0 -30
  147. package/lib/widgets/zoomTurntable/turntable/lynx.d.ts +0 -5
  148. package/lib/widgets/zoomTurntable/turntable/lynx.js +0 -273
  149. package/lib/widgets/zoomTurntable/turntable/lynx.less +0 -9
  150. package/lib/widgets/zoomTurntable/turntable/lynxModel.d.ts +0 -37
  151. package/lib/widgets/zoomTurntable/turntable/lynxModel.js +0 -122
  152. package/lib/widgets/zoomTurntable/turntable/lynxPaint.d.ts +0 -3
  153. package/lib/widgets/zoomTurntable/turntable/lynxPaint.js +0 -36
@@ -0,0 +1,223 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import { getFileInfo, getFileSystemManager } from '@ray-js/ray';
3
+ import { getCaptureResultSummary } from './captureResult';
4
+ import { getDeviceInfo } from './device';
5
+ jest.mock('@ray-js/ray', () => ({
6
+ getFileInfo: jest.fn(),
7
+ getFileSystemManager: jest.fn()
8
+ }));
9
+ jest.mock('./device', () => ({
10
+ getDeviceInfo: jest.fn()
11
+ }));
12
+ const mockGetDeviceInfo = getDeviceInfo;
13
+ const mockGetFileInfo = getFileInfo;
14
+ const mockGetFileSystemManager = getFileSystemManager;
15
+ const access = jest.fn();
16
+ const basePath = 'https://thing.miniapp.com/__tmp__/capture.png';
17
+ const result = {
18
+ tempImagePath: basePath,
19
+ filePath: basePath
20
+ };
21
+ const options = {
22
+ multiLens: true,
23
+ lensIndices: [1, 2, 3, 4],
24
+ devId: 'dev-1'
25
+ };
26
+ beforeEach(() => {
27
+ jest.resetAllMocks();
28
+ mockGetDeviceInfo.mockResolvedValue({
29
+ configMetas: {}
30
+ });
31
+ mockGetFileSystemManager.mockReturnValue({
32
+ access
33
+ });
34
+ access.mockImplementation(_ref => {
35
+ let {
36
+ success
37
+ } = _ref;
38
+ return success();
39
+ });
40
+ mockGetFileInfo.mockImplementation(() => {
41
+ throw new Error('Source file inspection is forbidden');
42
+ });
43
+ });
44
+ it('counts existing images instead of the configured lens total', async () => {
45
+ access.mockImplementation(_ref2 => {
46
+ let {
47
+ path,
48
+ success,
49
+ fail
50
+ } = _ref2;
51
+ if (path.endsWith('_lens2.png')) fail({
52
+ errorCode: 10011
53
+ });else success();
54
+ });
55
+ await expect(getCaptureResultSummary(result, options)).resolves.toEqual({
56
+ count: 3,
57
+ isMultiLens: true,
58
+ thumbnailPath: 'https://thing.miniapp.com/__tmp__/capture_lens1.png'
59
+ });
60
+ });
61
+ it('uses protocol indices unchanged and selects the first existing image', async () => {
62
+ access.mockImplementation(_ref3 => {
63
+ let {
64
+ path,
65
+ success,
66
+ fail
67
+ } = _ref3;
68
+ if (path === 'https://thing.miniapp.com/__tmp__/capture_lens7.png') success();else fail({
69
+ errorCode: 10011
70
+ });
71
+ });
72
+ await expect(getCaptureResultSummary(result, _objectSpread(_objectSpread({}, options), {}, {
73
+ lensIndices: [2, 7, 9]
74
+ }))).resolves.toEqual({
75
+ count: 1,
76
+ isMultiLens: true,
77
+ thumbnailPath: 'https://thing.miniapp.com/__tmp__/capture_lens7.png'
78
+ });
79
+ });
80
+ it('waits for access callbacks even when the method returns undefined', async () => {
81
+ const callbacks = [];
82
+ access.mockImplementation(_ref4 => {
83
+ let {
84
+ success
85
+ } = _ref4;
86
+ callbacks.push(success);
87
+ });
88
+ const summary = getCaptureResultSummary(result, options);
89
+ await Promise.resolve();
90
+ await Promise.resolve();
91
+ expect(callbacks).toHaveLength(4);
92
+ for (const success of callbacks) success();
93
+ await expect(summary).resolves.toMatchObject({
94
+ count: 4
95
+ });
96
+ });
97
+ it('returns no success summary when every image is missing', async () => {
98
+ access.mockImplementation(_ref5 => {
99
+ let {
100
+ fail
101
+ } = _ref5;
102
+ return fail({
103
+ errorCode: 10011
104
+ });
105
+ });
106
+ await expect(getCaptureResultSummary(result, options)).resolves.toBeNull();
107
+ });
108
+ it('does not duplicate a lens suffix or count duplicate indices', async () => {
109
+ await expect(getCaptureResultSummary({
110
+ tempImagePath: 'thingfile://tmp/capture_lens7.jpg?token=a',
111
+ filePath: ''
112
+ }, _objectSpread(_objectSpread({}, options), {}, {
113
+ lensIndices: [2, 7, 7]
114
+ }))).resolves.toEqual({
115
+ count: 2,
116
+ isMultiLens: true,
117
+ thumbnailPath: 'thingfile://tmp/capture_lens2.jpg?token=a'
118
+ });
119
+ });
120
+ it('reads the original lens indices from the ability when no protocol is supplied', async () => {
121
+ mockGetDeviceInfo.mockResolvedValue({
122
+ configMetas: {
123
+ tyabimr4v3: JSON.stringify({
124
+ split_info: [{
125
+ index: '2'
126
+ }, {
127
+ index: '7'
128
+ }]
129
+ })
130
+ }
131
+ });
132
+ await expect(getCaptureResultSummary(result, {
133
+ multiLens: true,
134
+ devId: 'dev-1'
135
+ })).resolves.toMatchObject({
136
+ count: 2,
137
+ thumbnailPath: basePath.replace('.png', '_lens2.png')
138
+ });
139
+ });
140
+ it('keeps legacy or mono capture unchanged', async () => {
141
+ await expect(getCaptureResultSummary(result, {
142
+ multiLens: false,
143
+ lensIndices: [1],
144
+ devId: 'dev-1'
145
+ })).resolves.toEqual({
146
+ count: 1,
147
+ isMultiLens: false,
148
+ thumbnailPath: basePath
149
+ });
150
+ expect(access).not.toHaveBeenCalled();
151
+ expect(mockGetFileInfo).not.toHaveBeenCalled();
152
+ });
153
+ it('counts recording thumbnails even when the source video path is missing', async () => {
154
+ const recording = {
155
+ tempImagePath: '',
156
+ thumbPath: basePath,
157
+ filePath: '/missing/record.mp4'
158
+ };
159
+ access.mockImplementation(_ref6 => {
160
+ let {
161
+ path,
162
+ success,
163
+ fail
164
+ } = _ref6;
165
+ if (path.endsWith('_lens2.png')) fail({
166
+ errorCode: 10011
167
+ });else success();
168
+ });
169
+ await expect(getCaptureResultSummary(recording, options)).resolves.toEqual({
170
+ count: 3,
171
+ isMultiLens: true,
172
+ thumbnailPath: basePath.replace('.png', '_lens1.png')
173
+ });
174
+ expect(mockGetFileInfo).not.toHaveBeenCalled();
175
+ expect(recording.filePath).toBe('/missing/record.mp4');
176
+ });
177
+ it('does not count source videos when every recording thumbnail is missing', async () => {
178
+ access.mockImplementation(_ref7 => {
179
+ let {
180
+ fail
181
+ } = _ref7;
182
+ return fail({
183
+ errorCode: 10011
184
+ });
185
+ });
186
+ await expect(getCaptureResultSummary(_objectSpread(_objectSpread({}, result), {}, {
187
+ filePath: '/album/record.mp4'
188
+ }), options)).resolves.toBeNull();
189
+ expect(mockGetFileInfo).not.toHaveBeenCalled();
190
+ });
191
+ it('never falls back to a source path when no thumbnail is returned', async () => {
192
+ await expect(getCaptureResultSummary({
193
+ tempImagePath: '',
194
+ filePath: '/album/record.mp4'
195
+ }, options)).resolves.toBeNull();
196
+ expect(access).not.toHaveBeenCalled();
197
+ expect(mockGetFileInfo).not.toHaveBeenCalled();
198
+ });
199
+ it('uses explicit thumbnails ahead of other image paths without renumbering lenses', async () => {
200
+ access.mockImplementation(_ref8 => {
201
+ let {
202
+ path,
203
+ success,
204
+ fail
205
+ } = _ref8;
206
+ if (path === 'thingfile://tmp/record_thumb_lens7.png') success();else fail({
207
+ errorCode: 10011
208
+ });
209
+ });
210
+ const recording = {
211
+ tempImagePath: 'thingfile://tmp/other.png',
212
+ thumbPath: 'thingfile://tmp/record_thumb.png',
213
+ filePath: '/album/record.mp4'
214
+ };
215
+ await expect(getCaptureResultSummary(recording, _objectSpread(_objectSpread({}, options), {}, {
216
+ lensIndices: [2, 7, 9]
217
+ }))).resolves.toEqual({
218
+ count: 1,
219
+ isMultiLens: true,
220
+ thumbnailPath: 'thingfile://tmp/record_thumb_lens7.png'
221
+ });
222
+ expect(recording.filePath).toBe('/album/record.mp4');
223
+ });
@@ -0,0 +1,5 @@
1
+ export type EntryTracking = Record<'utm_source' | 'utm_medium' | 'entry_source_type' | 'utm_rtid', string>;
2
+ export declare const createEntryTracking: (fallbackRtid?: string) => EntryTracking;
3
+ export declare const appendTrackingQuery: (url: string, tracking: EntryTracking) => string;
4
+ export declare const reportEntryView: (devId: string, tracking: EntryTracking) => Promise<void>;
5
+ export declare const reportEntryClick: (devId: string, tracking: EntryTracking) => Promise<void>;
@@ -0,0 +1,71 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
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.for-each.js";
5
+ import { getLaunchOptionsSync } from '@ray-js/ray';
6
+ import { getInitUtmTid } from '@ray-js/ray-ipc-utils';
7
+ export const createEntryTracking = fallbackRtid => {
8
+ let upstreamRtid;
9
+ try {
10
+ var _getLaunchOptionsSync;
11
+ upstreamRtid = (_getLaunchOptionsSync = getLaunchOptionsSync()) === null || _getLaunchOptionsSync === void 0 || (_getLaunchOptionsSync = _getLaunchOptionsSync.query) === null || _getLaunchOptionsSync === void 0 ? void 0 : _getLaunchOptionsSync.utm_rtid;
12
+ } catch (error) {
13
+ // Tracking must not prevent navigation when launch options are unavailable.
14
+ }
15
+ return {
16
+ utm_source: 'miniprogram',
17
+ utm_medium: 'panel_smart_quality',
18
+ entry_source_type: 'organic',
19
+ utm_rtid: upstreamRtid || fallbackRtid || getInitUtmTid()
20
+ };
21
+ };
22
+ export const appendTrackingQuery = (url, tracking) => {
23
+ const hashIndex = url.indexOf('#');
24
+ const base = hashIndex < 0 ? url : url.slice(0, hashIndex);
25
+ const hash = hashIndex < 0 ? '' : url.slice(hashIndex);
26
+ const queryIndex = base.indexOf('?');
27
+ const path = queryIndex < 0 ? base : base.slice(0, queryIndex);
28
+ const params = (queryIndex < 0 ? [] : base.slice(queryIndex + 1).split('&')).filter(param => {
29
+ if (!param) return false;
30
+ return !Object.prototype.hasOwnProperty.call(tracking, decodeURIComponent(param.split('=')[0]));
31
+ });
32
+ Object.entries(tracking).forEach(_ref => {
33
+ let [key, value] = _ref;
34
+ params.push(`${key}=${encodeURIComponent(value)}`);
35
+ });
36
+ return `${path}?${params.join('&')}${hash}`;
37
+ };
38
+ const reportEntry = async (eventType, devId, tracking) => {
39
+ try {
40
+ const {
41
+ homeId
42
+ } = await new Promise((resolve, reject) => {
43
+ ty.home.getCurrentHomeInfo({
44
+ success: resolve,
45
+ fail: reject
46
+ });
47
+ });
48
+ const {
49
+ miniProgram
50
+ } = ty.getAccountInfoSync();
51
+ const event = _objectSpread(_objectSpread({
52
+ project_type: 'cloud_storage',
53
+ event_type: eventType,
54
+ container_type: 'miniapp',
55
+ miniapp_code: miniProgram.appId,
56
+ miniapp_version: miniProgram.version,
57
+ service_type: 'security_cloud_service'
58
+ }, tracking), {}, {
59
+ device_id: devId,
60
+ homeid: homeId
61
+ });
62
+ ty.event({
63
+ eventId: eventType === 'card_view' ? 'ty_XjSozxV0YkDMjzH8orMHx0g2HMc6GQ3q' : 'ty_tUWSmFcHcSetzZd5soRTq6Y3nEYE0RgP',
64
+ event
65
+ });
66
+ } catch (error) {
67
+ console.warn('[IPC] entry tracking failed:', error);
68
+ }
69
+ };
70
+ export const reportEntryView = (devId, tracking) => reportEntry('card_view', devId, tracking);
71
+ export const reportEntryClick = (devId, tracking) => reportEntry('card_click', devId, tracking);
@@ -1,7 +1,8 @@
1
+ import { EntryTracking } from './fullLinkTracking';
1
2
  export declare const miniIdLabs: {
2
3
  aiDrawMini: string;
3
4
  securityCloudService: string;
4
5
  };
5
6
  export declare function gotoAIDrawMiniProgram(devId: string, brandColor: string): void;
6
7
  export declare function gotoSecurityCloudService(homeId: string, uuid: string): Promise<void>;
7
- export declare function gotoSecurityCloudService2(devId: string): Promise<import("@ray-js/ray-ipc-utils/lib/interface").IRes<unknown>>;
8
+ export declare function gotoSecurityCloudService2(devId: string, tracking?: EntryTracking): Promise<import("@ray-js/ray-ipc-utils/lib/interface").IRes<unknown>>;
@@ -1,5 +1,6 @@
1
- import { getServiceUrl, goToMiniProgramByShortLink } from '@ray-js/ray-ipc-utils';
1
+ import { getServiceUrl, goToMiniProgramByShortLink, jumpToWebView } from '@ray-js/ray-ipc-utils';
2
2
  import Color from 'color';
3
+ import { appendTrackingQuery } from './fullLinkTracking';
3
4
 
4
5
  // 小程序ID集合
5
6
  export const miniIdLabs = {
@@ -18,6 +19,15 @@ export async function gotoSecurityCloudService(homeId, uuid) {
18
19
  const url = `godzilla://${miniIdLabs.securityCloudService}${'/pages/serviceList/index'}?homeId=${homeId}&deviceId=${uuid}&categoryCode=${'security_cloud_service'}`;
19
20
  goToMiniProgramByShortLink(url, 'right');
20
21
  }
21
- export async function gotoSecurityCloudService2(devId) {
22
- return getServiceUrl(devId, 'security_cloud_service', {}, true);
22
+ export async function gotoSecurityCloudService2(devId, tracking) {
23
+ var _result$data;
24
+ const serviceType = 'security_cloud_service';
25
+ const params = {};
26
+ if (!tracking) return getServiceUrl(devId, serviceType, params, true);
27
+ const result = await getServiceUrl(devId, serviceType, params, false, tracking.utm_rtid);
28
+ if ((result === null || result === void 0 ? void 0 : result.code) !== 0 || !((_result$data = result.data) !== null && _result$data !== void 0 && _result$data.url)) {
29
+ throw new Error('Failed to fetch the cloud service URL');
30
+ }
31
+ const url = appendTrackingQuery(result.data.url, tracking);
32
+ return result.data.type === 2 ? goToMiniProgramByShortLink(url) : jumpToWebView(url);
23
33
  }
@@ -1,10 +1,8 @@
1
1
  import React, { useMemo } from 'react';
2
- import { View } from '@ray-js/ray';
2
+ import { View, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { PlayerText as Text } from '../../renderer/text';
5
4
  import { useStore } from '../../ctx/store';
6
5
  import { PowerMode } from '../../ports.output';
7
- import { BatteryStatusIcon } from './statusIcon';
8
6
  import './battery.less';
9
7
  export const createBattery = _ref => {
10
8
  let {
@@ -46,8 +44,8 @@ export const createBattery = _ref => {
46
44
  className: clsx(className)
47
45
  }, /*#__PURE__*/React.createElement(View, {
48
46
  className: "ipc-player-plugin-battery"
49
- }, !isSolar && batteryCharging ? /*#__PURE__*/React.createElement(BatteryStatusIcon, {
50
- kind: "charging"
47
+ }, !isSolar && batteryCharging ? /*#__PURE__*/React.createElement(View, {
48
+ className: "icon-panel icon-panel-charging ipc-player-plugin-battery-charging"
51
49
  }) : /*#__PURE__*/React.createElement(View, {
52
50
  className: "ipc-player-plugin-battery-border"
53
51
  }, /*#__PURE__*/React.createElement(View, {
@@ -60,8 +58,8 @@ export const createBattery = _ref => {
60
58
  backgroundColor: batteryColor
61
59
  },
62
60
  className: "ipc-player-plugin-battery-value-value"
63
- })), isSolar && /*#__PURE__*/React.createElement(BatteryStatusIcon, {
64
- kind: "solar"
61
+ })), isSolar && /*#__PURE__*/React.createElement(View, {
62
+ className: "icon-panel icon-panel-solar ipc-player-plugin-battery-solar"
65
63
  })), /*#__PURE__*/React.createElement(Text, {
66
64
  className: "ipc-player-plugin-battery-text"
67
65
  }, batteryValue, "%")));
@@ -1,10 +1,8 @@
1
1
  import React, { useMemo } from 'react';
2
- import { View } from '@ray-js/ray';
2
+ import { View, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { PlayerText as Text } from '../../renderer/text';
5
4
  import { useStore } from '../../ctx/store';
6
5
  import { PowerMode } from '../../ports.output';
7
- import { BatteryStatusIcon } from './statusIcon';
8
6
  import './battery.less';
9
7
  export const createBattery = _ref => {
10
8
  let {
@@ -46,8 +44,8 @@ export const createBattery = _ref => {
46
44
  className: clsx(className)
47
45
  }, /*#__PURE__*/React.createElement(View, {
48
46
  className: "ipc-player-plugin-battery"
49
- }, !isSolar && batteryCharging ? /*#__PURE__*/React.createElement(BatteryStatusIcon, {
50
- kind: "charging"
47
+ }, !isSolar && batteryCharging ? /*#__PURE__*/React.createElement(View, {
48
+ className: "icon-panel icon-panel-charging ipc-player-plugin-battery-charging"
51
49
  }) : /*#__PURE__*/React.createElement(View, {
52
50
  className: "ipc-player-plugin-battery-border"
53
51
  }, /*#__PURE__*/React.createElement(View, {
@@ -60,8 +58,8 @@ export const createBattery = _ref => {
60
58
  backgroundColor: batteryColor
61
59
  },
62
60
  className: "ipc-player-plugin-battery-value-value"
63
- })), isSolar && /*#__PURE__*/React.createElement(BatteryStatusIcon, {
64
- kind: "solar"
61
+ })), isSolar && /*#__PURE__*/React.createElement(View, {
62
+ className: "icon-panel icon-panel-solar ipc-player-plugin-battery-solar"
65
63
  })), /*#__PURE__*/React.createElement(Text, {
66
64
  className: "ipc-player-plugin-battery-text"
67
65
  }, batteryValue, "%")));
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import './captureResult.less';
3
+ export type CaptureKind = 'record' | 'screenshot';
4
+ export interface CaptureResultToastProps {
5
+ brandColor: string;
6
+ kind: CaptureKind;
7
+ thumbnailPath: string;
8
+ onCheck: () => void;
9
+ count?: number;
10
+ /** 自定义标题(可选),不传时使用默认文案 */
11
+ title?: React.ReactNode;
12
+ /** 自定义操作按钮文案(可选),不传时默认为“查看” */
13
+ checkText?: string;
14
+ className?: string;
15
+ }
16
+ export declare function CaptureResultToast({ brandColor, count, kind, onCheck, thumbnailPath, title, checkText, className, }: CaptureResultToastProps): React.JSX.Element;
@@ -0,0 +1,85 @@
1
+ import React from 'react';
2
+ import { Image, Text, View } from '@ray-js/ray';
3
+ import clsx from 'clsx';
4
+ import Strings from '../../i18n';
5
+ import './captureResult.less';
6
+ const BACKDROP_LAYERS = ['back', 'middle'];
7
+ const TEXT_KEYS = {
8
+ record: {
9
+ check: 'ipc_player_record_success_check',
10
+ multi: 'ipc_player_record_multi_success_tip',
11
+ single: 'ipc_player_record_success_tip'
12
+ },
13
+ screenshot: {
14
+ check: 'ipc_player_shot_success_check',
15
+ multi: 'ipc_player_screenshot_multi_success_tip',
16
+ single: 'ipc_player_screenshot_success_tip'
17
+ }
18
+ };
19
+ const LEGACY_CLASS_MAP = {
20
+ record: {
21
+ toast: 'ipc-player-plugin-record-success-toast',
22
+ imageBox: 'ipc-player-plugin-record-success-toast-image-box',
23
+ imageBoxMulti: 'ipc-player-plugin-record-success-toast-image-box-multi',
24
+ image: 'ipc-player-plugin-record-success-toast-image',
25
+ playIconBox: 'ipc-player-plugin-record-success-play-icon-box',
26
+ playIcon: 'ipc-player-plugin-record-success-play-icon',
27
+ title: 'ipc-player-plugin-record-success-toast-title',
28
+ check: 'ipc-player-plugin-record-success-toast-bottom'
29
+ },
30
+ screenshot: {
31
+ toast: 'ipc-player-plugin-screenshot-toast',
32
+ imageBox: 'ipc-player-plugin-screenshot-toast-image-box',
33
+ imageBoxMulti: 'ipc-player-plugin-screenshot-toast-image-box-multi',
34
+ image: 'ipc-player-plugin-screenshot-toast-image',
35
+ playIconBox: '',
36
+ playIcon: '',
37
+ title: 'ipc-player-plugin-screenshot-toast-title',
38
+ check: 'ipc-player-plugin-screenshot-toast-bottom'
39
+ }
40
+ };
41
+ export function CaptureResultToast(_ref) {
42
+ let {
43
+ brandColor,
44
+ count = 0,
45
+ kind,
46
+ onCheck,
47
+ thumbnailPath,
48
+ title,
49
+ checkText,
50
+ className
51
+ } = _ref;
52
+ const isMultiLens = count > 1;
53
+ const textKeys = TEXT_KEYS[kind];
54
+ const legacyCls = LEGACY_CLASS_MAP[kind];
55
+ const imageClassName = clsx('ipc-player-plugin-capture-result-image', legacyCls.image);
56
+ return /*#__PURE__*/React.createElement(View, {
57
+ className: clsx('ipc-player-plugin-capture-result-toast', legacyCls.toast, className)
58
+ }, /*#__PURE__*/React.createElement(View, {
59
+ className: clsx('ipc-player-plugin-capture-result-image-box', legacyCls.imageBox, isMultiLens && ['ipc-player-plugin-capture-result-image-box-multi', legacyCls.imageBoxMulti])
60
+ }, isMultiLens ? /*#__PURE__*/React.createElement(React.Fragment, null, BACKDROP_LAYERS.map(layer => /*#__PURE__*/React.createElement(View, {
61
+ key: layer,
62
+ className: clsx('ipc-player-plugin-capture-result-backdrop', `ipc-player-plugin-capture-result-image-${layer}`)
63
+ })), /*#__PURE__*/React.createElement(Image, {
64
+ className: clsx(imageClassName, 'ipc-player-plugin-capture-result-image-front'),
65
+ src: thumbnailPath
66
+ })) : /*#__PURE__*/React.createElement(Image, {
67
+ className: imageClassName,
68
+ src: thumbnailPath
69
+ }), kind === 'record' && /*#__PURE__*/React.createElement(View, {
70
+ className: clsx('ipc-player-plugin-capture-result-play-icon-box', legacyCls.playIconBox)
71
+ }, /*#__PURE__*/React.createElement(Text, {
72
+ className: clsx('icon-panel', 'icon-panel-record-play', 'ipc-player-plugin-capture-result-play-icon', legacyCls.playIcon)
73
+ }))), /*#__PURE__*/React.createElement(View, {
74
+ className: clsx('ipc-player-plugin-capture-result-title', legacyCls.title)
75
+ }, title ? typeof title === 'string' ? /*#__PURE__*/React.createElement(Text, null, title) : title : count > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, null, Strings.getLang(textKeys.multi)), /*#__PURE__*/React.createElement(Text, {
76
+ className: "ipc-player-plugin-capture-result-count"
77
+ }, Strings.formatString(Strings.getLang('ipc_player_multi_capture_success_count'), count))) : Strings.getLang(textKeys.single)), /*#__PURE__*/React.createElement(View, {
78
+ onClick: onCheck,
79
+ className: clsx('ipc-player-plugin-capture-result-check', legacyCls.check),
80
+ style: {
81
+ color: brandColor,
82
+ borderColor: brandColor
83
+ }
84
+ }, checkText || Strings.getLang(textKeys.check)));
85
+ }
@@ -0,0 +1,144 @@
1
+ .ipc-player-plugin-capture-result-toast,
2
+ .ipc-player-plugin-record-success-toast,
3
+ .ipc-player-plugin-screenshot-toast {
4
+ --capture-result-text-color: var(--fontColor, #fff);
5
+ --capture-result-near-backdrop-color: rgba(255, 255, 255, 0.2);
6
+ --capture-result-far-backdrop-color: rgba(255, 255, 255, 0.1);
7
+
8
+ z-index: 100;
9
+ display: flex;
10
+ flex: 1;
11
+ align-items: center;
12
+ padding: calc(7px * var(--ipc-player-size-scale, 1))
13
+ calc(16px * var(--ipc-player-size-scale, 1))
14
+ calc(7px * var(--ipc-player-size-scale, 1))
15
+ calc(12px * var(--ipc-player-size-scale, 1));
16
+ background-color: var(--shot-card-bg-color);
17
+ border-radius: calc(8px * var(--ipc-player-size-scale, 1));
18
+ }
19
+
20
+ :root[theme='light'] .ipc-player-plugin-capture-result-toast {
21
+ --capture-result-text-color: #1a1a1a;
22
+ --capture-result-near-backdrop-color: rgba(0, 0, 0, 0.1);
23
+ --capture-result-far-backdrop-color: rgba(0, 0, 0, 0.05);
24
+
25
+ background-color: #fff;
26
+ }
27
+
28
+ .ipc-player-plugin-capture-result-image-box,
29
+ .ipc-player-plugin-record-success-toast-image-box,
30
+ .ipc-player-plugin-screenshot-toast-image-box {
31
+ position: relative;
32
+ width: calc(66px * var(--ipc-player-size-scale, 1));
33
+ height: calc(39px * var(--ipc-player-size-scale, 1));
34
+ overflow: hidden;
35
+ border-radius: calc(4px * var(--ipc-player-size-scale, 1));
36
+ }
37
+
38
+ .ipc-player-plugin-capture-result-image,
39
+ .ipc-player-plugin-record-success-toast-image,
40
+ .ipc-player-plugin-screenshot-toast-image {
41
+ width: 100%;
42
+ height: 100%;
43
+ object-fit: cover;
44
+ }
45
+
46
+ .ipc-player-plugin-capture-result-backdrop,
47
+ .ipc-player-plugin-capture-result-image-front {
48
+ position: absolute;
49
+ box-sizing: border-box;
50
+ border-radius: calc(4px * var(--ipc-player-size-scale, 1));
51
+ }
52
+
53
+ .ipc-player-plugin-capture-result-image-back {
54
+ top: calc(1px * var(--ipc-player-size-scale, 1));
55
+ left: calc(5px * var(--ipc-player-size-scale, 1));
56
+ z-index: 1;
57
+ width: calc(56px * var(--ipc-player-size-scale, 1));
58
+ height: calc(28px * var(--ipc-player-size-scale, 1));
59
+ background: var(--capture-result-far-backdrop-color);
60
+ }
61
+
62
+ .ipc-player-plugin-capture-result-image-middle {
63
+ top: calc(3px * var(--ipc-player-size-scale, 1));
64
+ left: calc(2.5px * var(--ipc-player-size-scale, 1));
65
+ z-index: 2;
66
+ width: calc(61px * var(--ipc-player-size-scale, 1));
67
+ height: calc(30.5px * var(--ipc-player-size-scale, 1));
68
+ background: var(--capture-result-near-backdrop-color);
69
+ }
70
+
71
+ .ipc-player-plugin-capture-result-image-front {
72
+ top: calc(5px * var(--ipc-player-size-scale, 1));
73
+ left: 0;
74
+ z-index: 3;
75
+ width: calc(66px * var(--ipc-player-size-scale, 1));
76
+ height: calc(33px * var(--ipc-player-size-scale, 1));
77
+ }
78
+
79
+ .ipc-player-plugin-capture-result-play-icon-box,
80
+ .ipc-player-plugin-record-success-play-icon-box {
81
+ position: absolute;
82
+ top: 50%;
83
+ left: 50%;
84
+ z-index: 4;
85
+ display: flex;
86
+ align-items: center;
87
+ justify-content: center;
88
+ width: calc(16px * var(--ipc-player-size-scale, 1));
89
+ height: calc(16px * var(--ipc-player-size-scale, 1));
90
+ overflow: hidden;
91
+ background-color: rgba(0, 0, 0, 0.2);
92
+ border-radius: 50%;
93
+ transform: translate(-50%, -50%);
94
+ }
95
+
96
+ .ipc-player-plugin-capture-result-image-box-multi
97
+ .ipc-player-plugin-capture-result-play-icon-box {
98
+ top: calc(50% + 2px * var(--ipc-player-size-scale, 1));
99
+ }
100
+
101
+ .ipc-player-plugin-capture-result-play-icon,
102
+ .ipc-player-plugin-record-success-play-icon {
103
+ color: #ffffff;
104
+ font-size: calc(9px * var(--ipc-player-size-scale, 1)) !important;
105
+ }
106
+
107
+ .ipc-player-plugin-capture-result-title,
108
+ .ipc-player-plugin-record-success-toast-title,
109
+ .ipc-player-plugin-screenshot-toast-title {
110
+ display: flex;
111
+ flex: 1;
112
+ flex-direction: column;
113
+ min-width: 0;
114
+ margin-right: calc(12px * var(--ipc-player-size-scale, 1));
115
+ margin-left: calc(8px * var(--ipc-player-size-scale, 1));
116
+ color: var(--capture-result-text-color, var(--fontColor));
117
+ font-size: calc(14px * var(--ipc-player-size-scale, 1));
118
+ line-height: calc(20px * var(--ipc-player-size-scale, 1));
119
+ word-break: break-word;
120
+ }
121
+
122
+ .ipc-player-plugin-capture-result-count {
123
+ margin-top: calc(2px * var(--ipc-player-size-scale, 1));
124
+ color: var(--capture-result-text-color, var(--fontColor));
125
+ font-size: calc(12px * var(--ipc-player-size-scale, 1));
126
+ line-height: calc(17px * var(--ipc-player-size-scale, 1));
127
+ opacity: 0.5;
128
+ }
129
+
130
+ .ipc-player-plugin-capture-result-check,
131
+ .ipc-player-plugin-record-success-toast-bottom,
132
+ .ipc-player-plugin-screenshot-toast-bottom {
133
+ min-width: calc(52px * var(--ipc-player-size-scale, 1));
134
+ max-width: calc(100px * var(--ipc-player-size-scale, 1));
135
+ flex-shrink: 0;
136
+ padding: calc(5px * var(--ipc-player-size-scale, 1))
137
+ calc(11px * var(--ipc-player-size-scale, 1));
138
+ overflow: hidden;
139
+ font-size: calc(14px * var(--ipc-player-size-scale, 1));
140
+ white-space: nowrap;
141
+ text-overflow: ellipsis;
142
+ border: 1px solid #1989fa;
143
+ border-radius: calc(4px * var(--ipc-player-size-scale, 1));
144
+ }
@@ -0,0 +1 @@
1
+ export {};