fcr-ui-scene 3.6.1 → 3.6.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.
Files changed (292) hide show
  1. package/dist/132.js +2 -0
  2. package/dist/132.js.LICENSE.txt +311 -0
  3. package/dist/317.js +2 -0
  4. package/dist/317.js.LICENSE.txt +20 -0
  5. package/dist/651.js +2 -0
  6. package/dist/651.js.LICENSE.txt +1 -0
  7. package/dist/689343b64b60bfb7ffff.png +0 -0
  8. package/dist/73.js +1 -0
  9. package/dist/885f9369ea05a8ac0e56.png +0 -0
  10. package/dist/90f383876a6e93e7c7ca.png +0 -0
  11. package/dist/9b37584780995fc5df8c.gif +0 -0
  12. package/dist/annotation.e5cbd3a70b6d42361872.css +1274 -0
  13. package/dist/annotation.html +1 -0
  14. package/dist/annotation.js +2 -0
  15. package/dist/annotation.js.LICENSE.txt +252 -0
  16. package/dist/assets/browser/images/default1.jpg +0 -0
  17. package/dist/assets/browser/images/default2.jpg +0 -0
  18. package/dist/assets/browser/images/default3.jpg +0 -0
  19. package/dist/assets/browser/images/default4.jpg +0 -0
  20. package/dist/assets/browser/images/default5.jpg +0 -0
  21. package/dist/assets/browser/images/default6.jpg +0 -0
  22. package/dist/assets/browser/images/default7.jpg +0 -0
  23. package/dist/assets/browser/sound_effects/pretest.mp3 +0 -0
  24. package/dist/assets/browser/sound_effects/recording_started.mp3 +0 -0
  25. package/dist/assets/browser/sound_effects/remote_user_joined.mp3 +0 -0
  26. package/dist/assets/browser/sound_effects/speaker_test.mp3 +0 -0
  27. package/dist/assets/browser/videos/default8.mp4 +0 -0
  28. package/dist/assets/browser/videos/default9.mp4 +0 -0
  29. package/dist/assets/cursors/fcr_whiteboard_input.ico +0 -0
  30. package/dist/assets/cursors/fcr_whiteboard_pen.ico +0 -0
  31. package/dist/assets/cursors/fcr_whiteboard_shape_-straightline.ico +0 -0
  32. package/dist/assets/cursors/fcr_whiteboard_shape_arrow.ico +0 -0
  33. package/dist/assets/cursors/fcr_whiteboard_shape_circle.ico +0 -0
  34. package/dist/assets/cursors/fcr_whiteboard_shape_rectangle.ico +0 -0
  35. package/dist/assets/cursors/fcr_whiteboard_shape_triangle.ico +0 -0
  36. package/dist/assets/electron/images/default1.jpg +0 -0
  37. package/dist/assets/electron/images/default2.jpg +0 -0
  38. package/dist/assets/electron/sound_effects/pretest.mp3 +0 -0
  39. package/dist/assets/electron/videos/default8.mp4 +0 -0
  40. package/dist/assets/fcr_chat_reddot.svg +5 -0
  41. package/dist/assets/fcr_defaultpage.png +0 -0
  42. package/dist/assets/fcr_grid_big.svg +3 -0
  43. package/dist/assets/fcr_leave2.svg +58 -0
  44. package/dist/assets/fcr_listontop_big.svg +3 -0
  45. package/dist/assets/full-screen-error-boundary-img.png +0 -0
  46. package/dist/assets/leave-meeting.png +0 -0
  47. package/dist/assets/loading.gif +0 -0
  48. package/dist/assets/login_confirm.png +0 -0
  49. package/dist/assets/pretest.mp3 +0 -0
  50. package/dist/assets/state-bar-logo.png +0 -0
  51. package/dist/assets/step-gradient.svg +10 -0
  52. package/dist/b74b002687a3a3346bec.png +0 -0
  53. package/dist/b94869094481702f949b.png +0 -0
  54. package/dist/ebeace75fd46b90d890e.png +0 -0
  55. package/dist/electron/app.js +194 -0
  56. package/dist/electron/bootstrap-dev.js +46 -0
  57. package/dist/electron/bootstrap-sdk.js +211 -0
  58. package/dist/electron/default-options.js +25 -0
  59. package/dist/electron/env.js +13 -0
  60. package/dist/electron/index.js +20 -0
  61. package/dist/electron/injections.js +903 -0
  62. package/dist/electron/ipc/ipc.js +141 -0
  63. package/dist/electron/ipc/type.js +19 -0
  64. package/dist/electron/logger.js +65 -0
  65. package/dist/electron/main.js +94 -0
  66. package/dist/electron/plugins/devtool-shortcut.js +33 -0
  67. package/dist/electron/plugins/meeting-state.js +39 -0
  68. package/dist/electron/plugins/screenshot.js +54 -0
  69. package/dist/electron/preload.js +108 -0
  70. package/dist/electron/tools.js +66 -0
  71. package/dist/electron/window.js +123 -0
  72. package/dist/extensions/agora-extension-virtual-background/agora-wasm.wasm +0 -0
  73. package/dist/extensions/ai-denoiser/denoiser-wasm-simd.wasm +0 -0
  74. package/dist/extensions/ai-denoiser/denoiser-wasm.js +1 -0
  75. package/dist/extensions/ai-denoiser/denoiser-wasm.wasm +0 -0
  76. package/dist/fad688b9135b15d6c405.png +0 -0
  77. package/dist/index.html +224 -0
  78. package/dist/main.393a2a91ab7fc05ffce6.css +15403 -0
  79. package/dist/main.js +2 -0
  80. package/dist/main.js.LICENSE.txt +272 -0
  81. package/dist/worker-entry.worker.js.LICENSE.txt +13 -0
  82. package/lib/creator.d.ts +5 -0
  83. package/lib/creator.js +106 -17
  84. package/lib/electron/bootstrap-sdk.js +4 -0
  85. package/lib/electron/injections.d.ts +4 -0
  86. package/lib/electron/injections.js +37 -8
  87. package/lib/electron/ipc/ipc.d.ts +1 -0
  88. package/lib/electron/ipc/ipc.js +4 -0
  89. package/lib/electron/main.js +6 -2
  90. package/lib/electron/plugins/screenshot.js +4 -2
  91. package/lib/electron/preload.js +7 -2
  92. package/lib/electron/window.js +4 -3
  93. package/lib/fragments/annotation/index.d.ts +10 -0
  94. package/lib/fragments/annotation/index.js +106 -0
  95. package/lib/fragments/annotation/libs.d.ts +55 -0
  96. package/lib/fragments/annotation/libs.js +93 -0
  97. package/lib/fragments/annotation/store.d.ts +25 -0
  98. package/lib/fragments/annotation/store.js +485 -0
  99. package/lib/fragments/annotation/view.d.ts +2 -0
  100. package/lib/fragments/annotation/view.js +23 -0
  101. package/lib/fragments/base.d.ts +10 -0
  102. package/lib/fragments/base.js +44 -0
  103. package/lib/modules/action-bar/components/screen-share/submenu.js +7 -6
  104. package/lib/modules/action-bar/index.css +7 -0
  105. package/lib/modules/action-bar/index.d.ts +2 -0
  106. package/lib/modules/action-bar/index.js +1 -0
  107. package/lib/modules/action-bar/store.d.ts +6 -2
  108. package/lib/modules/action-bar/store.js +15 -9
  109. package/lib/modules/annotation/components/control-bar/index.css +48 -0
  110. package/lib/modules/annotation/components/control-bar/index.d.ts +3 -0
  111. package/lib/modules/annotation/components/control-bar/index.js +101 -0
  112. package/lib/modules/annotation/components/toolbar/components/color-tool/color-panel/index.d.ts +3 -0
  113. package/lib/modules/annotation/components/toolbar/components/color-tool/color-panel/index.js +46 -0
  114. package/lib/modules/annotation/components/toolbar/components/color-tool/index.d.ts +1 -0
  115. package/lib/modules/annotation/components/toolbar/components/color-tool/index.js +52 -0
  116. package/lib/modules/annotation/components/toolbar/components/graphic-tool/graphic-panel/index.d.ts +3 -0
  117. package/lib/modules/annotation/components/toolbar/components/graphic-tool/graphic-panel/index.js +59 -0
  118. package/lib/modules/annotation/components/toolbar/components/graphic-tool/graphic-panel/libs.d.ts +11 -0
  119. package/lib/modules/annotation/components/toolbar/components/graphic-tool/graphic-panel/libs.js +59 -0
  120. package/lib/modules/annotation/components/toolbar/components/graphic-tool/index.d.ts +1 -0
  121. package/lib/modules/annotation/components/toolbar/components/graphic-tool/index.js +68 -0
  122. package/lib/modules/annotation/components/toolbar/components/item/item.d.ts +17 -0
  123. package/lib/modules/annotation/components/toolbar/components/item/item.js +115 -0
  124. package/lib/modules/annotation/components/toolbar/components/item/style.css +43 -0
  125. package/lib/modules/annotation/components/toolbar/components/panel/index.d.ts +5 -0
  126. package/lib/modules/annotation/components/toolbar/components/panel/index.js +22 -0
  127. package/lib/modules/annotation/components/toolbar/components/panel/style.css +24 -0
  128. package/lib/modules/annotation/components/toolbar/components/pen-tool/index.d.ts +1 -0
  129. package/lib/modules/annotation/components/toolbar/components/pen-tool/index.js +58 -0
  130. package/lib/modules/annotation/components/toolbar/components/pen-tool/pen-panel/index.d.ts +3 -0
  131. package/lib/modules/annotation/components/toolbar/components/pen-tool/pen-panel/index.js +34 -0
  132. package/lib/modules/annotation/components/toolbar/components/tips/index.d.ts +2 -0
  133. package/lib/modules/annotation/components/toolbar/components/tips/index.js +25 -0
  134. package/lib/modules/annotation/components/toolbar/components/tips/style.css +19 -0
  135. package/lib/modules/annotation/components/toolbar/index.d.ts +0 -0
  136. package/lib/modules/annotation/components/toolbar/index.js +1 -0
  137. package/lib/modules/annotation/components/toolbar/store.d.ts +40 -0
  138. package/lib/modules/annotation/components/toolbar/store.js +279 -0
  139. package/lib/modules/annotation/components/toolbar/style.css +55 -0
  140. package/lib/modules/annotation/components/toolbar/view.d.ts +2 -0
  141. package/lib/modules/annotation/components/toolbar/view.js +120 -0
  142. package/lib/modules/annotation/index.d.ts +36 -0
  143. package/lib/modules/annotation/index.js +168 -0
  144. package/lib/modules/annotation/store.d.ts +85 -0
  145. package/lib/modules/annotation/store.js +648 -0
  146. package/lib/modules/annotation/style.css +26 -0
  147. package/lib/modules/annotation/view.d.ts +2 -0
  148. package/lib/modules/annotation/view.js +32 -0
  149. package/lib/modules/chat/view.js +112 -100
  150. package/lib/modules/components/annotation-menu/index.d.ts +7 -0
  151. package/lib/modules/components/annotation-menu/index.js +119 -0
  152. package/lib/modules/components/leave-meeting/components/assign-host.js +26 -23
  153. package/lib/modules/components/member-window/components/member-actions/components/icon-buttons/index.d.ts +2 -0
  154. package/lib/modules/components/member-window/components/member-actions/components/icon-buttons/index.js +6 -2
  155. package/lib/modules/components/member-window/components/video-player/components/remote-video-player.d.ts +2 -1
  156. package/lib/modules/components/member-window/components/video-player/components/remote-video-player.js +6 -1
  157. package/lib/modules/components/member-window/components/video-player/index.d.ts +1 -0
  158. package/lib/modules/components/member-window/index.d.ts +1 -1
  159. package/lib/modules/components/member-window/index.js +8 -5
  160. package/lib/modules/components/member-window/types.d.ts +2 -0
  161. package/lib/modules/components/security-menu/index.js +7 -6
  162. package/lib/modules/control-bar/components/annotation-button/index.d.ts +1 -0
  163. package/lib/modules/control-bar/components/annotation-button/index.js +59 -0
  164. package/lib/modules/control-bar/index.d.ts +6 -2
  165. package/lib/modules/control-bar/index.js +5 -2
  166. package/lib/modules/control-bar/store.d.ts +23 -7
  167. package/lib/modules/control-bar/store.js +112 -77
  168. package/lib/modules/control-bar/view.js +7 -3
  169. package/lib/modules/dialog/components/annotation-tool/index.d.ts +4 -0
  170. package/lib/modules/dialog/components/annotation-tool/index.js +53 -0
  171. package/lib/modules/dialog/components/chat/index.js +1 -1
  172. package/lib/modules/dialog/components/host-area-container/index.d.ts +12 -0
  173. package/lib/modules/dialog/components/host-area-container/index.js +214 -0
  174. package/lib/modules/dialog/components/participant/index.js +1 -1
  175. package/lib/modules/dialog/components/system-preference/index.js +1 -1
  176. package/lib/modules/dialog/components/video-window/index.js +1 -0
  177. package/lib/modules/dialog/hooks/use-popover-watcher.d.ts +14 -0
  178. package/lib/modules/dialog/hooks/use-popover-watcher.js +112 -0
  179. package/lib/modules/dialog/hooks/useElectron.d.ts +1 -0
  180. package/lib/modules/dialog/hooks/useElectron.js +11 -2
  181. package/lib/modules/dialog/index.d.ts +2 -0
  182. package/lib/modules/dialog/index.js +2 -1
  183. package/lib/modules/dialog/store.d.ts +9 -2
  184. package/lib/modules/dialog/store.js +46 -6
  185. package/lib/modules/event-confirm/components/window/index.d.ts +7 -0
  186. package/lib/modules/event-confirm/components/window/index.js +188 -0
  187. package/lib/modules/event-confirm/index.d.ts +4 -4
  188. package/lib/modules/event-confirm/index.js +6 -4
  189. package/lib/modules/event-confirm/store.d.ts +4 -5
  190. package/lib/modules/event-confirm/store.js +35 -26
  191. package/lib/modules/event-confirm/view.js +23 -171
  192. package/lib/modules/event-sound/index.js +1 -1
  193. package/lib/modules/layout/components/CommonVideoRenderer.js +30 -16
  194. package/lib/modules/layout/index.d.ts +4 -0
  195. package/lib/modules/layout/index.js +2 -0
  196. package/lib/modules/layout/store.d.ts +14 -2
  197. package/lib/modules/layout/store.js +77 -45
  198. package/lib/modules/participant/index.d.ts +2 -0
  199. package/lib/modules/participant/index.js +2 -1
  200. package/lib/modules/participant/store.d.ts +5 -2
  201. package/lib/modules/participant/store.js +45 -28
  202. package/lib/modules/setting/audio-settings/audio-settings.js +3 -14
  203. package/lib/modules/share-screen/components/selection/index.js +18 -42
  204. package/lib/modules/share-screen/index.d.ts +6 -2
  205. package/lib/modules/share-screen/index.js +4 -2
  206. package/lib/modules/share-screen/store.d.ts +38 -46
  207. package/lib/modules/share-screen/store.js +263 -693
  208. package/lib/modules/share-screen/view.js +2 -2
  209. package/lib/modules/state-bar/assets/fcr_grid_big.svg +1 -1
  210. package/lib/modules/state-bar/assets/fcr_listontop_big.svg +1 -1
  211. package/lib/modules/state-bar/index.d.ts +2 -0
  212. package/lib/modules/state-bar/index.js +1 -0
  213. package/lib/modules/state-bar/store.d.ts +5 -1
  214. package/lib/modules/state-bar/store.js +9 -1
  215. package/lib/modules/state-bar/view.js +3 -2
  216. package/lib/modules/video-window/components/members/index.js +2 -1
  217. package/lib/modules/waiting-room-layout/store.js +1 -1
  218. package/lib/modules/whiteboard/components/control-bar/store.d.ts +5 -1
  219. package/lib/modules/whiteboard/components/control-bar/store.js +8 -1
  220. package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/picker.js +16 -5
  221. package/lib/modules/whiteboard/components/toolbar/components/eraser-picker.js +67 -12
  222. package/lib/modules/whiteboard/components/toolbar/components/expansion/index.js +22 -2
  223. package/lib/modules/whiteboard/components/toolbar/components/history.js +46 -14
  224. package/lib/modules/whiteboard/components/toolbar/components/item/index.js +3 -2
  225. package/lib/modules/whiteboard/components/toolbar/components/move-handle.js +1 -1
  226. package/lib/modules/whiteboard/components/toolbar/components/pen-picker.js +58 -16
  227. package/lib/modules/whiteboard/components/toolbar/components/screen-capture-picker.js +15 -4
  228. package/lib/modules/whiteboard/components/toolbar/components/shape-picker.js +45 -2
  229. package/lib/modules/whiteboard/components/toolbar/hooks/index.d.ts +14 -0
  230. package/lib/modules/whiteboard/components/toolbar/hooks/index.js +235 -7
  231. package/lib/modules/whiteboard/components/toolbar/index.d.ts +1 -1
  232. package/lib/modules/whiteboard/components/toolbar/index.js +1 -1
  233. package/lib/modules/whiteboard/components/toolbar/store.d.ts +9 -2
  234. package/lib/modules/whiteboard/components/toolbar/store.js +30 -6
  235. package/lib/modules/whiteboard/components/toolbar/{ style.css → style.css} +1 -0
  236. package/lib/modules/whiteboard/index.d.ts +2 -0
  237. package/lib/modules/whiteboard/index.js +20 -20
  238. package/lib/plugins/browser-runtime-plugin.js +10 -1
  239. package/lib/providers/annotation-provider.d.ts +77 -0
  240. package/lib/providers/annotation-provider.js +411 -0
  241. package/lib/providers/interpreter-provider.d.ts +1 -0
  242. package/lib/providers/interpreter-provider.js +182 -154
  243. package/lib/providers/privilege-provider.d.ts +35 -6
  244. package/lib/providers/privilege-provider.js +105 -49
  245. package/lib/providers/renderer-provider.js +3 -7
  246. package/lib/providers/room-provider.d.ts +13 -1
  247. package/lib/providers/room-provider.js +21 -7
  248. package/lib/providers/screen-share-provider.d.ts +131 -34
  249. package/lib/providers/screen-share-provider.js +561 -173
  250. package/lib/providers/sharing-provider.d.ts +33 -0
  251. package/lib/{shared-data-source/screen-share-data-source.js → providers/sharing-provider.js} +87 -39
  252. package/lib/runtime.d.ts +6 -1
  253. package/lib/scenes/main-scene.d.ts +7 -2
  254. package/lib/scenes/main-scene.js +54 -25
  255. package/lib/scenes/waiting-scene.d.ts +6 -0
  256. package/lib/scenes/waiting-scene.js +15 -5
  257. package/lib/shared-data-source/member-data.d.ts +21 -5
  258. package/lib/shared-data-source/member-data.js +69 -17
  259. package/lib/shared-data-source/screen-share-data.d.ts +270 -0
  260. package/lib/shared-data-source/screen-share-data.js +389 -0
  261. package/lib/shared-data-source/security-data.d.ts +4 -1
  262. package/lib/shared-data-source/security-data.js +5 -2
  263. package/lib/shared-data-source/setting.js +6 -4
  264. package/lib/type.d.ts +53 -0
  265. package/lib/ui-manager.d.ts +3 -2
  266. package/lib/ui-manager.js +6 -4
  267. package/lib/ui-scene.js +59 -44
  268. package/lib/utilities/constant.d.ts +8 -1
  269. package/lib/utilities/constant.js +7 -0
  270. package/lib/utilities/logger.d.ts +4 -0
  271. package/lib/utilities/logger.js +8 -1
  272. package/lib/utilities/renderer-event.d.ts +3 -0
  273. package/lib/utilities/renderer-event.js +14 -1
  274. package/lib/utilities/screen.js +2 -1
  275. package/lib/utilities/tools.d.ts +18 -1
  276. package/lib/utilities/tools.js +48 -2
  277. package/package.json +6 -6
  278. package/public/assets/cursors/fcr_whiteboard_input.ico +0 -0
  279. package/public/assets/cursors/fcr_whiteboard_pen.ico +0 -0
  280. package/public/assets/cursors/fcr_whiteboard_shape_-straightline.ico +0 -0
  281. package/public/assets/cursors/fcr_whiteboard_shape_arrow.ico +0 -0
  282. package/public/assets/cursors/fcr_whiteboard_shape_circle.ico +0 -0
  283. package/public/assets/cursors/fcr_whiteboard_shape_rectangle.ico +0 -0
  284. package/public/assets/cursors/fcr_whiteboard_shape_triangle.ico +0 -0
  285. package/public/assets/fcr_chat_reddot.svg +3 -3
  286. package/public/assets/fcr_grid_big.svg +1 -1
  287. package/public/assets/fcr_leave2.svg +14 -14
  288. package/public/assets/fcr_listontop_big.svg +1 -1
  289. package/public/assets/step-gradient.svg +1 -1
  290. package/public/fragment.html +10 -0
  291. package/public/index.html +3 -1
  292. package/lib/shared-data-source/screen-share-data-source.d.ts +0 -37
