fcr-ui-scene 3.7.3 → 3.7.4-rc.1

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 (111) hide show
  1. package/lib/creator.d.ts +2 -0
  2. package/lib/creator.js +14 -0
  3. package/lib/fragments/annotation/libs.d.ts +7 -6
  4. package/lib/fragments/annotation/libs.js +9 -8
  5. package/lib/fragments/whiteboard/store.js +13 -8
  6. package/lib/global.css +6 -0
  7. package/lib/modules/action-bar/components/screen-share/submenu.js +2 -2
  8. package/lib/modules/action-bar/index.d.ts +2 -0
  9. package/lib/modules/action-bar/index.js +2 -1
  10. package/lib/modules/action-bar/store.d.ts +6 -2
  11. package/lib/modules/action-bar/store.js +56 -93
  12. package/lib/modules/annotation/annotation-toolbar-store.js +2 -2
  13. package/lib/modules/annotation/store.js +12 -14
  14. package/lib/modules/audio-stream/index.js +1 -2
  15. package/lib/modules/chat/components/chat-select/index.js +3 -0
  16. package/lib/modules/components/device-control/store.js +2 -2
  17. package/lib/modules/components/leave-meeting/index.js +4 -1
  18. package/lib/modules/components/member-window/components/video-player/components/local-video-player-with-zoom.d.ts +6 -4
  19. package/lib/modules/components/member-window/components/video-player/components/local-video-player-with-zoom.js +77 -41
  20. package/lib/modules/components/member-window/components/video-player/components/remote-video-player-with-zoom.d.ts +3 -3
  21. package/lib/modules/components/member-window/components/video-player/index.d.ts +3 -3
  22. package/lib/modules/components/member-window/types.d.ts +3 -3
  23. package/lib/modules/control-bar/store.d.ts +10 -8
  24. package/lib/modules/control-bar/store.js +47 -15
  25. package/lib/modules/control-bar/view.js +27 -13
  26. package/lib/modules/device-pretest/store.js +4 -2
  27. package/lib/modules/dialog/components/dialog-container/component/body.js +3 -24
  28. package/lib/modules/dialog/components/dialog-container/index.d.ts +4 -0
  29. package/lib/modules/dialog/components/dialog-container/index.js +67 -44
  30. package/lib/modules/dialog/components/normal-window/index.js +4 -0
  31. package/lib/modules/dialog/dialogs/control-bar/index.js +9 -32
  32. package/lib/modules/dialog/dialogs/sub-window/index.js +4 -0
  33. package/lib/modules/dialog/dialogs/video-window/index.js +28 -23
  34. package/lib/modules/dialog/hooks/useElectron.js +4 -1
  35. package/lib/modules/dialog/level-config.js +1 -1
  36. package/lib/modules/dialog/store.d.ts +4 -3
  37. package/lib/modules/dialog/store.js +14 -10
  38. package/lib/modules/event-confirm/components/window/index.d.ts +5 -2
  39. package/lib/modules/event-confirm/components/window/index.js +38 -14
  40. package/lib/modules/event-confirm/index.css +0 -2
  41. package/lib/modules/event-confirm/store.d.ts +10 -5
  42. package/lib/modules/event-confirm/store.js +62 -13
  43. package/lib/modules/event-confirm/view.js +9 -7
  44. package/lib/modules/interpreter/interpreter-list/interpreter-item/components/pick-user/index.js +1 -2
  45. package/lib/modules/interpreter/store.js +11 -13
  46. package/lib/modules/layout/components/CommonVideoRenderer.js +5 -5
  47. package/lib/modules/layout/store.js +8 -22
  48. package/lib/modules/participant/member-list-data-source.js +3 -5
  49. package/lib/modules/participant/store.js +43 -43
  50. package/lib/modules/secondary-window/index.d.ts +2 -1
  51. package/lib/modules/secondary-window/index.js +5 -0
  52. package/lib/modules/secondary-window/type.d.ts +13 -9
  53. package/lib/modules/secondary-window/view.js +12 -12
  54. package/lib/modules/setting/audio-settings/audio-settings.js +4 -2
  55. package/lib/modules/setting/config.d.ts +4 -0
  56. package/lib/modules/setting/config.js +6 -3
  57. package/lib/modules/setting/store.d.ts +8 -3
  58. package/lib/modules/setting/store.js +104 -74
  59. package/lib/modules/setting/view.js +3 -2
  60. package/lib/modules/share-screen/components/selection/index.js +6 -8
  61. package/lib/modules/share-screen/store.d.ts +9 -10
  62. package/lib/modules/share-screen/store.js +65 -90
  63. package/lib/modules/share-screen/types.d.ts +7 -8
  64. package/lib/modules/video-window/components/members/index.js +3 -3
  65. package/lib/modules/video-window/store.js +3 -3
  66. package/lib/modules/whiteboard/components/control-bar/store.d.ts +3 -0
  67. package/lib/modules/whiteboard/components/control-bar/store.js +20 -11
  68. package/lib/modules/whiteboard/components/toolbar/store.js +2 -2
  69. package/lib/modules/whiteboard/index.d.ts +10 -4
  70. package/lib/modules/whiteboard/index.js +158 -124
  71. package/lib/plugins/module-dev-plugin.js +4 -0
  72. package/lib/providers/annotation-provider.js +3 -3
  73. package/lib/providers/device-privilege-provider.js +13 -12
  74. package/lib/providers/device-provider.d.ts +37 -31
  75. package/lib/providers/device-provider.js +692 -746
  76. package/lib/providers/device-stream-provider.js +4 -4
  77. package/lib/providers/interpreter-provider.js +7 -9
  78. package/lib/providers/multi-display-provider.d.ts +8 -3
  79. package/lib/providers/multi-display-provider.js +18 -6
  80. package/lib/providers/privilege-provider.d.ts +3 -11
  81. package/lib/providers/privilege-provider.js +2 -5
  82. package/lib/providers/renderer-provider.d.ts +3 -3
  83. package/lib/providers/renderer-provider.js +20 -32
  84. package/lib/providers/room-provider.js +14 -15
  85. package/lib/providers/screen-share-provider.d.ts +12 -10
  86. package/lib/providers/screen-share-provider.js +79 -59
  87. package/lib/providers/sharing-provider.js +7 -0
  88. package/lib/providers/whiteboard-provider.js +1 -0
  89. package/lib/scenes/main-scene.js +15 -9
  90. package/lib/schema.d.ts +3 -3
  91. package/lib/schema.js +1 -1
  92. package/lib/shared-data-source/confirm-data.d.ts +19 -0
  93. package/lib/shared-data-source/confirm-data.js +119 -15
  94. package/lib/shared-data-source/screen-share-data.d.ts +29 -28
  95. package/lib/shared-data-source/screen-share-data.js +14 -8
  96. package/lib/shared-data-source/setting.js +2 -2
  97. package/lib/shared-data-source/whiteboard-data.d.ts +7 -5
  98. package/lib/shared-data-source/whiteboard-data.js +9 -8
  99. package/lib/ui-scene.d.ts +2 -0
  100. package/lib/ui-scene.js +77 -21
  101. package/lib/utilities/constant.d.ts +5 -0
  102. package/lib/utilities/constant.js +7 -2
  103. package/lib/utilities/default-config.d.ts +4 -0
  104. package/lib/utilities/default-config.js +8 -4
  105. package/lib/utilities/dialog-utils.d.ts +3 -2
  106. package/lib/utilities/dialog-utils.js +33 -14
  107. package/lib/utilities/package-info.d.ts +3 -0
  108. package/lib/utilities/package-info.js +15 -0
  109. package/lib/waiting-room-control-manager.js +6 -6
  110. package/package.json +6 -6
  111. package/public/index.html +5 -0
