@ray-js/ipc-player-integration 0.0.53-beta.9 → 0.0.55-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 (42) hide show
  1. package/lib/ctx/ctx.composition.js +3 -13
  2. package/lib/ctx/ctx.js +32 -160
  3. package/lib/i18n/index.d.ts +0 -32
  4. package/lib/i18n/strings.d.ts +0 -16
  5. package/lib/i18n/strings.js +0 -16
  6. package/lib/interface.d.ts +4 -19
  7. package/lib/ui/ui.js +25 -75
  8. package/lib/utils/authorize/album.d.ts +1 -0
  9. package/lib/utils/authorize/album.js +39 -0
  10. package/lib/utils/authorize/album.test.js +82 -0
  11. package/lib/utils/ttt.d.ts +0 -26
  12. package/lib/utils/ttt.js +2 -109
  13. package/lib/widgets/index.d.ts +0 -1
  14. package/lib/widgets/index.js +1 -2
  15. package/lib/widgets/recordVideo/recordVideo.js +40 -50
  16. package/lib/widgets/recordVideo/recordVideo.less +74 -17
  17. package/lib/widgets/recordVideo/recordVideo.test.js +58 -0
  18. package/lib/widgets/resolution/resolution.js +1 -0
  19. package/lib/widgets/screenshot/screenshot.js +44 -97
  20. package/lib/widgets/screenshot/screenshot.less +40 -1
  21. package/lib/widgets/videoBitKBP/videoBitKBP.js +9 -38
  22. package/lib/widgets/videoBitKBP/videoBitKBP.less +0 -6
  23. package/package.json +2 -2
  24. package/lib/ctx/ctx.autoClarity.test.js +0 -150
  25. package/lib/ui/absoluteContent.d.ts +0 -2
  26. package/lib/ui/absoluteContent.js +0 -3
  27. package/lib/utils/captureResult.d.ts +0 -14
  28. package/lib/utils/captureResult.js +0 -70
  29. package/lib/utils/captureResult.test.js +0 -117
  30. package/lib/utils/ttt.autoClarity.test.d.ts +0 -1
  31. package/lib/utils/ttt.autoClarity.test.js +0 -75
  32. package/lib/widgets/captureResult/captureResult.d.ts +0 -16
  33. package/lib/widgets/captureResult/captureResult.js +0 -85
  34. package/lib/widgets/captureResult/captureResult.less +0 -144
  35. package/lib/widgets/captureResult/captureResult.test.d.ts +0 -1
  36. package/lib/widgets/captureResult/captureResult.test.js +0 -80
  37. package/lib/widgets/captureResult/index.d.ts +0 -2
  38. package/lib/widgets/captureResult/index.js +0 -2
  39. package/lib/widgets/videoBitKBP/videoBitKBP.test.d.ts +0 -1
  40. package/lib/widgets/videoBitKBP/videoBitKBP.test.js +0 -81
  41. /package/lib/{ctx/ctx.autoClarity.test.d.ts → utils/authorize/album.test.d.ts} +0 -0
  42. /package/lib/{utils/captureResult.test.d.ts → widgets/recordVideo/recordVideo.test.d.ts} +0 -0
