@ray-js/ipc-player-integration 0.0.52-beta.1 → 0.0.52-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,16 @@
1
1
  import React from 'react';
2
2
  import './captureResult.less';
3
- type CaptureKind = 'record' | 'screenshot';
4
- type Props = {
3
+ export type CaptureKind = 'record' | 'screenshot';
4
+ export interface CaptureResultToastProps {
5
5
  brandColor: string;
6
- count: number;
7
6
  kind: CaptureKind;
8
- onCheck: () => void;
9
7
  thumbnailPath: string;
10
- };
11
- export declare function CaptureResultToast({ brandColor, count, kind, onCheck, thumbnailPath }: Props): React.JSX.Element;
12
- export {};
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;
@@ -18,47 +18,72 @@ const TEXT_KEYS = {
18
18
  single: 'ipc_player_screenshot_success_tip'
19
19
  }
20
20
  };
21
+ const LEGACY_CLASS_MAP = {
22
+ record: {
23
+ toast: 'ipc-player-plugin-record-success-toast',
24
+ imageBox: 'ipc-player-plugin-record-success-toast-image-box',
25
+ imageBoxMulti: 'ipc-player-plugin-record-success-toast-image-box-multi',
26
+ image: 'ipc-player-plugin-record-success-toast-image',
27
+ playIconBox: 'ipc-player-plugin-record-success-play-icon-box',
28
+ playIcon: 'ipc-player-plugin-record-success-play-icon',
29
+ title: 'ipc-player-plugin-record-success-toast-title',
30
+ check: 'ipc-player-plugin-record-success-toast-bottom'
31
+ },
32
+ screenshot: {
33
+ toast: 'ipc-player-plugin-screenshot-toast',
34
+ imageBox: 'ipc-player-plugin-screenshot-toast-image-box',
35
+ imageBoxMulti: 'ipc-player-plugin-screenshot-toast-image-box-multi',
36
+ image: 'ipc-player-plugin-screenshot-toast-image',
37
+ playIconBox: '',
38
+ playIcon: '',
39
+ title: 'ipc-player-plugin-screenshot-toast-title',
40
+ check: 'ipc-player-plugin-screenshot-toast-bottom'
41
+ }
42
+ };
21
43
  export function CaptureResultToast(_ref) {
22
44
  let {
23
45
  brandColor,
24
- count,
46
+ count = 0,
25
47
  kind,
26
48
  onCheck,
27
- thumbnailPath
49
+ thumbnailPath,
50
+ title,
51
+ checkText,
52
+ className
28
53
  } = _ref;
29
- const isMultiLens = count > 0;
54
+ const isMultiLens = count > 1;
30
55
  const textKeys = TEXT_KEYS[kind];
56
+ const legacyCls = LEGACY_CLASS_MAP[kind];
57
+ const imageClassName = clsx('ipc-player-plugin-capture-result-image', legacyCls.image);
31
58
  return /*#__PURE__*/React.createElement(View, {
32
- className: "ipc-player-plugin-capture-result-toast"
59
+ className: clsx('ipc-player-plugin-capture-result-toast', legacyCls.toast, className)
33
60
  }, /*#__PURE__*/React.createElement(View, {
34
- className: clsx('ipc-player-plugin-capture-result-image-box', {
35
- 'ipc-player-plugin-capture-result-image-box-multi': isMultiLens
36
- })
61
+ className: clsx('ipc-player-plugin-capture-result-image-box', legacyCls.imageBox, isMultiLens && ['ipc-player-plugin-capture-result-image-box-multi', legacyCls.imageBoxMulti])
37
62
  }, isMultiLens ? THUMBNAIL_LAYERS.slice(0, count).map((layer, index) => /*#__PURE__*/React.createElement(Image, {
38
63
  key: layer,
39
- className: "ipc-player-plugin-capture-result-image",
64
+ className: imageClassName,
40
65
  src: thumbnailPath,
41
66
  style: {
42
67
  left: `${index * 5}px`,
43
68
  zIndex: index + 1
44
69
  }
45
70
  })) : /*#__PURE__*/React.createElement(Image, {
46
- className: "ipc-player-plugin-capture-result-image",
71
+ className: imageClassName,
47
72
  src: thumbnailPath
48
73
  }), kind === 'record' && /*#__PURE__*/React.createElement(View, {
49
- className: "ipc-player-plugin-capture-result-play-icon-box"
74
+ className: clsx('ipc-player-plugin-capture-result-play-icon-box', legacyCls.playIconBox)
50
75
  }, /*#__PURE__*/React.createElement(Text, {
51
- className: clsx('icon-panel', 'icon-panel-record-play', 'ipc-player-plugin-capture-result-play-icon')
76
+ className: clsx('icon-panel', 'icon-panel-record-play', 'ipc-player-plugin-capture-result-play-icon', legacyCls.playIcon)
52
77
  }))), /*#__PURE__*/React.createElement(View, {
53
- className: "ipc-player-plugin-capture-result-title"
54
- }, isMultiLens ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, null, Strings.getLang(textKeys.multi)), /*#__PURE__*/React.createElement(Text, {
78
+ className: clsx('ipc-player-plugin-capture-result-title', legacyCls.title)
79
+ }, 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, {
55
80
  className: "ipc-player-plugin-capture-result-count"
56
81
  }, Strings.formatString(Strings.getLang('ipc_player_multi_capture_success_count'), count))) : Strings.getLang(textKeys.single)), /*#__PURE__*/React.createElement(View, {
57
82
  onClick: onCheck,
58
- className: "ipc-player-plugin-capture-result-check",
83
+ className: clsx('ipc-player-plugin-capture-result-check', legacyCls.check),
59
84
  style: {
60
85
  color: brandColor,
61
86
  borderColor: brandColor
62
87
  }
63
- }, Strings.getLang(textKeys.check)));
88
+ }, checkText || Strings.getLang(textKeys.check)));
64
89
  }