@@ -26,14 +26,15 @@ Object.defineProperty(exports, "__esModule", {
26
26
  value: true
27
27
  });
28
28
  exports["default"] = exports.DialogContainerStore = void 0;
29
+ require("core-js/modules/es.parse-int.js");
29
30
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
30
31
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
31
32
  var _react = _interopRequireWildcard(require("react"));
32
33
  var _mobxReact = require("mobx-react");
33
- var _react2 = require("@use-gesture/react");
34
34
  var _env = require("agora-foundation/lib/utilities/env");
35
35
  var _store = require("../../store");
36
36
  var _body = require("./component/body");
37
+ var _reactRnd = require("react-rnd");
37
38
  var _jsxRuntime = require("react/jsx-runtime");
38
39
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
39
40
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -41,6 +42,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
41
42
  var DialogContainerStore = exports.DialogContainerStore = /*#__PURE__*/(0, _react.createContext)({});
42
43
  var DialogContainer = (0, _mobxReact.observer)(function (props) {
43
44
  var width = props.width,
45
+ height = props.height,
44
46
  title = props.title,
45
47
  onClose = props.onClose,
46
48
  children = props.children,
@@ -50,7 +52,11 @@ var DialogContainer = (0, _mobxReact.observer)(function (props) {
50
52
  dialogId = props.dialogId,
51
53
  autoHeight = props.autoHeight,
52
54
  closable = props.closable,
53
- style = props.style;
55
+ style = props.style,
56
+ maxWidth = props.maxWidth,
57
+ maxHeight = props.maxHeight,
58
+ minWidth = props.minWidth,
59
+ minHeight = props.minHeight;
54
60
  var _ref = (0, _react.useContext)(_store.StoreContext) || {
55
61
  closeDialogByKey: onClose
56
62
  },
@@ -76,61 +82,78 @@ var DialogContainer = (0, _mobxReact.observer)(function (props) {
76
82
  });
77
83
  if ((0, _env.isElectron)()) return container;
78
84
  var rndRef = (0, _react.useRef)(null);
79
- var size = (0, _react.useMemo)(function () {
80
- var _rndRef$current;
85
+ var windowWidth = window.innerWidth;
86
+ var windowHeight = window.innerHeight;
87
+
88
+ // 应用尺寸限制的辅助函数
89
+ var constrainSize = function constrainSize(newSize) {
90
+ var constrainedWidth = newSize.width;
91
+ var constrainedHeight = newSize.height;
92
+
93
+ // 应用最小尺寸限制
94
+ if (minWidth && constrainedWidth < minWidth) {
95
+ constrainedWidth = minWidth;
96
+ }
97
+ if (minHeight && constrainedHeight < minHeight) {
98
+ constrainedHeight = minHeight;
99
+ }
100
+
101
+ // 应用最大尺寸限制
102
+ if (maxWidth && constrainedWidth > maxWidth) {
103
+ constrainedWidth = maxWidth;
104
+ }
105
+ if (maxHeight && constrainedHeight > maxHeight) {
106
+ constrainedHeight = maxHeight;
107
+ }
81
108
  return {
82
- width: width || 400,
83
- height: props.height ? props.height : ((_rndRef$current = rndRef.current) === null || _rndRef$current === void 0 ? void 0 : _rndRef$current.getBoundingClientRect().height) || 160
109
+ width: constrainedWidth,
110
+ height: constrainedHeight
84
111
  };
85
- }, [props.height]);
86
- var windowWidth = window.innerWidth;
87
- var height = window.innerHeight;
88
- var x = windowWidth / 2 - size.width / 2;
89
- var y = height / 2 - size.height / 2;
90
- var windowBounds = {
91
- x: x,
92
- y: y,
93
- width: window.innerWidth,
94
- height: window.innerHeight
95
112
  };
96
113
  var _useState = (0, _react.useState)({
114
+ width: width || 400,
115
+ height: height || 160
116
+ }),
117
+ _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
118
+ size = _useState2[0],
119
+ updateSize = _useState2[1];
120
+ var x = windowWidth / 2 - size.width / 2;
121
+ var y = windowHeight / 2 - size.height / 2;
122
+ var _useState3 = (0, _react.useState)({
97
123
  x: x,
98
124
  y: y
99
125
  }),
100
- _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
101
- bounds = _useState2[0],
102
- setBounds = _useState2[1];
103
- var bind = (0, _react2.useDrag)(function (_ref2) {
104
- var _ref2$delta = (0, _slicedToArray2["default"])(_ref2.delta, 2),
105
- dx = _ref2$delta[0],
106
- dy = _ref2$delta[1];
107
- var x = bounds.x + dx;
108
- var y = bounds.y + dy;
109
- var maxX = windowBounds.width - size.width;
110
- var maxY = windowBounds.height - size.height;
111
- var coord = {
112
- x: Math.max(0, Math.min(maxX, x)),
113
- y: Math.max(0, Math.min(maxY, y))
114
- };
115
- setBounds(coord);
116
- });
117
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
126
+ _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
127
+ position = _useState4[0],
128
+ updatePosition = _useState4[1];
129
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRnd.Rnd, {
118
130
  style: _objectSpread({
119
- width: size.width,
120
- height: size.height,
121
- left: "".concat(bounds.x, "px"),
122
- top: "".concat(bounds.y, "px"),
123
131
  position: 'absolute',
124
132
  touchAction: 'none',
125
133
  display: 'flex',
126
134
  flexDirection: 'column'
127
135
  }, style),
128
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DialogContainerStore.Provider, {
129
- value: {
130
- bind: bind
131
- },
132
- children: container
133
- })
136
+ size: size,
137
+ position: position,
138
+ minWidth: minWidth,
139
+ minHeight: minHeight,
140
+ maxWidth: maxWidth,
141
+ maxHeight: maxHeight,
142
+ onDragStop: function onDragStop(e, d) {
143
+ updatePosition({
144
+ x: d.x,
145
+ y: d.y
146
+ });
147
+ },
148
+ onResizeStop: function onResizeStop(e, direction, ref, delta, position) {
149
+ var newSize = constrainSize({
150
+ width: parseInt(ref.style.width),
151
+ height: parseInt(ref.style.height)
152
+ });
153
+ updateSize(newSize);
154
+ updatePosition(position);
155
+ },
156
+ children: container
134
157
  });
135
158
  });
136
159
  var _default = exports["default"] = DialogContainer;
@@ -46,6 +46,10 @@ function NormalWindow(props) {
46
46
  title: title === false || title ? title : config.title,
47
47
  width: width || config.width,
48
48
  height: height || config.height,
49
+ maxWidth: config.maxWidth,
50
+ maxHeight: config.maxHeight,
51
+ minWidth: config.minWidth,
52
+ minHeight: config.minHeight,
49
53
  dialogKey: dialogKey,
50
54
  actions: actions,
51
55
  style: style,
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.title = exports.setBounds = exports.config = exports.ControlBarDialog = void 0;
9
- require("core-js/modules/web.timers.js");
10
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
11
  var _constant = require("../../../../utilities/constant");
@@ -96,52 +95,30 @@ var ControlBarDialog = exports.ControlBarDialog = (0, _mobxReact.observer)(funct
96
95
  });
97
96
  var setBounds = exports.setBounds = /*#__PURE__*/function () {
98
97
  var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(currentShareBounds, browserWindow) {
99
- var _getCurrentSharingWor, originWidth, originHeight, x, y, WINDOWS_SCREEN_BOUNDARY_WIDTH, width, height, firstBounds;
98
+ var _getCurrentSharingWor, originWidth, originHeight, x, y;
100
99
  return _regenerator["default"].wrap(function (_context2) {
101
100
  while (1) switch (_context2.prev = _context2.next) {
102
101
  case 0:
103
102
  _getCurrentSharingWor = (0, _dialogUtils.getCurrentSharingWorkArea)({
104
103
  currentShareBounds: currentShareBounds
105
- }), originWidth = _getCurrentSharingWor.width, originHeight = _getCurrentSharingWor.height, x = _getCurrentSharingWor.x, y = _getCurrentSharingWor.y;
106
- /* 使用window.screen.availWidth在windows上会黑屏,详见jira:APAAS-5732
107
- 怀疑是在windows上BrowserWindow有一个边框,所以需要减去一定的宽度。
108
- 实验结果最低是4。这里减去10留一点buffer,防止其他操作系统的边框不一致。
109
- */
110
- WINDOWS_SCREEN_BOUNDARY_WIDTH = 10;
111
- width = (0, _platform.isWindows)() ? originWidth - WINDOWS_SCREEN_BOUNDARY_WIDTH : originWidth;
112
- height = originHeight; // 重新设置窗口大小
104
+ }), originWidth = _getCurrentSharingWor.width, originHeight = _getCurrentSharingWor.height, x = _getCurrentSharingWor.x, y = _getCurrentSharingWor.y; // // 重新设置窗口大小
113
105
  if ((0, _platform.isWindows)()) {
114
- // 修复 windows 分辨率差别大的多显示器场景下的窗口缩放问题
115
- browserWindow === null || browserWindow === void 0 || browserWindow.setBounds({
106
+ browserWindow.isMaximized() && browserWindow.unmaximize();
107
+ browserWindow.setBounds({
116
108
  x: x,
117
109
  y: y,
118
- width: width,
119
- height: height
110
+ width: 800,
111
+ height: 600
120
112
  });
121
- firstBounds = browserWindow.getBounds();
113
+ browserWindow.maximize();
114
+ } else {
122
115
  browserWindow.setBounds({
123
- x: firstBounds.x === 0 ? 0 : -firstBounds.x,
124
- y: firstBounds.y === 0 ? 0 : -firstBounds.y,
125
- width: width,
126
- height: height
127
- });
128
- }
129
- setTimeout(function () {
130
- browserWindow === null || browserWindow === void 0 || browserWindow.setBounds({
131
116
  x: x,
132
117
  y: y,
133
118
  width: originWidth,
134
119
  height: originHeight
135
120
  });
136
- browserWindow === null || browserWindow === void 0 || browserWindow.setMaximumSize(originWidth, originHeight);
137
- browserWindow.focus();
138
- }, 100);
139
- setTimeout(function () {
140
- browserWindow === null || browserWindow === void 0 || browserWindow.setBounds({
141
- width: originWidth,
142
- height: originHeight
143
- });
144
- }, 100);
121
+ }
145
122
  case 1:
146
123
  case "end":
147
124
  return _context2.stop();
@@ -88,6 +88,10 @@ var SubWindowDialog = exports.SubWindowDialog = function SubWindowDialog(props)
88
88
  browserWindow.maximize();
89
89
  browserWindow.setTitle(window.runtime.browserWindow.getTitle());
90
90
  }
91
+ // 退出房间后,被关闭窗口是隐藏而不是退出,所以在重新显示时需要重置状态
92
+ browserWindow.on('show', function () {
93
+ store.interceptClose = true;
94
+ });
91
95
  },
92
96
  beforeClose: function beforeClose() {
93
97
  var interception = store.interceptClose;
@@ -55,19 +55,30 @@ var VideoWindowDialog = exports.VideoWindowDialog = (0, _mobxReact.observer)(fun
55
55
  }, [videoWindowBounds]),
56
56
  height = _useMemo.videoWindowHeight,
57
57
  type = _useMemo.videoWindowPreviewType;
58
- var setCalcBounds = function setCalcBounds(x, y, width) {
58
+ var getBoundsPosition = function getBoundsPosition(x, y, width) {
59
59
  return {
60
60
  x: x + width - _type.DefaultVideoWindowWidth - 144,
61
- y: y + 80,
62
- width: _type.DefaultVideoWindowWidth,
63
- height: _type.DefaultVideoWindowSmallTypeHeight
61
+ y: y + 80
64
62
  };
65
63
  };
66
- var _window$runtime$scree = window.runtime.screen.getDisplayNearestPoint(currentShareBounds).bounds,
67
- x = _window$runtime$scree.x,
68
- y = _window$runtime$scree.y,
69
- width = _window$runtime$scree.width;
70
- var initalBounds = setCalcBounds(x, y, width);
64
+ var _useMemo2 = (0, _react.useMemo)(function () {
65
+ var _window$runtime$scree = window.runtime.screen.getDisplayNearestPoint(currentShareBounds).bounds,
66
+ x = _window$runtime$scree.x,
67
+ y = _window$runtime$scree.y,
68
+ width = _window$runtime$scree.width;
69
+ var initalBounds = _objectSpread(_objectSpread({}, getBoundsPosition(x, y, width)), {}, {
70
+ width: _type.DefaultVideoWindowWidth,
71
+ height: _type.DefaultVideoWindowSmallTypeHeight
72
+ });
73
+ return {
74
+ x: x,
75
+ y: y,
76
+ initalBounds: initalBounds
77
+ };
78
+ }, [currentShareBounds.height, currentShareBounds.width, currentShareBounds.x, currentShareBounds.y]),
79
+ x = _useMemo2.x,
80
+ y = _useMemo2.y,
81
+ initalBounds = _useMemo2.initalBounds;
71
82
  var config = _objectSpread(_objectSpread({
72
83
  title: title,
73
84
  type: 'panel',
@@ -122,24 +133,16 @@ var VideoWindowDialog = exports.VideoWindowDialog = (0, _mobxReact.observer)(fun
122
133
  var _window$runtime$scree2 = window.runtime.screen.getDisplayNearestPoint(shareBounds).bounds,
123
134
  _x = _window$runtime$scree2.x,
124
135
  _y = _window$runtime$scree2.y,
125
- _width = _window$runtime$scree2.width;
126
- browserWindow.setBounds(setCalcBounds(_x, _y, _width));
127
- store.log("[VideoWindowDialog]: [onOpened], x: ".concat(_x, ", y: ").concat(_y, ", width: ").concat(_width));
136
+ width = _window$runtime$scree2.width;
137
+ browserWindow.setBounds(getBoundsPosition(_x, _y, width));
138
+ store.log("[VideoWindowDialog]: [onOpened], x: ".concat(_x, ", y: ").concat(_y, ", width: ").concat(width));
128
139
  }
129
140
  }
130
141
  reCalculate();
131
142
  calculateRef.current = reCalculate;
132
-
133
- // @ts-ignore
134
- window.runtime.screen.addListener('display-metrics-changed', calculateRef.current);
143
+ window.runtime.screen.addListener('display-metrics-changed', reCalculate);
135
144
  window.runtime.screen.addListener('display-removed', reCalculate);
136
145
  window.runtime.screen.addListener('display-added', reCalculate);
137
- // browserWindow.on(
138
- // 'move',
139
- // debounce(() => {
140
- // popoverWatcher(browserWindow, newRendererWindow);
141
- // }, 100),
142
- // );
143
146
  debounceRef.current = (0, _debounce["default"])(function (event, bounds) {
144
147
  setNewBounds(bounds);
145
148
  popoverWatcher(browserWindow, newRendererWindow);
@@ -155,8 +158,10 @@ var VideoWindowDialog = exports.VideoWindowDialog = (0, _mobxReact.observer)(fun
155
158
  if (!(browserWindow !== null && browserWindow !== void 0 && browserWindow.isDestroyed())) {
156
159
  // @ts-ignore
157
160
  browserWindow.removeListener('custom-resize', debounceRef.current);
158
- // @ts-ignore
159
- window.runtime.screen.removeListener('display-metrics-changed', calculateRef.current);
161
+ var listener = calculateRef.current;
162
+ window.runtime.screen.removeListener('display-metrics-changed', listener);
163
+ window.runtime.screen.removeListener('display-removed', listener);
164
+ window.runtime.screen.removeListener('display-added', listener);
160
165
  changeVideoWindowConfig(browserWindow);
161
166
  browserWindow.setResizable(false);
162
167
  browserWindow.setBounds(initalBounds);
@@ -106,9 +106,12 @@ function useElectronDialog(props) {
106
106
  store === null || store === void 0 || store.log("[dialog]: open dialog can I find dialog with dialogKey: ".concat(dialogKey, ": ").concat(_store.dialogWindows.has(dialogKey)));
107
107
  _store.dialogWindows.set(dialogKey, browserWindow);
108
108
  }
109
+ var isControlbar = dialogKey === _constant.FcrUIDialogKey.CONTROL_BAR;
110
+ var follow = isControlbar ? false : 'screen';
109
111
  var _ref = (0, _dialogUtils.followCorrectDisplay)({
110
112
  browserWindow: browserWindow,
111
- alwaysFollowScreen: fullScreen
113
+ alwaysFollowScreen: fullScreen,
114
+ follow: follow
112
115
  }),
113
116
  nearDisplayBounds = _ref.nearDisplayBounds,
114
117
  followControlbar = _ref.followControlbar;
@@ -18,4 +18,4 @@ var diffPlatformTopLevelLayer = exports.diffPlatformTopLevelLayer = (0, _platfor
18
18
  * 其他窗口层级为 normal,在打开窗口时,聚焦窗口
19
19
  */
20
20
  var HIGH_LEVEL_DIALOG_LAYER = exports.HIGH_LEVEL_DIALOG_LAYER = [_constant.FcrUIDialogKey.CHAT, _constant.FcrUIDialogKey.PARTICIPANT, _constant.FcrUIDialogKey.SHARE_SCREEN];
21
- var TOP_LEVEL_DIALOG_LAYER = exports.TOP_LEVEL_DIALOG_LAYER = [_constant.FcrUIDialogKey.SHOW_TOAST, _constant.FcrUIDialogKey.CONFIRM, _constant.FcrUIDialogKey.CONTROL_BAR, _constant.FcrUIDialogKey.VIDEO_WINDOW, _constant.FcrUIDialogKey.ANNOTATION, _constant.FcrUIDialogKey.SYSTEM_PREFERENCE];
21
+ var TOP_LEVEL_DIALOG_LAYER = exports.TOP_LEVEL_DIALOG_LAYER = [_constant.FcrUIDialogKey.SHOW_TOAST, _constant.FcrUIDialogKey.CONFIRM, _constant.FcrUIDialogKey.CONTROL_BAR, _constant.FcrUIDialogKey.VIDEO_WINDOW, _constant.FcrUIDialogKey.ANNOTATION, _constant.FcrUIDialogKey.SYSTEM_PREFERENCE, _constant.FcrUIDialogKey.RENAME];
@@ -7,7 +7,7 @@ import { FcrUIEventProvider } from '../../providers/event-provider';
7
7
  import { FcrUISharedLayoutDataSource } from '../../shared-data-source/layout-data';
8
8
  import { FcrUIDialogProvider } from '../../providers/dialog-provider';
9
9
  import { FcrUIPhoneAudioConnectorProvider } from '../../providers/phone-audio-provider';
10
- import { AgoraRtcWindowInfo } from 'agora-rte-sdk/lib/core/rtc/type';
10
+ import { FcrWindowInfo } from 'fcr-core/lib/type';
11
11
  import { CurrentShareBounds } from '../control-bar/types';
12
12
  import { FcrUIDialogComponent } from './type';
13
13
  import { FcrUIWidgetProvider } from '../../providers/widget-provider';
@@ -61,10 +61,10 @@ export default class DialogStore {
61
61
  accessor currentDialogBounds: Map<FcrUIDialogKey, number>;
62
62
  accessor videoWindowBounds: any;
63
63
  accessor recordShareBounds: Map<CurrentShareBounds, CurrentShareScreenWorkArea>;
64
- accessor allApplicationWindows: AgoraRtcWindowInfo[];
64
+ accessor allApplicationWindows: FcrWindowInfo[];
65
65
  accessor interceptClose: boolean;
66
66
  get currentShareId(): string;
67
- get currentShareType(): import("agora-rte-sdk/lib/core/rtc/type").AgoraRtcScreenCaptureType;
67
+ get currentShareType(): import("fcr-core/lib/type").FcrScreenCaptureType;
68
68
  get currentShareBounds(): CurrentShareBounds;
69
69
  get dialogComponentMapByKey(): Map<FcrUIDialogKey, FcrUIDialogComponent>;
70
70
  get participantCount(): number;
@@ -130,5 +130,6 @@ export default class DialogStore {
130
130
  private _handleDialogEvent;
131
131
  private _hanleAllUserCountUpdated;
132
132
  private _handleSecondaryWindowEvent;
133
+ private _setInterceptClose;
133
134
  }
134
135
  export declare const StoreContext: import("react").Context<DialogStore>;
@@ -76,7 +76,7 @@ var _dialogUtils = require("../../utilities/dialog-utils");
76
76
  var _type2 = require("../secondary-window/type");
77
77
  var _excluded = ["x", "y"];
78
78
  var _DialogStore;
79
- var _initProto, _init_openedDialogs, _init_confirmDialogs, _init_userCount, _init_participantElectronDialogContainer, _init_currentDialogBounds, _init_videoWindowBounds, _init_recordShareBounds, _init_allApplicationWindows, _init_interceptClose, _setConfirmPositionDecs, _setVideoWindowBoundsDecs, _recordCurrentSharingScreenBoundsDecs, _handleDialogEventDecs, _hanleAllUserCountUpdatedDecs, _handleSecondaryWindowEventDecs, _ref;
79
+ var _initProto, _init_openedDialogs, _init_confirmDialogs, _init_userCount, _init_participantElectronDialogContainer, _init_currentDialogBounds, _init_videoWindowBounds, _init_recordShareBounds, _init_allApplicationWindows, _init_interceptClose, _setConfirmPositionDecs, _setVideoWindowBoundsDecs, _recordCurrentSharingScreenBoundsDecs, _handleDialogEventDecs, _hanleAllUserCountUpdatedDecs, _handleSecondaryWindowEventDecs, _setInterceptCloseDecs, _ref;
80
80
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
81
81
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
82
82
  function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
@@ -100,7 +100,7 @@ var _F = /*#__PURE__*/new WeakMap();
100
100
  var _G = /*#__PURE__*/new WeakMap();
101
101
  var _H = /*#__PURE__*/new WeakMap();
102
102
  var _I = /*#__PURE__*/new WeakMap();
103
- _ref = (_setConfirmPositionDecs = [_mobx.action, _mobx.action.bound], _setVideoWindowBoundsDecs = [_mobx.action, _mobx.action.bound], _recordCurrentSharingScreenBoundsDecs = [_mobx.action, _mobx.action.bound], _handleDialogEventDecs = [_mobx.action, _mobx.action.bound], _hanleAllUserCountUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleSecondaryWindowEventDecs = [_mobx.action, _mobx.action.bound], "logger");
103
+ _ref = (_setConfirmPositionDecs = [_mobx.action, _mobx.action.bound], _setVideoWindowBoundsDecs = [_mobx.action, _mobx.action.bound], _recordCurrentSharingScreenBoundsDecs = [_mobx.action, _mobx.action.bound], _handleDialogEventDecs = [_mobx.action, _mobx.action.bound], _hanleAllUserCountUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleSecondaryWindowEventDecs = [_mobx.action, _mobx.action.bound], _setInterceptCloseDecs = [_mobx.action, _mobx.action.bound], "logger");
104
104
  var DialogStore = exports["default"] = /*#__PURE__*/function () {
105
105
  function DialogStore(_ref2) {
106
106
  var _this = this;
@@ -136,12 +136,11 @@ var DialogStore = exports["default"] = /*#__PURE__*/function () {
136
136
  onAllUserCountUpdated: this._hanleAllUserCountUpdated
137
137
  });
138
138
  (0, _defineProperty2["default"])(this, "_roomObserver", {
139
- onExitRoom: function onExitRoom() {
140
- _this.interceptClose = false;
141
- },
142
- onRoutingChanged: function onRoutingChanged() {
143
- _this.interceptClose = false;
144
- }
139
+ onExitRoom: this._setInterceptClose,
140
+ onRoutingChanged: this._setInterceptClose,
141
+ onRoomClosed: this._setInterceptClose,
142
+ onLeaveMainRoom: this._setInterceptClose,
143
+ onLocalUserKickedOut: this._setInterceptClose
145
144
  });
146
145
  (0, _defineProperty2["default"])(this, "_handleSecondaryWindowEventObserver", {
147
146
  onContentDistributionUpdated: this._handleSecondaryWindowEvent
@@ -185,7 +184,7 @@ var DialogStore = exports["default"] = /*#__PURE__*/function () {
185
184
  this._userInfo = userControl.getLocalUser();
186
185
  (0, _mobx.runInAction)(function () {
187
186
  _this.userCount = _this._userControl.getAllUserCount();
188
- _this._annotationProvider.initAnnotationWindow();
187
+ // this._annotationProvider.initAnnotationWindow();
189
188
  });
190
189
  this._disposers.push((0, _mobx.reaction)(function () {
191
190
  return _this._sharedSettingDataSource.settingConfig.setting.isDualDisplayMode;
@@ -595,10 +594,15 @@ var DialogStore = exports["default"] = /*#__PURE__*/function () {
595
594
  this.interceptClose = false;
596
595
  }
597
596
  }
597
+ }, {
598
+ key: "_setInterceptClose",
599
+ value: function _setInterceptClose() {
600
+ this.interceptClose = false;
601
+ }
598
602
  }]);
599
603
  }();
600
604
  _DialogStore = DialogStore;
601
- var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_DialogStore, [[_mobx.observable, 1, "openedDialogs"], [_mobx.observable, 1, "confirmDialogs"], [_mobx.observable, 1, "userCount"], [_mobx.observable, 1, "participantElectronDialogContainer"], [_mobx.observable, 1, "currentDialogBounds"], [_mobx.observable, 1, "videoWindowBounds"], [_mobx.observable, 1, "recordShareBounds"], [_mobx.observable, 1, "allApplicationWindows"], [_mobx.observable, 1, "interceptClose"], [_mobx.computed, 3, "connectType"], [_mobx.computed, 3, "hasOwnPstnStream"], [_mobx.computed, 3, "chatRoomState"], [_mobx.computed, 3, "isSharingScreen"], [_setConfirmPositionDecs, 18, "setConfirmPosition"], [_mobx.action, 2, "setParticipantElectronDialogContainer"], [_setVideoWindowBoundsDecs, 18, "setVideoWindowBounds"], [_decorator.bound, 2, "closeDialogByKey"], [_decorator.bound, 2, "closeDilaogByDialogId"], [_decorator.bound, 2, "closeSystemPreferenceDialog"], [_decorator.bound, 2, "closeChatFromDialog"], [_decorator.bound, 2, "moveChatFromDialogToAside"], [_decorator.bound, 2, "closeConnectionDialog"], [_decorator.bound, 2, "closeParticipantDialog"], [_decorator.bound, 2, "moveParticipantFromDialogToAside"], [_decorator.bound, 2, "resizeVideoWindow"], [_recordCurrentSharingScreenBoundsDecs, 18, "recordCurrentSharingScreenBounds"], [_decorator.bound, 2, "moveMainWindowToIndexLeastDisplay"], [_decorator.bound, 2, "log"], [_handleDialogEventDecs, 18, "_handleDialogEvent"], [_hanleAllUserCountUpdatedDecs, 18, "_hanleAllUserCountUpdated"], [_handleSecondaryWindowEventDecs, 18, "_handleSecondaryWindowEvent"]], []).e, 10);
605
+ var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_DialogStore, [[_mobx.observable, 1, "openedDialogs"], [_mobx.observable, 1, "confirmDialogs"], [_mobx.observable, 1, "userCount"], [_mobx.observable, 1, "participantElectronDialogContainer"], [_mobx.observable, 1, "currentDialogBounds"], [_mobx.observable, 1, "videoWindowBounds"], [_mobx.observable, 1, "recordShareBounds"], [_mobx.observable, 1, "allApplicationWindows"], [_mobx.observable, 1, "interceptClose"], [_mobx.computed, 3, "connectType"], [_mobx.computed, 3, "hasOwnPstnStream"], [_mobx.computed, 3, "chatRoomState"], [_mobx.computed, 3, "isSharingScreen"], [_setConfirmPositionDecs, 18, "setConfirmPosition"], [_mobx.action, 2, "setParticipantElectronDialogContainer"], [_setVideoWindowBoundsDecs, 18, "setVideoWindowBounds"], [_decorator.bound, 2, "closeDialogByKey"], [_decorator.bound, 2, "closeDilaogByDialogId"], [_decorator.bound, 2, "closeSystemPreferenceDialog"], [_decorator.bound, 2, "closeChatFromDialog"], [_decorator.bound, 2, "moveChatFromDialogToAside"], [_decorator.bound, 2, "closeConnectionDialog"], [_decorator.bound, 2, "closeParticipantDialog"], [_decorator.bound, 2, "moveParticipantFromDialogToAside"], [_decorator.bound, 2, "resizeVideoWindow"], [_recordCurrentSharingScreenBoundsDecs, 18, "recordCurrentSharingScreenBounds"], [_decorator.bound, 2, "moveMainWindowToIndexLeastDisplay"], [_decorator.bound, 2, "log"], [_handleDialogEventDecs, 18, "_handleDialogEvent"], [_hanleAllUserCountUpdatedDecs, 18, "_hanleAllUserCountUpdated"], [_handleSecondaryWindowEventDecs, 18, "_handleSecondaryWindowEvent"], [_setInterceptCloseDecs, 18, "_setInterceptClose"]], []).e, 10);
602
606
  _init_openedDialogs = _applyDecs$e[0];
603
607
  _init_confirmDialogs = _applyDecs$e[1];
604
608
  _init_userCount = _applyDecs$e[2];
@@ -1,4 +1,7 @@
1
1
  import { ConfirmContentProps } from 'agora-ui-foundation/lib/components/confirm-content';
2
- export declare const ConfirmWindow: ({ confirm }: {
2
+ type ConfirmWindowProps = {
3
+ id: string;
3
4
  confirm: ConfirmContentProps;
4
- }) => import("react/jsx-runtime").JSX.Element;
5
+ };
6
+ export declare const ConfirmWindow: ({ id, confirm }: ConfirmWindowProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -39,12 +39,14 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
39
39
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
40
40
  var ConfirmWindow = exports.ConfirmWindow = (0, _mobxReact.observer)(function (_ref) {
41
41
  var _rndRef$current;
42
- var confirm = _ref.confirm;
42
+ var id = _ref.id,
43
+ confirm = _ref.confirm;
43
44
  var _useContext = (0, _react.useContext)(_store.StoreContext),
44
45
  screenBounds = _useContext.screenBounds,
45
46
  calculateMethods = _useContext.calculateMethods,
47
+ removeObserverWindow = _useContext.removeObserverWindow,
46
48
  log = _useContext.log,
47
- mousePosition = _useContext.mousePosition;
49
+ setObserverWindow = _useContext.setObserverWindow;
48
50
  var _ref2 = (0, _env.isElectron)() ? (0, _react.useContext)(_useElectron.DialogInstanceContext) : {},
49
51
  browserWindow = _ref2.browserWindow;
50
52
  var rndRef = (0, _react.useRef)(null);
@@ -86,6 +88,10 @@ var ConfirmWindow = exports.ConfirmWindow = (0, _mobxReact.observer)(function (_
86
88
  x: Math.max(0, Math.min(maxX, x)),
87
89
  y: Math.max(0, Math.min(maxY, y))
88
90
  };
91
+ setObserverWindow(id, _objectSpread({
92
+ width: defaultSize.width,
93
+ height: rndRef.current.getBoundingClientRect().height
94
+ }, coord));
89
95
  setBounds(coord);
90
96
  });
91
97
  function recalculate(bounds) {
@@ -109,26 +115,44 @@ var ConfirmWindow = exports.ConfirmWindow = (0, _mobxReact.observer)(function (_
109
115
  var handleRecalculate = function handleRecalculate() {
110
116
  return recalculate();
111
117
  };
112
- var initMouseEvents = function initMouseEvents(position) {
113
- // 旧版本 mac 系统,ignore 会失效,所以作此处理
118
+ (0, _react.useEffect)(function () {
114
119
  if ((0, _env.isElectron)() && (0, _renderer.isMac)()) {
115
- var x = position.x,
116
- y = position.y;
117
- var isInConfirm = x > bounds.x && y > bounds.y && x < bounds.x + defaultSize.width && y < bounds.y + defaultSize.height;
118
- if (isInConfirm) {
119
- log("[event-confirm][initMouseEvents]: is in confirm ".concat(isInConfirm));
120
+ if (confirm.className === 'confirm-mouseover') {
120
121
  browserWindow === null || browserWindow === void 0 || browserWindow.setIgnoreMouseEvents(false);
121
122
  } else {
122
123
  browserWindow === null || browserWindow === void 0 || browserWindow.setIgnoreMouseEvents(true, {
123
124
  forward: true
124
125
  });
125
- log('[event-confirm][initMouseEvents]: out of confirm window');
126
126
  }
127
127
  }
128
- };
129
- (0, _react.useEffect)(function () {
130
- initMouseEvents(mousePosition);
131
- }, [mousePosition]);
128
+ return function () {
129
+ removeObserverWindow(id);
130
+ };
131
+ }, [confirm.className]);
132
+
133
+ // const initMouseEvents = (position: { x: number; y: number }) => {
134
+ // // 旧版本 mac 系统,ignore 会失效,所以作此处理
135
+ // if (isElectron() && isMac()) {
136
+ // const { x, y } = position;
137
+ // const isInConfirm =
138
+ // x > bounds.x &&
139
+ // y > bounds.y &&
140
+ // x < bounds.x + defaultSize.width &&
141
+ // y < bounds.y + defaultSize.height;
142
+ // if (isInConfirm) {
143
+ // log(`[event-confirm][initMouseEvents]: is in confirm ${isInConfirm}`);
144
+ // browserWindow?.setIgnoreMouseEvents(false);
145
+ // } else {
146
+ // browserWindow?.setIgnoreMouseEvents(true, { forward: true });
147
+ // log('[event-confirm][initMouseEvents]: out of confirm window');
148
+ // }
149
+ // }
150
+ // };
151
+
152
+ // useEffect(() => {
153
+ // initMouseEvents(mousePosition);
154
+ // }, [mousePosition]);
155
+
132
156
  (0, _react.useEffect)(function () {
133
157
  recalculate();
134
158
  !calculateMethods.has(confirm) && calculateMethods.set(confirm, recalculate);
@@ -1,5 +1,3 @@
1
-
2
-
3
1
  .fcr-event-confirm-wrapper.fcr-event-confirm-container {
4
2
  width: 100vw;
5
3
  height: 100vh;
@@ -14,19 +14,20 @@ export default class ConfirmStore {
14
14
  private _sharedScreenShareSharedDataSource;
15
15
  private _sharedConfirmDataSource;
16
16
  private _handleConfirmEventObserver;
17
+ private _handleMousePositionObserver;
17
18
  accessor isReplaceShare: boolean;
18
19
  accessor calculateMethods: Map<ConfirmContentProps, (bounds?: CurrentShareBounds | null) => void>;
19
20
  accessor reposition: number;
20
21
  accessor confirms: Map<string, {
22
+ id: string;
21
23
  params: ConfirmContentProps;
22
24
  timer?: () => void;
23
25
  }>;
24
26
  accessor screenBounds: CurrentShareBounds | Electron.Rectangle | null;
25
- get mousePosition(): {
26
- x: number;
27
- y: number;
28
- };
29
- get confirmList(): ConfirmContentProps[];
27
+ get confirmList(): {
28
+ id: string;
29
+ params: ConfirmContentProps;
30
+ }[];
30
31
  get isSeizeScreen(): boolean;
31
32
  constructor({ uiEventStore, dialogProvider, screenShareProvider, sharedScreenShareSharedDataSource, sharedConfirmDataSource, }: {
32
33
  uiEventStore: FcrUIEventProvider;
@@ -36,10 +37,14 @@ export default class ConfirmStore {
36
37
  sharedConfirmDataSource: FcrUISharedConfirmDataSource;
37
38
  });
38
39
  addConfirm(payload: FcrUIDialogParams<ConfirmContentProps>): void;
40
+ removeObserverWindow(key: string): void;
41
+ setObserverWindow(key: string, window: CurrentShareBounds): void;
39
42
  resetIsReplace(): void;
40
43
  setMousePosition(e: MouseEvent): void;
41
44
  release(): void;
42
45
  log(log: string): void;
43
46
  private _handleConfirmEvent;
47
+ private _handleMousePositionObserverMouseOver;
48
+ private _handleMousePositionObserverMouseOut;
44
49
  }
45
50
  export declare const StoreContext: import("react").Context<ConfirmStore>;