@@ -1,150 +0,0 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import { act, renderHook } from '@testing-library/react-hooks';
3
- import { ClarityType } from '@ray-js/ray-ipc-utils/lib/interface';
4
- import { createUseCtx } from './ctx';
5
- import { useStore } from './store';
6
- import { PlayState } from '../interface';
7
- import { getCachedAutoClarity, setCachedAutoClarity, subscribeClarityChanged } from '../utils/ttt';
8
- jest.mock('@ray-js/ray', () => ({}));
9
- jest.mock('@ray-js/ray-ipc-utils/lib/interface', () => ({
10
- ClarityType: {
11
- SS: 'SS',
12
- SD: 'SD',
13
- HD: 'HD',
14
- UD: 'UD',
15
- SSP: 'SSP',
16
- AUTO: 'AUTO',
17
- AUDIO: 'AUDIO'
18
- },
19
- IntercomMode: {
20
- OneWay: 'OneWay',
21
- TwoWay: 'TwoWay'
22
- }
23
- }));
24
- jest.mock('../i18n', () => ({
25
- __esModule: true,
26
- default: {
27
- getLang: key => key
28
- }
29
- }));
30
- jest.mock('./multiCameraCtx', () => ({
31
- isMultiCameraTileSupported: () => false,
32
- useMultiCameraCtx: () => ({})
33
- }));
34
- jest.mock('../utils/ttt', () => ({
35
- getCachedAutoClarity: jest.fn(),
36
- isClarityChangedSupported: () => true,
37
- setCachedAutoClarity: jest.fn(),
38
- subscribeClarityChanged: jest.fn(() => () => undefined)
39
- }));
40
- const cameraState = resolution => ({
41
- resolution,
42
- resolutionList: [ClarityType.HD, ClarityType.SD],
43
- mute: true,
44
- intercomMode: 'TwoWay',
45
- isIntercomSupported: false,
46
- maxZoomSettings: 6
47
- });
48
- describe('cached auto clarity restoration', () => {
49
- beforeEach(() => {
50
- jest.clearAllMocks();
51
- });
52
- const mountContext = resolution => {
53
- const setClarity = jest.fn();
54
- const getMemoryState = jest.fn().mockResolvedValue(cameraState(resolution));
55
- const useCtx = createUseCtx({
56
- createPlayContext: () => ({
57
- setClarity
58
- }),
59
- getMemoryState,
60
- setResolutionMemoryState: jest.fn(),
61
- setMuteMemoryState: jest.fn(),
62
- authorizeStatus: jest.fn(),
63
- toast: jest.fn()
64
- });
65
- const hook = renderHook(() => {
66
- const ctx = useCtx({
67
- devId: 'camera-1'
68
- });
69
- const state = useStore({
70
- resolution: ctx.resolution,
71
- autoClarity: ctx.autoClarity
72
- });
73
- return _objectSpread(_objectSpread({}, ctx), {}, {
74
- state
75
- });
76
- });
77
- return _objectSpread(_objectSpread({}, hook), {}, {
78
- setClarity
79
- });
80
- };
81
- it('shows last listener value on reopening AUTO and refreshes it after preview', async () => {
82
- getCachedAutoClarity.mockReturnValue(ClarityType.HD);
83
- const {
84
- result,
85
- setClarity,
86
- unmount
87
- } = mountContext(ClarityType.AUTO);
88
- await act(async () => Promise.resolve());
89
- expect(result.current.state).toEqual({
90
- resolution: ClarityType.AUTO,
91
- autoClarity: ClarityType.HD
92
- });
93
- act(() => result.current.setPlayState(PlayState.PLAYING));
94
- await act(async () => Promise.resolve());
95
- expect(setClarity).toHaveBeenCalledTimes(1);
96
- expect(setClarity).toHaveBeenCalledWith(expect.objectContaining({
97
- clarity: 'auto'
98
- }));
99
- const onReport = subscribeClarityChanged.mock.calls[0][1];
100
- act(() => onReport({
101
- deviceId: 'camera-1',
102
- clarity: ClarityType.SD
103
- }));
104
- expect(result.current.state.autoClarity).toBe(ClarityType.SD);
105
- expect(setCachedAutoClarity).toHaveBeenCalledWith('camera-1', ClarityType.SD);
106
- unmount();
107
- });
108
- it('does not restore cached actual clarity in manual mode', async () => {
109
- getCachedAutoClarity.mockReturnValue(ClarityType.HD);
110
- const {
111
- result,
112
- unmount
113
- } = mountContext(ClarityType.SD);
114
- await act(async () => Promise.resolve());
115
- expect(result.current.state).toEqual({
116
- resolution: ClarityType.SD,
117
- autoClarity: null
118
- });
119
- expect(getCachedAutoClarity).not.toHaveBeenCalled();
120
- const onReport = subscribeClarityChanged.mock.calls[0][1];
121
- act(() => onReport({
122
- deviceId: 'camera-1',
123
- clarity: ClarityType.HD
124
- }));
125
- expect(result.current.state.autoClarity).toBeNull();
126
- expect(setCachedAutoClarity).not.toHaveBeenCalled();
127
- unmount();
128
- });
129
- it('requests a fresh report when reopening AUTO without an actual clarity cache', async () => {
130
- getCachedAutoClarity.mockReturnValue(null);
131
- const {
132
- result,
133
- setClarity,
134
- unmount
135
- } = mountContext(ClarityType.AUTO);
136
- await act(async () => Promise.resolve());
137
- expect(result.current.state.autoClarity).toBeNull();
138
- act(() => result.current.setPlayState(PlayState.PLAYING));
139
- expect(setClarity).toHaveBeenCalledWith(expect.objectContaining({
140
- clarity: 'auto'
141
- }));
142
- const onReport = subscribeClarityChanged.mock.calls[0][1];
143
- act(() => onReport({
144
- deviceId: 'camera-1',
145
- clarity: ClarityType.HD
146
- }));
147
- expect(result.current.state.autoClarity).toBe(ClarityType.HD);
148
- unmount();
149
- });
150
- });
@@ -1,2 +0,0 @@
1
- import type { ComponentConfig, ComponentRenderState } from '../interface';
2
- export declare function shouldRenderContent<T>(item: ComponentConfig<T>, state: ComponentRenderState): boolean;
@@ -1,3 +0,0 @@
1
- export function shouldRenderContent(item, state) {
2
- return !item.hidden && (!item.renderWhen || item.renderWhen(state));
3
- }
@@ -1,14 +0,0 @@
1
- import type { CaptureResult } from '../interface';
2
- export type CaptureResultSummary = {
3
- count: number;
4
- isMultiLens: boolean;
5
- thumbnailPath: string;
6
- };
7
- export type CaptureResultOptions = {
8
- multiLens: boolean;
9
- protocolCount?: number | string;
10
- devId: string;
11
- };
12
- /** 从新多目高级能力配置获取当前设备的总镜头数 */
13
- export declare function getMultiLensCountFromAbility(devId: string): Promise<number>;
14
- export declare function getCaptureResultSummary(result: CaptureResult, { multiLens, protocolCount, devId }: CaptureResultOptions): Promise<CaptureResultSummary | null>;
@@ -1,70 +0,0 @@
1
- /* eslint-disable camelcase */
2
-
3
- import { getDeviceInfo } from './device';
4
- const MULTI_LENS_ABILITY_CODE = 'tyabimr4v3';
5
- const LENS_SUFFIX_PATTERN = /_lens\d+(?=\.[^./?#]+(?:[?#].*)?$)/;
6
- const FILE_EXTENSION_PATTERN = /(\.[^./?#]+)([?#].*)?$/;
7
- /** 从新多目高级能力配置获取当前设备的总镜头数 */
8
- export async function getMultiLensCountFromAbility(devId) {
9
- if (!devId) return 0;
10
- try {
11
- var _devInfo$configMetas;
12
- const devInfo = await getDeviceInfo(devId);
13
- const raw = devInfo === null || devInfo === void 0 || (_devInfo$configMetas = devInfo.configMetas) === null || _devInfo$configMetas === void 0 ? void 0 : _devInfo$configMetas[MULTI_LENS_ABILITY_CODE];
14
- if (raw) {
15
- const parsed = typeof raw === 'string' ? JSON.parse(raw) : raw;
16
- const count = Number(parsed === null || parsed === void 0 ? void 0 : parsed.total_split_num) || (Array.isArray(parsed === null || parsed === void 0 ? void 0 : parsed.split_info) ? parsed.split_info.length : 0);
17
- if (count > 1) {
18
- return count;
19
- }
20
- }
21
- } catch (e) {
22
- // ignore
23
- }
24
- return 0;
25
- }
26
- const normalizeMultiLensThumbnailPath = path => {
27
- if (!path || LENS_SUFFIX_PATTERN.test(path)) return path;
28
- return path.replace(FILE_EXTENSION_PATTERN, '_lens1$1$2');
29
- };
30
- const extractPath = item => {
31
- if (!item) return '';
32
- if (typeof item === 'string') return item;
33
- if (typeof (item === null || item === void 0 ? void 0 : item.value) === 'string') return item.value;
34
- return '';
35
- };
36
- export async function getCaptureResultSummary(result, _ref) {
37
- let {
38
- multiLens,
39
- protocolCount,
40
- devId
41
- } = _ref;
42
- if (!result || typeof result === 'boolean') return null;
43
- const thumbnailPath = extractPath(result.tempImagePath) || extractPath(result.thumbPath) || extractPath(result.filePath) || '';
44
- if (!multiLens) {
45
- return {
46
- count: 1,
47
- isMultiLens: false,
48
- thumbnailPath
49
- };
50
- }
51
- const splitCount = Number(protocolCount) > 1 ? Number(protocolCount) : 0;
52
- const multiLensAbilityCount = await getMultiLensCountFromAbility(devId);
53
-
54
- // The native multi-lens snapshot can return one object while writing lens-specific
55
- // files. Use the ability result to distinguish that file-name convention from the
56
- // legacy split protocol.
57
- const multiCount = splitCount || multiLensAbilityCount;
58
- if (multiCount > 1) {
59
- return {
60
- count: multiCount,
61
- isMultiLens: true,
62
- thumbnailPath: multiLensAbilityCount > 1 ? normalizeMultiLensThumbnailPath(thumbnailPath) : thumbnailPath
63
- };
64
- }
65
- return {
66
- count: 1,
67
- isMultiLens: false,
68
- thumbnailPath
69
- };
70
- }
@@ -1,117 +0,0 @@
1
- import { getCaptureResultSummary } from './captureResult';
2
- import { getDeviceInfo } from './device';
3
- jest.mock('./device', () => ({
4
- getDeviceInfo: jest.fn()
5
- }));
6
- const mockGetDeviceInfo = getDeviceInfo;
7
- const basePath = 'thingfile://tmp/capture_123.jpg';
8
- const createCaptureResult = tempImagePath => ({
9
- tempImagePath,
10
- filePath: tempImagePath
11
- });
12
- describe('getCaptureResultSummary', () => {
13
- beforeEach(() => {
14
- mockGetDeviceInfo.mockReset();
15
- mockGetDeviceInfo.mockResolvedValue({
16
- configMetas: {}
17
- });
18
- });
19
- it('normalizes the thumbnail path for the new multi-lens ability', async () => {
20
- mockGetDeviceInfo.mockResolvedValue({
21
- configMetas: {
22
- tyabimr4v3: {
23
- total_split_num: 4
24
- }
25
- }
26
- });
27
- await expect(getCaptureResultSummary(createCaptureResult(basePath), {
28
- multiLens: true,
29
- devId: 'dev-1'
30
- })).resolves.toEqual({
31
- count: 4,
32
- isMultiLens: true,
33
- thumbnailPath: 'thingfile://tmp/capture_123_lens1.jpg'
34
- });
35
- });
36
- it('keeps the single-lens result for a legacy multi-camera device', async () => {
37
- await expect(getCaptureResultSummary(createCaptureResult(basePath), {
38
- multiLens: false,
39
- protocolCount: 4,
40
- devId: 'dev-1'
41
- })).resolves.toEqual({
42
- count: 1,
43
- isMultiLens: false,
44
- thumbnailPath: basePath
45
- });
46
- expect(mockGetDeviceInfo).not.toHaveBeenCalled();
47
- });
48
- it('uses the protocol count when the multi-lens mode is enabled', async () => {
49
- await expect(getCaptureResultSummary(createCaptureResult(basePath), {
50
- multiLens: true,
51
- protocolCount: 4,
52
- devId: 'dev-1'
53
- })).resolves.toEqual({
54
- count: 4,
55
- isMultiLens: true,
56
- thumbnailPath: basePath
57
- });
58
- expect(mockGetDeviceInfo).toHaveBeenCalledWith('dev-1');
59
- });
60
- it('uses the lens path when both multi-lens sources are present', async () => {
61
- mockGetDeviceInfo.mockResolvedValue({
62
- configMetas: {
63
- tyabimr4v3: {
64
- total_split_num: 4
65
- }
66
- }
67
- });
68
- await expect(getCaptureResultSummary(createCaptureResult(basePath), {
69
- multiLens: true,
70
- protocolCount: 4,
71
- devId: 'dev-1'
72
- })).resolves.toEqual({
73
- count: 4,
74
- isMultiLens: true,
75
- thumbnailPath: 'thingfile://tmp/capture_123_lens1.jpg'
76
- });
77
- });
78
- it('does not add a duplicate lens suffix', async () => {
79
- mockGetDeviceInfo.mockResolvedValue({
80
- configMetas: {
81
- tyabimr4v3: JSON.stringify({
82
- total_split_num: 4
83
- })
84
- }
85
- });
86
- const path = 'thingfile://tmp/capture_123_lens1.jpg';
87
- await expect(getCaptureResultSummary(createCaptureResult(path), {
88
- multiLens: true,
89
- devId: 'dev-1'
90
- })).resolves.toEqual({
91
- count: 4,
92
- isMultiLens: true,
93
- thumbnailPath: path
94
- });
95
- });
96
- it('keeps a mono result unchanged', async () => {
97
- await expect(getCaptureResultSummary(createCaptureResult(basePath), {
98
- multiLens: false,
99
- devId: 'dev-1'
100
- })).resolves.toEqual({
101
- count: 1,
102
- isMultiLens: false,
103
- thumbnailPath: basePath
104
- });
105
- });
106
- it('keeps a single-lens result when multi-lens mode has one lens', async () => {
107
- await expect(getCaptureResultSummary(createCaptureResult(basePath), {
108
- multiLens: true,
109
- protocolCount: 1,
110
- devId: 'dev-1'
111
- })).resolves.toEqual({
112
- count: 1,
113
- isMultiLens: false,
114
- thumbnailPath: basePath
115
- });
116
- });
117
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,75 +0,0 @@
1
- import { ClarityType } from '@ray-js/ray-ipc-utils/lib/interface';
2
- import { getCachedAutoClarity, setCachedAutoClarity, subscribeClarityChanged } from './ttt';
3
- jest.mock('@ray-js/ray-ipc-utils/lib/interface', () => ({
4
- ClarityType: {
5
- SS: 'SS',
6
- SD: 'SD',
7
- HD: 'HD',
8
- UD: 'UD',
9
- SSP: 'SSP',
10
- AUTO: 'AUTO',
11
- AUDIO: 'AUDIO'
12
- }
13
- }));
14
- describe('auto clarity cache and listener', () => {
15
- const storage = new Map();
16
- let listener;
17
- beforeEach(() => {
18
- storage.clear();
19
- globalThis.ty = {
20
- getStorageSync: jest.fn(_ref => {
21
- let {
22
- key
23
- } = _ref;
24
- return storage.get(key);
25
- }),
26
- setStorageSync: jest.fn(_ref2 => {
27
- let {
28
- key,
29
- data
30
- } = _ref2;
31
- return storage.set(key, data);
32
- }),
33
- ipc: {
34
- onClarityChanged: jest.fn(callback => {
35
- listener = callback;
36
- }),
37
- offClarityChanged: jest.fn()
38
- }
39
- };
40
- });
41
- it('restores the last reported actual clarity only for its device', () => {
42
- setCachedAutoClarity('camera-1', ClarityType.HD);
43
- expect(getCachedAutoClarity('camera-1')).toBe(ClarityType.HD);
44
- expect(getCachedAutoClarity('camera-2')).toBeNull();
45
- setCachedAutoClarity('camera-1', ClarityType.AUTO);
46
- expect(getCachedAutoClarity('camera-1')).toBe(ClarityType.HD);
47
- globalThis.ty.getStorageSync = jest.fn(() => ({
48
- data: ClarityType.SD
49
- }));
50
- expect(getCachedAutoClarity('camera-1')).toBe(ClarityType.SD);
51
- });
52
- it('accepts a new actual clarity report for the same device', () => {
53
- const handler = jest.fn();
54
- const unsubscribe = subscribeClarityChanged('camera-1', handler);
55
- listener({
56
- deviceId: 'camera-2',
57
- clarity: ClarityType.SD
58
- });
59
- listener({
60
- deviceId: 'camera-1',
61
- clarity: ClarityType.AUTO
62
- });
63
- listener({
64
- deviceId: 'camera-1',
65
- clarity: ClarityType.SD
66
- });
67
- expect(handler).toHaveBeenCalledTimes(1);
68
- expect(handler).toHaveBeenCalledWith({
69
- deviceId: 'camera-1',
70
- clarity: ClarityType.SD
71
- });
72
- unsubscribe();
73
- expect(globalThis.ty.ipc.offClarityChanged).toHaveBeenCalledWith(listener);
74
- });
75
- });
@@ -1,16 +0,0 @@
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;
@@ -1,85 +0,0 @@
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 : isMultiLens ? /*#__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
- }
@@ -1,144 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export {};