@@ -1,4 +1,6 @@
1
- .ipc-player-plugin-capture-result-toast {
1
+ .ipc-player-plugin-capture-result-toast,
2
+ .ipc-player-plugin-record-success-toast,
3
+ .ipc-player-plugin-screenshot-toast {
2
4
  z-index: 100;
3
5
  display: flex;
4
6
  flex: 1;
@@ -9,7 +11,9 @@
9
11
  border-radius: calc(8px * var(--ipc-player-size-scale, 1));
10
12
  }
11
13
 
12
- .ipc-player-plugin-capture-result-image-box {
14
+ .ipc-player-plugin-capture-result-image-box,
15
+ .ipc-player-plugin-record-success-toast-image-box,
16
+ .ipc-player-plugin-screenshot-toast-image-box {
13
17
  position: relative;
14
18
  width: calc(66px * var(--ipc-player-size-scale, 1));
15
19
  height: calc(66px * 0.57 * var(--ipc-player-size-scale, 1));
@@ -17,13 +21,17 @@
17
21
  border-radius: calc(4px * var(--ipc-player-size-scale, 1));
18
22
  }
19
23
 
20
- .ipc-player-plugin-capture-result-image {
24
+ .ipc-player-plugin-capture-result-image,
25
+ .ipc-player-plugin-record-success-toast-image,
26
+ .ipc-player-plugin-screenshot-toast-image {
21
27
  width: 100%;
22
28
  height: 100%;
23
29
  object-fit: cover;
24
30
  }
25
31
 
26
- .ipc-player-plugin-capture-result-image-box-multi .ipc-player-plugin-capture-result-image {
32
+ .ipc-player-plugin-capture-result-image-box-multi .ipc-player-plugin-capture-result-image,
33
+ .ipc-player-plugin-record-success-toast-image-box-multi .ipc-player-plugin-record-success-toast-image,
34
+ .ipc-player-plugin-screenshot-toast-image-box-multi .ipc-player-plugin-screenshot-toast-image {
27
35
  position: absolute;
28
36
  top: 0;
29
37
  width: calc(56px * var(--ipc-player-size-scale, 1));
@@ -32,7 +40,8 @@
32
40
  border-radius: calc(4px * var(--ipc-player-size-scale, 1));
33
41
  }
34
42
 
35
- .ipc-player-plugin-capture-result-play-icon-box {
43
+ .ipc-player-plugin-capture-result-play-icon-box,
44
+ .ipc-player-plugin-record-success-play-icon-box {
36
45
  position: absolute;
37
46
  top: 50%;
38
47
  left: 50%;
@@ -48,12 +57,15 @@
48
57
  transform: translate(-50%, -50%);
49
58
  }
50
59
 
51
- .ipc-player-plugin-capture-result-play-icon {
60
+ .ipc-player-plugin-capture-result-play-icon,
61
+ .ipc-player-plugin-record-success-play-icon {
52
62
  color: #ffffff;
53
63
  font-size: calc(18px * var(--ipc-player-size-scale, 1)) !important;
54
64
  }
55
65
 
56
- .ipc-player-plugin-capture-result-title {
66
+ .ipc-player-plugin-capture-result-title,
67
+ .ipc-player-plugin-record-success-toast-title,
68
+ .ipc-player-plugin-screenshot-toast-title {
57
69
  display: flex;
58
70
  flex: 1;
59
71
  flex-direction: column;
@@ -71,7 +83,9 @@
71
83
  opacity: 0.5;
72
84
  }
73
85
 
74
- .ipc-player-plugin-capture-result-check {
86
+ .ipc-player-plugin-capture-result-check,
87
+ .ipc-player-plugin-record-success-toast-bottom,
88
+ .ipc-player-plugin-screenshot-toast-bottom {
75
89
  min-width: calc(52px * var(--ipc-player-size-scale, 1));
76
90
  max-width: calc(100px * var(--ipc-player-size-scale, 1));
77
91
  padding: calc(5px * var(--ipc-player-size-scale, 1))
@@ -0,0 +1,2 @@
1
+ export * from './captureResult';
2
+ export type { CaptureResultToastProps, CaptureKind } from './captureResult';
@@ -0,0 +1,2 @@
1
+ export * from './captureResult';
2
+ export {};
@@ -24,3 +24,4 @@ export * from './toggleVerticalFull';
24
24
  export * from './flowLowTip';
25
25
  export * from './realTimeMagnification';
26
26
  export * from './zoomTurntable';
27
+ export * from './captureResult';
@@ -23,4 +23,5 @@ export * from './smallIntercom';
23
23
  export * from './toggleVerticalFull';
24
24
  export * from './flowLowTip';
25
25
  export * from './realTimeMagnification';
26
- export * from './zoomTurntable';
26
+ export * from './zoomTurntable';
27
+ export * from './captureResult';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.52-beta.1",
3
+ "version": "0.0.52-beta.2",
4
4
  "description": "IPC 融合播放器",
5
5
  "main": "lib/index",
6
6
  "files": [