agora-ui-foundation 3.7.2 → 3.7.3

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.
@@ -54,11 +54,13 @@ export interface ParticipantsMoreActionsProps {
54
54
  onParticipantsButtonClick: (action: ParticipantActionType, userId: string) => void;
55
55
  hasPinnedStream: boolean;
56
56
  hideActions: string[];
57
+ isLocalCameraInSecondaryWindow: boolean;
57
58
  }
58
59
  export interface IFcrParticipantItemProps {
59
60
  user: User;
60
61
  hasPinnedStream: boolean;
61
62
  hideActions?: string[];
62
63
  onParticipantsButtonClick?: (action: ParticipantActionType, userId: string) => void;
64
+ isLocalCameraInSecondaryWindow: boolean;
63
65
  }
64
66
  export declare const FcrParticipant: FC<IFcrParticipantItemProps>;
@@ -72,7 +72,8 @@ var FcrParticipant = exports.FcrParticipant = function FcrParticipant(props) {
72
72
  _props$onParticipants = props.onParticipantsButtonClick,
73
73
  onParticipantsButtonClick = _props$onParticipants === void 0 ? function () {} : _props$onParticipants,
74
74
  _props$hideActions = props.hideActions,
75
- hideActions = _props$hideActions === void 0 ? [] : _props$hideActions;
75
+ hideActions = _props$hideActions === void 0 ? [] : _props$hideActions,
76
+ isLocalCameraInSecondaryWindow = props.isLocalCameraInSecondaryWindow;
76
77
  var userId = user.userId,
77
78
  _user$userName = user.userName,
78
79
  userName = _user$userName === void 0 ? '' : _user$userName,
@@ -144,6 +145,7 @@ var FcrParticipant = exports.FcrParticipant = function FcrParticipant(props) {
144
145
  hideActions: hideActions,
145
146
  hasPinnedStream: hasPinnedStream,
146
147
  onParticipantsButtonClick: onParticipantsButtonClick,
148
+ isLocalCameraInSecondaryWindow: isLocalCameraInSecondaryWindow,
147
149
  user: user
148
150
  })
149
151
  }),
@@ -12,5 +12,6 @@ export interface ParticipantProps {
12
12
  searchText?: string;
13
13
  onInvite?: () => void;
14
14
  hasPinnedStream: boolean;
15
+ isLocalCameraInSecondaryWindow: boolean;
15
16
  }
16
17
  export declare const FcrParticipants: (props: ParticipantProps) => import("react/jsx-runtime").JSX.Element;
@@ -36,7 +36,7 @@ var cache = new _reactVirtualized.CellMeasurerCache({
36
36
  fixedWidth: true,
37
37
  defaultHeight: 52
38
38
  });
39
- var userRowRenderer = function userRowRenderer(userList, userRenderer, hasPinnedStream, toggleParticipantAction) {
39
+ var userRowRenderer = function userRowRenderer(userList, userRenderer, hasPinnedStream, toggleParticipantAction, isLocalCameraInSecondaryWindow) {
40
40
  return function (renderProps) {
41
41
  var key = renderProps.key,
42
42
  parent = renderProps.parent,
@@ -57,7 +57,8 @@ var userRowRenderer = function userRowRenderer(userList, userRenderer, hasPinned
57
57
  children: userRenderer ? userRenderer(userList[index]) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_attendee.FcrParticipant, {
58
58
  hasPinnedStream: hasPinnedStream,
59
59
  user: userList[index],
60
- onParticipantsButtonClick: toggleParticipantAction
60
+ onParticipantsButtonClick: toggleParticipantAction,
61
+ isLocalCameraInSecondaryWindow: isLocalCameraInSecondaryWindow
61
62
  })
62
63
  });
63
64
  }
@@ -74,6 +75,7 @@ var FcrParticipants = exports.FcrParticipants = function FcrParticipants(props)
74
75
  hasPinnedStream = _props.hasPinnedStream,
75
76
  toggleParticipantAction = _props.toggleParticipantAction,
76
77
  toggleRoomControlAction = _props.toggleRoomControlAction,
78
+ isLocalCameraInSecondaryWindow = _props.isLocalCameraInSecondaryWindow,
77
79
  footer = _props.footer,
78
80
  header = _props.header;
79
81
 
@@ -130,7 +132,7 @@ var FcrParticipants = exports.FcrParticipants = function FcrParticipants(props)
130
132
  height: height,
131
133
  rowCount: userList.length,