@@ -0,0 +1,648 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.symbol.js");
4
+ require("core-js/modules/es.symbol.description.js");
5
+ require("core-js/modules/es.symbol.iterator.js");
6
+ require("core-js/modules/es.symbol.to-primitive.js");
7
+ require("core-js/modules/es.error.cause.js");
8
+ require("core-js/modules/es.error.to-string.js");
9
+ require("core-js/modules/es.array.from.js");
10
+ require("core-js/modules/es.array.is-array.js");
11
+ require("core-js/modules/es.array.push.js");
12
+ require("core-js/modules/es.array.slice.js");
13
+ require("core-js/modules/es.date.to-primitive.js");
14
+ require("core-js/modules/es.date.to-string.js");
15
+ require("core-js/modules/es.function.bind.js");
16
+ require("core-js/modules/es.function.name.js");
17
+ require("core-js/modules/es.map.js");
18
+ require("core-js/modules/es.number.constructor.js");
19
+ require("core-js/modules/es.object.create.js");
20
+ require("core-js/modules/es.object.define-property.js");
21
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
22
+ require("core-js/modules/esnext.function.metadata.js");
23
+ require("core-js/modules/esnext.map.delete-all.js");
24
+ require("core-js/modules/esnext.map.emplace.js");
25
+ require("core-js/modules/esnext.map.every.js");
26
+ require("core-js/modules/esnext.map.filter.js");
27
+ require("core-js/modules/esnext.map.find.js");
28
+ require("core-js/modules/esnext.map.find-key.js");
29
+ require("core-js/modules/esnext.map.includes.js");
30
+ require("core-js/modules/esnext.map.key-of.js");
31
+ require("core-js/modules/esnext.map.map-keys.js");
32
+ require("core-js/modules/esnext.map.map-values.js");
33
+ require("core-js/modules/esnext.map.merge.js");
34
+ require("core-js/modules/esnext.map.reduce.js");
35
+ require("core-js/modules/esnext.map.some.js");
36
+ require("core-js/modules/esnext.map.update.js");
37
+ require("core-js/modules/esnext.symbol.metadata.js");
38
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
39
+ var _typeof = require("@babel/runtime/helpers/typeof");
40
+ Object.defineProperty(exports, "__esModule", {
41
+ value: true
42
+ });
43
+ exports.AnnotationStoreContext = exports.AnnotationStore = void 0;
44
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
45
+ require("core-js/modules/es.array.concat.js");
46
+ require("core-js/modules/es.array.find.js");
47
+ require("core-js/modules/es.array.for-each.js");
48
+ require("core-js/modules/es.array.includes.js");
49
+ require("core-js/modules/es.array.iterator.js");
50
+ require("core-js/modules/es.date.to-json.js");
51
+ require("core-js/modules/es.json.stringify.js");
52
+ require("core-js/modules/es.object.to-string.js");
53
+ require("core-js/modules/es.regexp.constructor.js");
54
+ require("core-js/modules/es.regexp.dot-all.js");
55
+ require("core-js/modules/es.regexp.exec.js");
56
+ require("core-js/modules/es.regexp.sticky.js");
57
+ require("core-js/modules/es.regexp.test.js");
58
+ require("core-js/modules/es.regexp.to-string.js");
59
+ require("core-js/modules/es.string.includes.js");
60
+ require("core-js/modules/es.string.iterator.js");
61
+ require("core-js/modules/es.weak-map.js");
62
+ require("core-js/modules/esnext.async-iterator.find.js");
63
+ require("core-js/modules/esnext.async-iterator.for-each.js");
64
+ require("core-js/modules/esnext.iterator.constructor.js");
65
+ require("core-js/modules/esnext.iterator.find.js");
66
+ require("core-js/modules/esnext.iterator.for-each.js");
67
+ require("core-js/modules/esnext.weak-map.delete-all.js");
68
+ require("core-js/modules/esnext.weak-map.emplace.js");
69
+ require("core-js/modules/web.dom-collections.for-each.js");
70
+ require("core-js/modules/web.dom-collections.iterator.js");
71
+ require("core-js/modules/web.timers.js");
72
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
73
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
74
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
75
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
76
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
77
+ var _react = require("react");
78
+ var _constant = require("../../utilities/constant");
79
+ var _decorator = require("agora-foundation/lib/decorator");
80
+ var _rendererEvent = require("../../utilities/renderer-event");
81
+ var _type = require("agora-rte-sdk/lib/core/rtc/type");
82
+ var _mobx = require("mobx");
83
+ var _type2 = require("fcr-core/lib/room-control/sharing-control/type");
84
+ var _logger = require("../../utilities/logger");
85
+ var _AnnotationStore;
86
+ var _initProto, _init_annotationMainWindow, _init_resetToolbarStore, _init_isShowToolbar, _setToolsShowDecs, _zoomInDecs, _zoomOutDecs, _fullContainerDecs, _setOriginScalcDecs, _calcBoardPositionDecs, _handleBoardDomLoadDecs, _handleBoardContainerDomLoadDecs, _mountDecs, _unmountDecs, _ref;
87
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
88
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
89
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
90
+ function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
91
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
92
+ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
93
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
94
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
95
+ function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function set(e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O["static"] = l, O["private"] = f, f ? 2 === o ? k = function k(e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) { return e[n]; }, (o < 2 || 4 === o) && (F = function F(e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == _typeof(P) && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol["for"]("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol["for"]("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function s(t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
96
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
97
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
98
+ function _setFunctionName(e, t, n) { "symbol" == _typeof(t) && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
99
+ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? _typeof(e) : "null")); return e; }
100
+ var _A = /*#__PURE__*/new WeakMap();
101
+ var _B = /*#__PURE__*/new WeakMap();
102
+ var _C = /*#__PURE__*/new WeakMap();
103
+ _ref = (_setToolsShowDecs = [_mobx.action, _mobx.action.bound], _zoomInDecs = [_mobx.action, _mobx.action.bound], _zoomOutDecs = [_mobx.action, _mobx.action.bound], _fullContainerDecs = [_mobx.action, _mobx.action.bound], _setOriginScalcDecs = [_mobx.action, _mobx.action.bound], _calcBoardPositionDecs = [_mobx.action, _mobx.action.bound], _handleBoardDomLoadDecs = [_mobx.action, _mobx.action.bound], _handleBoardContainerDomLoadDecs = [_mobx.action, _mobx.action.bound], _mountDecs = [_mobx.action, _mobx.action.bound], _unmountDecs = [_mobx.action, _mobx.action.bound], "logger");
104
+ var AnnotationStore = exports.AnnotationStore = /*#__PURE__*/function () {
105
+ function AnnotationStore(_ref2) {
106
+ var _this = this;
107
+ var dialogProvider = _ref2.dialogProvider,
108
+ deviceProvider = _ref2.deviceProvider,
109
+ annotationProvider = _ref2.annotationProvider,
110
+ sharingProvider = _ref2.sharingProvider,
111
+ memberDataSource = _ref2.memberDataSource,
112
+ roomControl = _ref2.roomControl,
113
+ sharedSecuritySharedDataSource = _ref2.sharedSecuritySharedDataSource,
114
+ sharedScreenSharedDataSource = _ref2.sharedScreenSharedDataSource,
115
+ privilegeProvider = _ref2.privilegeProvider,
116
+ messageProvider = _ref2.messageProvider,
117
+ localStorageProvider = _ref2.localStorageProvider;
118
+ (0, _classCallCheck2["default"])(this, AnnotationStore);
119
+ (0, _defineProperty2["default"])(this, _ref, (_initProto(this), (0, _logger.createLogger)({
120
+ prefix: 'AnnotationStore'
121
+ })));
122
+ (0, _defineProperty2["default"])(this, "_disposers", []);
123
+ (0, _defineProperty2["default"])(this, "_annotationControl", undefined);
124
+ (0, _defineProperty2["default"])(this, "_resizeWatcherTimer", null);
125
+ (0, _defineProperty2["default"])(this, "_currentShareInfo", {
126
+ id: '',
127
+ type: _type.AgoraRtcScreenCaptureType.SCREEN,
128
+ bounds: {
129
+ x: 0,
130
+ y: 0,
131
+ width: 0,
132
+ height: 0
133
+ }
134
+ });
135
+ (0, _defineProperty2["default"])(this, "_dialogObserver", {
136
+ onDialogClosed: function onDialogClosed(dialogId) {
137
+ var matchAnnotationId = new RegExp(_constant.FcrUIDialogKey.ANNOTATION, 'ig');
138
+ if (matchAnnotationId.test(dialogId)) {
139
+ if (_this.annotating) {
140
+ _this._annotationProvider.toggleAnnotation();
141
+ }
142
+ }
143
+ }
144
+ });
145
+ _classPrivateFieldInitSpec(this, _A, _init_annotationMainWindow(this, undefined));
146
+ _classPrivateFieldInitSpec(this, _B, _init_resetToolbarStore(this, false));
147
+ _classPrivateFieldInitSpec(this, _C, _init_isShowToolbar(this, false));
148
+ (0, _defineProperty2["default"])(this, "_toolbarStore", undefined);
149
+ (0, _defineProperty2["default"])(this, "_boardOriginWidth", 0);
150
+ (0, _defineProperty2["default"])(this, "_mounted", false);
151
+ (0, _defineProperty2["default"])(this, "_boardContainerObserver", new ResizeObserver(function (entries) {
152
+ var _iterator = _createForOfIteratorHelper(entries),
153
+ _step;
154
+ try {
155
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
156
+ var entry = _step.value;
157
+ var height = entry.contentRect.height;
158
+ // 大小变化后的处理逻辑
159
+ if (height > 0 && _this._memberDataSource.shareScreenVideoRatio > 0 && _this._boardDom) {
160
+ var ratio = _this._memberDataSource.shareScreenVideoRatio;
161
+ var newWidth = height * ratio;
162
+ _this._boardOriginWidth = newWidth;
163
+ _this._boardDom.style.width = "".concat(newWidth, "px");
164
+ }
165
+ }
166
+ } catch (err) {
167
+ _iterator.e(err);
168
+ } finally {
169
+ _iterator.f();
170
+ }
171
+ }));
172
+ localStorageProvider.write('annotation_nickname', memberDataSource.localUser.userName);
173
+ this._dialogProvider = dialogProvider;
174
+ this._deviceProvider = deviceProvider;
175
+ this._annotationProvider = annotationProvider;
176
+ this._sharingProvider = sharingProvider;
177
+ this._memberDataSource = memberDataSource;
178
+ this._roomControl = roomControl;
179
+ this._sharedSecuritySharedDataSource = sharedSecuritySharedDataSource;
180
+ this._sharedScreenSharedDataSource = sharedScreenSharedDataSource;
181
+ // this._dialogProvider.addObserver(this._dialogObserver);
182
+ this._privilegeProvider = privilegeProvider;
183
+ this._messageProvider = messageProvider;
184
+ // this._disposers.push(
185
+ // reaction(
186
+ // () => this.annotating,
187
+ // (annotating) => {
188
+ // if (this._isLocalUserSharingOwner) {
189
+ // if (annotating) {
190
+ // this._removeWindowResizeListenner();
191
+ // } else {
192
+ // this._addWindowResizeListenner();
193
+ // }
194
+ // }
195
+ // },
196
+ // ),
197
+ // reaction(
198
+ // () => this._memberDataSource.shareScreenVideoRatio,
199
+ // (ratio) => {
200
+ // if (ratio > 0 && this._boardDom) {
201
+ // const { height } = this._boardDom.getBoundingClientRect();
202
+ // console.log('annotation current boardDom height:', height);
203
+ // const width = height * ratio;
204
+ // this._boardOriginWidth = width;
205
+ // this._boardDom.style.width = `${width}px`;
206
+ // this._boardDom.style.height = `${height}px`;
207
+ // }
208
+ // },
209
+ // ),
210
+ // // reaction(
211
+ // // () => this._memberDataSource.shareScreenVideoSize,
212
+ // // (size) => {
213
+ // // if (size && this._boardDom) {
214
+ // // this.logger.info('annotation shareScreenVideoSize: ', size);
215
+ // // calcAnnotationAreaSize(this._boardDom, size.width, size.height);
216
+ // // }
217
+ // // },
218
+ // // ),
219
+ // reaction(
220
+ // () => this.isScreenSharing,
221
+ // (sharing) => {
222
+ // if (this._isLocalUserSharingOwner) {
223
+ // if (sharing) {
224
+ // this.screenSharingStarted();
225
+ // } else {
226
+ // this._removeWindowResizeListenner();
227
+ // }
228
+ // }
229
+ // },
230
+ // ),
231
+ // reaction(
232
+ // () => this._annotationProvider.annotationState,
233
+ // (state) => {
234
+ // this.logger.info('annotation transaction state: ', state);
235
+ // if (!this._isLocalUserSharingOwner) {
236
+ // if (state === FcrAnnotationState.START) {
237
+ // this.logger.info('annotation transaction start');
238
+ // this._annotationControl = this._annotationProvider.annotationControl;
239
+ // this._toolbarStore = new ToolbarStore(
240
+ // this._annotationControl! as FcrWhiteboardControl,
241
+ // this._roomControl!,
242
+ // this._annotationProvider,
243
+ // );
244
+ // this.resetToolbarStore = true;
245
+ // } else {
246
+ // this.logger.info('annotation transaction end');
247
+ // this.resetToolbarStore = false;
248
+ // this._boardContainerObserver.disconnect();
249
+ // this._messageProvider.showToast({
250
+ // message: transI18n(
251
+ // 'fmt_screenshare_toast_annotation_controls_screen_sharing_disabled',
252
+ // ),
253
+ // type: 'info',
254
+ // });
255
+ // this._toolbarStore = undefined;
256
+ // this._unmount();
257
+ // this.isShowToolbar = false;
258
+ // }
259
+ // }
260
+ // },
261
+ // ),
262
+ // reaction(
263
+ // () => this._sharedScreenSharedDataSource.screenSharingState,
264
+ // (state) => {
265
+ // if (state === FcrMediaSourceState.CLOSE && this._isLocalUserSharingOwner) {
266
+ // console.log('screen sharing state is close');
267
+ // this._annotationProvider.hideAnnotationWindow();
268
+ // this._removeWindowResizeListenner();
269
+ // }
270
+ // },
271
+ // ),
272
+ // reaction(
273
+ // () => this.allowAnnotationWriteState,
274
+ // (canWrite) => {
275
+ // if (!this._isLocalUserSharingOwner) {
276
+ // // const toastText = canWrite
277
+ // // ? transI18n('fmt_screenshare_toast_host_enabled_annotations')
278
+ // // : transI18n('fmt_screenshare_toast_host_disabled_annotations');
279
+ // // this._messageProvider.showToast({
280
+ // // type: 'info',
281
+ // // message: toastText,
282
+ // // });
283
+ // }
284
+ // if (!canWrite) {
285
+ // this.isShowToolbar = false;
286
+ // }
287
+ // },
288
+ // ),
289
+ // reaction(
290
+ // () => this.annotationHasStart,
291
+ // (hasStart) => {
292
+ // if (!hasStart) {
293
+ // this.isShowToolbar = false;
294
+ // }
295
+ // },
296
+ // ),
297
+ // );
298
+ }
299
+ return (0, _createClass2["default"])(AnnotationStore, [{
300
+ key: "annotationMainWindow",
301
+ get: function get() {
302
+ return _classPrivateFieldGet(_A, this);
303
+ },
304
+ set: function set(v) {
305
+ _classPrivateFieldSet(_A, this, v);
306
+ }
307
+ }, {
308
+ key: "resetToolbarStore",
309
+ get: function get() {
310
+ return _classPrivateFieldGet(_B, this);
311
+ },
312
+ set: function set(v) {
313
+ _classPrivateFieldSet(_B, this, v);
314
+ }
315
+ }, {
316
+ key: "isShowToolbar",
317
+ get: function get() {
318
+ return _classPrivateFieldGet(_C, this);
319
+ },
320
+ set: function set(v) {
321
+ _classPrivateFieldSet(_C, this, v);
322
+ }
323
+ }, {
324
+ key: "hasAnnotationWritePermission",
325
+ get: function get() {
326
+ return this._sharedSecuritySharedDataSource.checkedStateMap.hasAnnotationWritePermission;
327
+ }
328
+ }, {
329
+ key: "screenShareWindowData",
330
+ get: function get() {
331
+ return this._annotationProvider.screenShareWindowData;
332
+ }
333
+ }, {
334
+ key: "isScreenSharing",
335
+ get: function get() {
336
+ return [_type2.FcrScreenSharingState.START_WHIT_ANNOTATION, _type2.FcrScreenSharingState.START_ONLY_SCREEN].includes(this._sharingProvider.screenSharingState);
337
+ }
338
+ }, {
339
+ key: "ownerId",
340
+ get: function get() {
341
+ return this._sharingProvider.screenSharingOwnerId;
342
+ }
343
+ }, {
344
+ key: "_isLocalUserSharingOwner",
345
+ get: function get() {
346
+ return this._memberDataSource.localUser.userId === this.ownerId;
347
+ }
348
+ }, {
349
+ key: "shareWithAudio",
350
+ get: function get() {
351
+ return this._sharedScreenSharedDataSource.shareWithAudio;
352
+ }
353
+ }, {
354
+ key: "localUser",
355
+ get: function get() {
356
+ return this._memberDataSource.localUser;
357
+ }
358
+ }, {
359
+ key: "scalcValue",
360
+ get: function get() {
361
+ return this._annotationProvider.scalcValue;
362
+ }
363
+ }, {
364
+ key: "annotationHasStart",
365
+ get: function get() {
366
+ return this._annotationProvider.annotationHasStart;
367
+ }
368
+ }, {
369
+ key: "annotating",
370
+ get: function get() {
371
+ return this._annotationProvider.annotating;
372
+ }
373
+ }, {
374
+ key: "allowAnnotation",
375
+ get: function get() {
376
+ return this._sharedSecuritySharedDataSource.checkedStateMap.enableAnnotation;
377
+ }
378
+ }, {
379
+ key: "allowAnnotationWriteState",
380
+ get: function get() {
381
+ return this._privilegeProvider.allowAnnotationWriteState();
382
+ }
383
+ }, {
384
+ key: "getToolbarStore",
385
+ value: function getToolbarStore() {
386
+ return this._toolbarStore;
387
+ }
388
+ }, {
389
+ key: "setToolsShow",
390
+ value: function setToolsShow() {
391
+ this.logger.info('setToolsShow ', this.allowAnnotationWriteState);
392
+ if (this.allowAnnotationWriteState) {
393
+ var currentFlag = this.isShowToolbar;
394
+ this.isShowToolbar = !currentFlag;
395
+ if (this._toolbarStore) {
396
+ if (currentFlag) {
397
+ this._toolbarStore.disableToolbar();
398
+ } else {
399
+ this._toolbarStore.resumeToolbar();
400
+ }
401
+ }
402
+ }
403
+ }
404
+ }, {
405
+ key: "zoomIn",
406
+ value: function zoomIn() {
407
+ this._annotationProvider.zoomIn();
408
+ this.calcBoardPosition();
409
+ }
410
+ }, {
411
+ key: "zoomOut",
412
+ value: function zoomOut() {
413
+ this._annotationProvider.zoomOut();
414
+ this.calcBoardPosition();
415
+ }
416
+ }, {
417
+ key: "fullContainer",
418
+ value: function fullContainer() {
419
+ var ratio = this._memberDataSource.shareScreenVideoRatio;
420
+ if (ratio > 0 && this._boardContainerDom) {
421
+ var _this$_boardContainer = this._boardContainerDom.getBoundingClientRect(),
422
+ width = _this$_boardContainer.width,
423
+ height = _this$_boardContainer.height;
424
+ var _getBoundingClientRec = this._boardDom.getBoundingClientRect(),
425
+ boardWidth = _getBoundingClientRec.width,
426
+ boardHeight = _getBoundingClientRec.height;
427
+ var scalc = width / boardWidth;
428
+ this._annotationProvider.fullContainer(scalc);
429
+ this.calcBoardPosition();
430
+ }
431
+ }
432
+ }, {
433
+ key: "setOriginScalc",
434
+ value: function setOriginScalc() {
435
+ this._annotationProvider.setOriginScalc();
436
+ this.calcBoardPosition();
437
+ }
438
+ }, {
439
+ key: "calcBoardPosition",
440
+ value: function calcBoardPosition() {
441
+ if (this._boardContainerDom && this._boardDom) {
442
+ var _this$_boardOriginWid;
443
+ var _this$_boardContainer2 = this._boardContainerDom.getBoundingClientRect(),
444
+ width = _this$_boardContainer2.width,
445
+ height = _this$_boardContainer2.height;
446
+ var computWidth = (_this$_boardOriginWid = this._boardOriginWidth) !== null && _this$_boardOriginWid !== void 0 ? _this$_boardOriginWid : width;
447
+ var newWidth = computWidth * 1;
448
+ var newHeight = height * 1;
449
+ this._boardDom.style.width = "".concat(newWidth, "px");
450
+ this._boardDom.style.height = "".concat(newHeight, "px");
451
+ this._boardDom.style.marginLeft = "".concat((this._boardOriginWidth - newWidth) / 2, "px");
452
+ this._boardDom.style.marginTop = "".concat((height - newHeight) / 2, "px");
453
+ }
454
+ }
455
+ }, {
456
+ key: "handleBoardDomLoad",
457
+ value: function handleBoardDomLoad(ref) {
458
+ this._boardDom = ref;
459
+ this.logger.info('handleBoardDomLoad: ', this._boardDom);
460
+ if (this._boardDom) {
461
+ var _this$_boardDom$getBo = this._boardDom.getBoundingClientRect(),
462
+ height = _this$_boardDom$getBo.height;
463
+ this._boardOriginWidth = height * this._memberDataSource.shareScreenVideoRatio;
464
+ this._mount();
465
+ } else {
466
+ this._mounted = false;
467
+ }
468
+ }
469
+ }, {
470
+ key: "handleBoardContainerDomLoad",
471
+ value: function handleBoardContainerDomLoad(ref) {
472
+ if (ref) {
473
+ this._boardContainerDom = ref;
474
+ this._boardContainerObserver.observe(ref);
475
+ }
476
+ }
477
+ }, {
478
+ key: "screenSharingStarted",
479
+ value: function screenSharingStarted() {
480
+ this._currentShareInfo = this._annotationProvider.currentShareInfo;
481
+ this.logger.info("screenSharingStarting with currentShareInfo: ".concat(JSON.stringify(this._currentShareInfo)));
482
+ this._annotationProvider.setBoundsToAnnotationWindow();
483
+ (0, _rendererEvent.sendEvent)({
484
+ action: _constant.FcrUIRendererEventAction.SET_ANNOTATION_TO_SHOW,
485
+ payload: true
486
+ });
487
+ this.logger.info('screenSharingStarted will add window resize listenner');
488
+ this._addWindowResizeListenner();
489
+ }
490
+ }, {
491
+ key: "release",
492
+ value: function release() {
493
+ this._disposers.forEach(function (disposer) {
494
+ return disposer();
495
+ });
496
+ this._dialogProvider.removeObserver(this._dialogObserver);
497
+ this._removeWindowResizeListenner();
498
+ this._unmount();
499
+ this._boardContainerObserver.disconnect();
500
+ }
501
+ }, {
502
+ key: "_mount",
503
+ value: function _mount() {
504
+ this.logger.info('annotation mount boardMainWindow: ', this._annotationProvider.boardMainWindow);
505
+ this.logger.info('annotation mount boardDom: ', this._boardDom);
506
+ if (this._annotationProvider.boardMainWindow && this._boardDom && !this._mounted) {
507
+ this.logger.info('annotation mount start: ', this._boardDom);
508
+ this._mounted = true;
509
+ var view = this._annotationProvider.boardMainWindow.getContentView();
510
+ this._boardDom.appendChild(view);
511
+ this.logger.info('annotation mount boardMainWindow contentView append: ', view);
512
+ this.logger.info('annotation mount success');
513
+ this.calcBoardPosition();
514
+ }
515
+ }
516
+ }, {
517
+ key: "_unmount",
518
+ value: function _unmount() {
519
+ this.logger.info('annotation unmount ');
520
+ if (this._mounted && this._annotationProvider.boardMainWindow) {
521
+ var _this$_boardDom;
522
+ (_this$_boardDom = this._boardDom) === null || _this$_boardDom === void 0 || _this$_boardDom.removeChild(this._annotationProvider.boardMainWindow.getContentView());
523
+ this.logger.info('annotation unmount remove mainWindow contentView');
524
+ this._close();
525
+ }
526
+ this._mounted = false;
527
+ }
528
+ }, {
529
+ key: "_close",
530
+ value: function _close() {
531
+ if (this._annotationControl) {
532
+ this._annotationControl.close();
533
+ this.logger.info('annotation close');
534
+ }
535
+ }
536
+ }, {
537
+ key: "_updateAnnotationBounds",
538
+ value: function _updateAnnotationBounds(bounds) {
539
+ if (bounds) this._currentShareInfo.bounds = bounds;
540
+ this.logger.info("updateAnnotationBounds ".concat(this._currentShareInfo));
541
+ (0, _rendererEvent.sendEvent)({
542
+ action: _constant.FcrUIRendererEventAction.SET_CURRENT_SHARE_SCREEN_BOUNDS,
543
+ payload: bounds || this._annotationProvider.currentShareInfo.bounds
544
+ });
545
+ }
546
+
547
+ // 使用 sdk 提供的获取窗口列表功能,但是此 api 性能很差,因为它会生成窗口的缩略图,延迟很高
548
+ }, {
549
+ key: "_pollActiveWindow",
550
+ value: function _pollActiveWindow() {
551
+ var _this2 = this;
552
+ requestIdleCallback(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
553
+ var currentWindows, currentWindow;
554
+ return _regenerator["default"].wrap(function _callee$(_context) {
555
+ while (1) switch (_context.prev = _context.next) {
556
+ case 0:
557
+ _context.next = 2;
558
+ return _this2._deviceProvider.getWindowList();
559
+ case 2:
560
+ currentWindows = _context.sent;
561
+ currentWindow = currentWindows.find(function (window) {
562
+ return window.id === _this2._currentShareInfo.id;
563
+ });
564
+ if (currentWindow && (currentWindow.bounds.width !== _this2._currentShareInfo.bounds.width || currentWindow.bounds.height !== _this2._currentShareInfo.bounds.height)) {
565
+ _this2._updateAnnotationBounds(currentWindow.bounds);
566
+ // this.logger.info('The window bounds is the different as the current share bounds');
567
+ } else {
568
+ // this.logger.info('The window bounds is the same as the current share bounds');
569
+ }
570
+ _this2._resizeWatcherTimer = setTimeout(_this2._pollActiveWindow, 200);
571
+ case 6:
572
+ case "end":
573
+ return _context.stop();
574
+ }
575
+ }, _callee);
576
+ })));
577
+ }
578
+
579
+ // 使用第三方 node-window-manager 提供的获取窗口列表功能
580
+ }, {
581
+ key: "_updateBoundsByActiveWindow",
582
+ value: function _updateBoundsByActiveWindow() {
583
+ var _this3 = this;
584
+ var windows = window.runtime.getWindows();
585
+ var activeWindow = windows.find(function (win) {
586
+ return win.id === +_this3._currentShareInfo.id;
587
+ });
588
+ var _this$_currentShareIn = this._currentShareInfo,
589
+ id = _this$_currentShareIn.id,
590
+ bounds = _this$_currentShareIn.bounds;
591
+ var width = bounds.width,
592
+ height = bounds.height,
593
+ x = bounds.x,
594
+ y = bounds.y;
595
+ var activeBounds = activeWindow === null || activeWindow === void 0 ? void 0 : activeWindow.getBounds();
596
+ var isSharingWindow = activeWindow && activeWindow.id === +id;
597
+ var _ref4 = (activeWindow === null || activeWindow === void 0 ? void 0 : activeWindow.getBounds()) || {},
598
+ aw = _ref4.width,
599
+ ah = _ref4.height,
600
+ ax = _ref4.x,
601
+ ay = _ref4.y;
602
+ var isNewBounds = aw !== width || ah !== height || ax !== x || ay !== y;
603
+ this.logger.info("updateBoundsByActiveWindow ".concat(JSON.stringify({
604
+ activeBounds: activeBounds,
605
+ width: width,
606
+ height: height,
607
+ isSharingWindow: isSharingWindow,
608
+ isNewBounds: isNewBounds,
609
+ activeWindow: activeWindow,
610
+ id: id
611
+ })));
612
+ if (isSharingWindow && isNewBounds) {
613
+ this._updateAnnotationBounds(activeBounds);
614
+ this.logger.info('The window bounds is the different as the current share bounds');
615
+ }
616
+ }
617
+ }, {
618
+ key: "_addWindowResizeListenner",
619
+ value: function _addWindowResizeListenner() {
620
+ var _this4 = this;
621
+ var isDisplay = this._currentShareInfo.type === _type.AgoraRtcScreenCaptureType.SCREEN;
622
+ this.logger.info("current sharing type is screen: ".concat(isDisplay, ", has watch resize timer: ").concat(!!this._resizeWatcherTimer));
623
+ if (isDisplay) return;
624
+ if (!this._resizeWatcherTimer) {
625
+ // this._pollSdkWindow();
626
+ this._resizeWatcherTimer = setInterval(function () {
627
+ _this4.logger.info("addWindowResizeListenner interval ".concat(_this4._currentShareInfo));
628
+ _this4._updateBoundsByActiveWindow();
629
+ }, 3000);
630
+ }
631
+ }
632
+ }, {
633
+ key: "_removeWindowResizeListenner",
634
+ value: function _removeWindowResizeListenner() {
635
+ if (this._resizeWatcherTimer) {
636
+ clearInterval(this._resizeWatcherTimer);
637
+ this._resizeWatcherTimer = null;
638
+ }
639
+ }
640
+ }]);
641
+ }();
642
+ _AnnotationStore = AnnotationStore;
643
+ var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_AnnotationStore, [[_mobx.observable, 1, "annotationMainWindow"], [_mobx.observable, 1, "resetToolbarStore"], [_mobx.observable, 1, "isShowToolbar"], [_mobx.computed, 3, "scalcValue"], [_mobx.computed, 3, "annotating"], [_decorator.bound, 2, "getToolbarStore"], [_setToolsShowDecs, 18, "setToolsShow"], [_zoomInDecs, 18, "zoomIn"], [_zoomOutDecs, 18, "zoomOut"], [_fullContainerDecs, 18, "fullContainer"], [_setOriginScalcDecs, 18, "setOriginScalc"], [_calcBoardPositionDecs, 18, "calcBoardPosition"], [_handleBoardDomLoadDecs, 18, "handleBoardDomLoad"], [_handleBoardContainerDomLoadDecs, 18, "handleBoardContainerDomLoad"], [_decorator.bound, 2, "screenSharingStarted"], [_decorator.bound, 2, "release"], [_mountDecs, 18, "_mount"], [_unmountDecs, 18, "_unmount"], [_decorator.bound, 2, "_close"], [_decorator.bound, 2, "_updateAnnotationBounds"], [_decorator.bound, 2, "_pollActiveWindow"], [_decorator.bound, 2, "_updateBoundsByActiveWindow"], [_decorator.bound, 2, "_addWindowResizeListenner"], [_decorator.bound, 2, "_removeWindowResizeListenner"]], []).e, 4);
644
+ _init_annotationMainWindow = _applyDecs$e[0];
645
+ _init_resetToolbarStore = _applyDecs$e[1];
646
+ _init_isShowToolbar = _applyDecs$e[2];
647
+ _initProto = _applyDecs$e[3];
648
+ var AnnotationStoreContext = exports.AnnotationStoreContext = /*#__PURE__*/(0, _react.createContext)({});