132
134
  rowHeight: cache.rowHeight,
133
- rowRenderer: userRowRenderer(userList, userRenderer, hasPinnedStream, toggleParticipantAction)
135
+ rowRenderer: userRowRenderer(userList, userRenderer, hasPinnedStream, toggleParticipantAction, isLocalCameraInSecondaryWindow)
134
136
  });
135
137
  }
136
138
  })
@@ -56,7 +56,8 @@ var userRowRenderer = function userRowRenderer(userList, userRenderer, hasPinned
56
56
  children: userRenderer ? userRenderer(userList[index]) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_attendee.FcrParticipant, {
57
57
  hasPinnedStream: hasPinnedStream,
58
58
  user: userList[index],
59
- onParticipantsButtonClick: toggleParticipantAction
59
+ onParticipantsButtonClick: toggleParticipantAction,
60
+ isLocalCameraInSecondaryWindow: false // mobile participants do not have secondary windows
60
61
  })
61
62
  });
62
63
  }
@@ -51,7 +51,8 @@ var FcrParticipantsMoreActions = exports.FcrParticipantsMoreActions = function F
51
51
  var onParticipantsButtonClick = props.onParticipantsButtonClick,
52
52
  hasPinnedStream = props.hasPinnedStream,
53
53
  hideActions = props.hideActions,
54
- user = props.user;
54
+ user = props.user,
55
+ isLocalCameraInSecondaryWindow = props.isLocalCameraInSecondaryWindow;
55
56
  var isMe = user.isMe,
56
57
  userId = user.userId,
57
58
  hasVideo = user.hasVideo,
@@ -62,6 +63,17 @@ var FcrParticipantsMoreActions = exports.FcrParticipantsMoreActions = function F
62
63
  allowedOperations = user.allowedOperations;
63
64
  var cameraStateType = !hasVideo ? 'primary' : 'danger';
64
65
 
66
+ /**
67
+ * 如果当前用户的类型是 'meeting-system' 且没有视频流,则不显示固定选项。
68
+ * 如果当前用户是自己且摄像头的视频流显示在副窗口中,也不显示固定选项。
69
+ */
70
+ var isShowPinOption = true;
71
+ if (userType === 'meeting-system' && !hasVideo) {
72
+ isShowPinOption = false;
73
+ } else if (isMe && isLocalCameraInSecondaryWindow) {
74
+ isShowPinOption = false;
75
+ }
76
+
65
77
  // 定义所有操作菜单
66
78
  var allOperationMenu = [{
67
79
  icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_cameraState.CameraState, {
@@ -115,7 +127,7 @@ var FcrParticipantsMoreActions = exports.FcrParticipantsMoreActions = function F
115
127
  }) : hasPinnedStream ? (0, _i18next.t)('fmt_attendies_options_replacefixed') : (0, _i18next.t)('fmt_attendies_options_fixfirst'),
116
128
  key: 'pin',
117
129
  type: isPin ? 'danger' : 'primary',
118
- canOperation: userType === 'normal' || userType === 'phone' || userType === 'meeting-system' && hasVideo,
130
+ canOperation: isShowPinOption,
119
131
  onButtonClick: handleButtonClick(isPin ? _attendee.ParticipantActionType.REMOVE_PIN : _attendee.ParticipantActionType.ADD_PIN, userId, onParticipantsButtonClick),
120
132
  group: 'own_view'
121
133
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-ui-foundation",
3
- "version": "3.7.2",
3
+ "version": "3.7.3",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "lib",
@@ -12,7 +12,7 @@
12
12
  "dependencies": {
13
13
  "@react-spring/web": "^9.7.3",
14
14
  "@use-gesture/react": "^10.3.1",
15
- "agora-foundation": "~3.7.2",
15
+ "agora-foundation": "~3.7.3",
16
16
  "classnames": "^2.5.1",
17
17
  "i18next": "^23.10.1",
18
18
  "normalize.css": "^8.0.1",
@@ -51,7 +51,7 @@
51
51
  "@types/react-virtualized": "^9.21.30",
52
52
  "@types/tinycolor2": "^1.4.6",
53
53
  "@types/webpack-env": "^1.18.4",
54
- "agora-toolchain": "~3.7.2",
54
+ "agora-toolchain": "~3.7.3",
55
55
  "core-js": "^3.33.3",
56
56
  "eslint": "^9.0.0",
57
57
  "node-html-parser": "^6.1.13",