fcr-ui-scene 3.6.4 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (468) hide show
  1. package/lib/creator.d.ts +4 -3
  2. package/lib/creator.js +146 -111
  3. package/lib/electron/app.js +1 -1
  4. package/lib/electron/bootstrap-sdk.js +49 -4
  5. package/lib/electron/injections.d.ts +5 -1
  6. package/lib/electron/injections.js +14 -2
  7. package/lib/electron/ipc/type.d.ts +8 -4
  8. package/lib/electron/ipc/type.js +10 -4
  9. package/lib/electron/logger.js +1 -1
  10. package/lib/electron/main.js +5 -2
  11. package/lib/electron/preload.js +34 -5
  12. package/lib/fragments/annotation/index.d.ts +2 -2
  13. package/lib/fragments/annotation/index.js +38 -28
  14. package/lib/fragments/annotation/libs.d.ts +2 -2
  15. package/lib/fragments/annotation/store.d.ts +21 -4
  16. package/lib/fragments/annotation/store.js +281 -84
  17. package/lib/fragments/annotation/style.css +9 -0
  18. package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/item/item.js +1 -1
  19. package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/pen-tool/pen-panel/index.js +1 -1
  20. package/lib/{modules/annotation/components → fragments/annotation}/toolbar/store.d.ts +26 -2
  21. package/lib/{modules/annotation/components → fragments/annotation}/toolbar/store.js +57 -8
  22. package/lib/{modules/annotation/components → fragments/annotation}/toolbar/view.js +36 -3
  23. package/lib/fragments/annotation/view.d.ts +1 -0
  24. package/lib/fragments/annotation/view.js +52 -10
  25. package/lib/modules/action-bar/components/apps/index.js +54 -38
  26. package/lib/modules/action-bar/components/chat/index.js +13 -34
  27. package/lib/modules/action-bar/components/collapse/index.js +1 -1
  28. package/lib/modules/action-bar/components/leave/index.js +9 -9
  29. package/lib/modules/action-bar/components/more/index.js +26 -27
  30. package/lib/modules/action-bar/components/participants/index.js +23 -39
  31. package/lib/modules/action-bar/components/record/index.js +7 -13
  32. package/lib/modules/action-bar/components/screen-share/index.js +4 -24
  33. package/lib/modules/action-bar/components/security/index.js +29 -34
  34. package/lib/modules/action-bar/components/settings/index.js +13 -19
  35. package/lib/modules/action-bar/index.d.ts +4 -0
  36. package/lib/modules/action-bar/index.js +3 -1
  37. package/lib/modules/action-bar/store.d.ts +16 -6
  38. package/lib/modules/action-bar/store.js +63 -25
  39. package/lib/modules/action-bar/types.d.ts +3 -3
  40. package/lib/modules/action-bar/view.js +2 -3
  41. package/lib/modules/annotation/annotation-index.d.ts +2 -0
  42. package/lib/modules/annotation/annotation-index.js +80 -0
  43. package/lib/modules/annotation/annotation-toolbar-store.d.ts +82 -0
  44. package/lib/modules/annotation/annotation-toolbar-store.js +501 -0
  45. package/lib/modules/annotation/components/color-picker/components/color.d.ts +5 -0
  46. package/lib/modules/annotation/components/color-picker/components/color.js +38 -0
  47. package/lib/modules/annotation/components/color-picker/components/panel.d.ts +1 -0
  48. package/lib/modules/annotation/components/color-picker/components/panel.js +109 -0
  49. package/lib/modules/annotation/components/color-picker/components/picker.d.ts +1 -0
  50. package/lib/modules/annotation/components/color-picker/components/picker.js +75 -0
  51. package/lib/modules/annotation/components/color-picker/index.d.ts +2 -0
  52. package/lib/modules/annotation/components/color-picker/index.js +47 -0
  53. package/lib/modules/annotation/components/eraser-picker.d.ts +4 -0
  54. package/lib/modules/annotation/components/eraser-picker.js +144 -0
  55. package/lib/modules/annotation/components/expansion/index.d.ts +1 -0
  56. package/lib/modules/annotation/components/expansion/index.js +100 -0
  57. package/lib/modules/annotation/components/extra-tool-picker.d.ts +1 -0
  58. package/lib/modules/annotation/components/extra-tool-picker.js +62 -0
  59. package/lib/modules/annotation/components/history.d.ts +2 -0
  60. package/lib/modules/annotation/components/history.js +78 -0
  61. package/lib/modules/annotation/components/icons/fold-icon.d.ts +2 -0
  62. package/lib/modules/annotation/components/icons/fold-icon.js +41 -0
  63. package/lib/modules/annotation/components/icons/move-icon.d.ts +1 -0
  64. package/lib/modules/annotation/components/icons/move-icon.js +66 -0
  65. package/lib/modules/annotation/components/item/index.d.ts +1 -0
  66. package/lib/modules/annotation/components/item/index.js +43 -0
  67. package/lib/modules/annotation/components/move-handle.d.ts +5 -0
  68. package/lib/modules/annotation/components/move-handle.js +134 -0
  69. package/lib/modules/annotation/components/pen-picker.d.ts +4 -0
  70. package/lib/modules/annotation/components/pen-picker.js +155 -0
  71. package/lib/modules/annotation/components/screen-capture-picker.d.ts +4 -0
  72. package/lib/modules/annotation/components/screen-capture-picker.js +85 -0
  73. package/lib/modules/annotation/components/shape-picker.d.ts +4 -0
  74. package/lib/modules/annotation/components/shape-picker.js +210 -0
  75. package/lib/modules/annotation/hooks/index.d.ts +14 -0
  76. package/lib/modules/annotation/hooks/index.js +292 -0
  77. package/lib/modules/annotation/index.d.ts +4 -1
  78. package/lib/modules/annotation/index.js +20 -22
  79. package/lib/modules/annotation/store.d.ts +59 -18
  80. package/lib/modules/annotation/store.js +503 -263
  81. package/lib/modules/annotation/style.css +10 -0
  82. package/lib/modules/annotation/view.js +9 -11
  83. package/lib/modules/chat/chat-room-store.js +5 -2
  84. package/lib/modules/chat/components/chat-select/index.js +1 -1
  85. package/lib/modules/chat/components/chat-select/select-item/index.js +10 -3
  86. package/lib/modules/chat/components/message-list/message-item/index.js +4 -2
  87. package/lib/modules/chat/index.d.ts +2 -0
  88. package/lib/modules/chat/index.js +13 -3
  89. package/lib/modules/chat/store.d.ts +3 -0
  90. package/lib/modules/chat/store.js +12 -6
  91. package/lib/modules/chat/types.d.ts +1 -0
  92. package/lib/modules/chat/types.js +2 -1
  93. package/lib/modules/chat/util.js +2 -1
  94. package/lib/modules/chat/view.js +6 -3
  95. package/lib/modules/{action-bar/components → components}/apps/app-item/index.d.ts +1 -1
  96. package/lib/modules/components/apps/app-list.d.ts +3 -0
  97. package/lib/modules/{action-bar/components → components}/apps/app-list.js +2 -4
  98. package/lib/modules/components/apps/types.d.ts +14 -0
  99. package/lib/modules/components/apps/types.js +6 -0
  100. package/lib/modules/components/device-control/components/carmera/index.js +71 -68
  101. package/lib/modules/components/device-control/components/microphone/index.js +99 -97
  102. package/lib/modules/components/device-control/store.d.ts +1 -1
  103. package/lib/modules/components/member-window/components/member-actions/components/audio-control.js +7 -7
  104. package/lib/modules/components/member-window/components/member-actions/components/icon-buttons/index.d.ts +0 -2
  105. package/lib/modules/components/member-window/components/member-actions/components/icon-buttons/index.js +4 -7
  106. package/lib/modules/components/member-window/components/member-actions/components/icon-status.d.ts +0 -1
  107. package/lib/modules/components/member-window/components/member-actions/components/icon-status.js +19 -36
  108. package/lib/modules/components/member-window/components/member-actions/components/more-actions.d.ts +1 -0
  109. package/lib/modules/components/member-window/components/member-actions/components/more-actions.js +9 -2
  110. package/lib/modules/components/member-window/components/member-actions/components/user-info.js +0 -3
  111. package/lib/modules/components/member-window/components/member-actions/components/user-tag.js +15 -11
  112. package/lib/modules/components/member-window/components/member-actions/index.js +10 -2
  113. package/lib/modules/components/member-window/components/member-actions/libs/index.js +2 -2
  114. package/lib/modules/components/member-window/components/video-player/components/local-video-player-with-zoom.d.ts +12 -0
  115. package/lib/modules/components/member-window/components/video-player/components/local-video-player-with-zoom.js +75 -0
  116. package/lib/modules/components/member-window/components/video-player/components/local-video-player.d.ts +1 -7
  117. package/lib/modules/components/member-window/components/video-player/components/local-video-player.js +7 -47
  118. package/lib/modules/components/member-window/components/video-player/components/remote-video-player-with-zoom.d.ts +12 -0
  119. package/lib/modules/components/member-window/components/video-player/components/remote-video-player-with-zoom.js +68 -0
  120. package/lib/modules/components/member-window/components/video-player/components/remote-video-player.d.ts +1 -9
  121. package/lib/modules/components/member-window/components/video-player/components/remote-video-player.js +7 -49
  122. package/lib/modules/components/member-window/components/video-player/components/zoomable-container.d.ts +15 -0
  123. package/lib/modules/components/member-window/components/video-player/components/zoomable-container.js +255 -0
  124. package/lib/modules/components/member-window/components/video-player/index.d.ts +2 -0
  125. package/lib/modules/components/member-window/components/video-player/index.js +8 -2
  126. package/lib/modules/components/member-window/index.css +16 -6
  127. package/lib/modules/components/member-window/index.d.ts +1 -1
  128. package/lib/modules/components/member-window/index.js +12 -4
  129. package/lib/modules/components/member-window/types.d.ts +2 -0
  130. package/lib/modules/components/security-menu/index.js +6 -5
  131. package/lib/modules/control-bar/components/annotation-button/index.js +21 -8
  132. package/lib/modules/control-bar/components/more-actions/index.css +13 -0
  133. package/lib/modules/control-bar/components/more-actions/index.js +1 -1
  134. package/lib/modules/control-bar/components/share-audio/index.css +90 -0
  135. package/lib/modules/control-bar/components/share-audio/index.d.ts +15 -0
  136. package/lib/modules/control-bar/components/share-audio/index.js +173 -0
  137. package/lib/modules/control-bar/components/share-state-nav/index.css +5 -0
  138. package/lib/modules/control-bar/components/share-state-nav/index.js +14 -2
  139. package/lib/modules/control-bar/index.d.ts +2 -0
  140. package/lib/modules/control-bar/index.js +9 -1
  141. package/lib/modules/control-bar/store.d.ts +16 -7
  142. package/lib/modules/control-bar/store.js +36 -12
  143. package/lib/modules/control-bar/view.d.ts +4 -0
  144. package/lib/modules/control-bar/view.js +180 -90
  145. package/lib/modules/device-pretest/store.d.ts +1 -1
  146. package/lib/modules/dialog/components/dialog-container/component/body.d.ts +1 -1
  147. package/lib/modules/dialog/components/dialog-container/index.css +1 -0
  148. package/lib/modules/dialog/components/dialog-container/index.d.ts +2 -1
  149. package/lib/modules/dialog/components/dialog-container/index.js +27 -10
  150. package/lib/modules/dialog/components/host-area-container/index.js +4 -4
  151. package/lib/modules/dialog/components/normal-window/index.d.ts +19 -0
  152. package/lib/modules/dialog/components/normal-window/index.js +69 -0
  153. package/lib/modules/dialog/{components → dialogs}/annotation-tool/index.js +17 -15
  154. package/lib/modules/dialog/dialogs/chat/components/actions.d.ts +1 -0
  155. package/lib/modules/dialog/dialogs/chat/components/actions.js +33 -0
  156. package/lib/modules/dialog/{components → dialogs}/chat/index.d.ts +1 -1
  157. package/lib/modules/dialog/dialogs/chat/index.js +59 -0
  158. package/lib/modules/dialog/dialogs/confirm-leave-meeting/index.d.ts +6 -0
  159. package/lib/modules/dialog/{components → dialogs}/confirm-leave-meeting/index.js +13 -37
  160. package/lib/modules/dialog/{components → dialogs}/connection-gateway/index.js +19 -12
  161. package/lib/modules/dialog/{components → dialogs}/control-bar/index.js +2 -2
  162. package/lib/modules/dialog/{components → dialogs}/device-setting/index.js +20 -13
  163. package/lib/modules/dialog/dialogs/end-meeting/index.d.ts +12 -0
  164. package/lib/modules/dialog/dialogs/end-meeting/index.js +45 -0
  165. package/lib/modules/dialog/{components/interpreter/electron.js → dialogs/interpreter/index.js} +17 -11
  166. package/lib/modules/dialog/dialogs/invite/index.d.ts +3 -0
  167. package/lib/modules/dialog/{components → dialogs}/invite/index.js +9 -25
  168. package/lib/modules/dialog/dialogs/live-streaming/index.d.ts +2 -0
  169. package/lib/modules/dialog/{components → dialogs}/live-streaming/index.js +11 -34
  170. package/lib/modules/dialog/dialogs/participant/components/actions.d.ts +1 -0
  171. package/lib/modules/dialog/dialogs/participant/components/actions.js +32 -0
  172. package/lib/modules/dialog/dialogs/participant/components/title.d.ts +1 -0
  173. package/lib/modules/dialog/dialogs/participant/components/title.js +19 -0
  174. package/lib/modules/dialog/dialogs/participant/index.d.ts +2 -0
  175. package/lib/modules/dialog/dialogs/participant/index.js +53 -0
  176. package/lib/modules/dialog/dialogs/pre-setting/index.js +62 -0
  177. package/lib/modules/dialog/dialogs/rename/index.js +35 -0
  178. package/lib/modules/dialog/{components → dialogs}/share-screen-selection/index.js +1 -1
  179. package/lib/modules/dialog/{components → dialogs}/video-window/index.js +11 -8
  180. package/lib/modules/dialog/{components → dialogs}/whiteboard/index.js +2 -3
  181. package/lib/modules/dialog/{components → dialogs}/widget/electron.js +1 -1
  182. package/lib/modules/dialog/{components → dialogs}/widget/index.js +1 -1
  183. package/lib/modules/dialog/hooks/use-web-drag.d.ts +8 -0
  184. package/lib/modules/dialog/hooks/use-web-drag.js +73 -0
  185. package/lib/modules/dialog/hooks/useElectron.d.ts +2 -7
  186. package/lib/modules/dialog/hooks/useElectron.js +46 -156
  187. package/lib/modules/dialog/index.d.ts +4 -0
  188. package/lib/modules/dialog/index.js +4 -2
  189. package/lib/modules/dialog/level-config.d.ts +11 -0
  190. package/lib/modules/dialog/level-config.js +21 -0
  191. package/lib/modules/dialog/store.d.ts +15 -6
  192. package/lib/modules/dialog/store.js +40 -54
  193. package/lib/modules/dialog/type.d.ts +15 -12
  194. package/lib/modules/event-confirm/components/window/index.d.ts +1 -4
  195. package/lib/modules/event-confirm/components/window/index.js +34 -23
  196. package/lib/modules/event-confirm/index.d.ts +2 -0
  197. package/lib/modules/event-confirm/index.js +3 -2
  198. package/lib/modules/event-confirm/store.d.ts +9 -1
  199. package/lib/modules/event-confirm/store.js +24 -16
  200. package/lib/modules/event-confirm/view.js +11 -22
  201. package/lib/modules/event-sound/index.d.ts +2 -0
  202. package/lib/modules/event-sound/index.js +8 -1
  203. package/lib/modules/event-toast/index.css +10 -0
  204. package/lib/modules/event-toast/store.d.ts +1 -1
  205. package/lib/modules/event-toast/store.js +17 -15
  206. package/lib/modules/event-toast/view.js +2 -1
  207. package/lib/modules/interpreter/interpreter-list/interpreter-item/components/pick-user/index.js +4 -2
  208. package/lib/modules/interpreter/interpreter-list/interpreter-item/components/pick-user/option-Item.js +2 -1
  209. package/lib/modules/interpreter/store.d.ts +1 -0
  210. package/lib/modules/interpreter/store.js +12 -5
  211. package/lib/modules/interpreter/view.js +7 -1
  212. package/lib/modules/layout/components/Aside.js +4 -0
  213. package/lib/modules/layout/components/Carousel.js +3 -1
  214. package/lib/modules/layout/components/CommonVideoRenderer.d.ts +3 -1
  215. package/lib/modules/layout/components/CommonVideoRenderer.js +13 -9
  216. package/lib/modules/layout/components/Gallery.js +11 -3
  217. package/lib/modules/layout/index.css +1 -0
  218. package/lib/modules/layout/index.d.ts +2 -0
  219. package/lib/modules/layout/index.js +4 -3
  220. package/lib/modules/layout/store.d.ts +9 -5
  221. package/lib/modules/layout/store.js +38 -46
  222. package/lib/modules/participant/components/confirm-input/index.css +4 -0
  223. package/lib/modules/participant/components/confirm-input/index.d.ts +1 -0
  224. package/lib/modules/participant/components/confirm-input/index.js +2 -1
  225. package/lib/modules/participant/components/participants/components/participants/components/attendee/index.js +2 -1
  226. package/lib/modules/participant/components/participants/components/participants/index.js +11 -3
  227. package/lib/modules/participant/components/participants/components/render-user/components/attendee/index.js +7 -3
  228. package/lib/modules/participant/components/participants/types.d.ts +1 -0
  229. package/lib/modules/participant/store.d.ts +2 -1
  230. package/lib/modules/participant/store.js +23 -9
  231. package/lib/modules/phone-audio-connect/store.d.ts +4 -4
  232. package/lib/modules/setting/audio-settings/audio-settings.js +6 -17
  233. package/lib/modules/setting/config.d.ts +16 -0
  234. package/lib/modules/setting/config.js +17 -1
  235. package/lib/modules/setting/index.d.ts +2 -4
  236. package/lib/modules/setting/index.js +7 -16
  237. package/lib/modules/setting/minutes-settings/minutes-settings.js +0 -4
  238. package/lib/modules/setting/state/index.js +5 -5
  239. package/lib/modules/setting/store.d.ts +37 -33
  240. package/lib/modules/setting/store.js +275 -261
  241. package/lib/modules/setting/translate-settings/language-select.js +0 -2
  242. package/lib/modules/setting/video-settings/video-settings-basic.js +6 -6
  243. package/lib/modules/setting/video-settings/video-settings.js +2 -2
  244. package/lib/modules/setting/view.js +1 -1
  245. package/lib/modules/share-screen/components/control-bar/index.css +75 -0
  246. package/lib/modules/share-screen/components/control-bar/index.d.ts +3 -0
  247. package/lib/modules/share-screen/components/control-bar/index.js +88 -0
  248. package/lib/modules/share-screen/components/control-bar/items/annotation-edit-btn/index.d.ts +8 -0
  249. package/lib/modules/share-screen/components/control-bar/items/annotation-edit-btn/index.js +46 -0
  250. package/lib/modules/share-screen/components/control-bar/items/full-container-btn/index.d.ts +6 -0
  251. package/lib/modules/share-screen/components/control-bar/items/full-container-btn/index.js +32 -0
  252. package/lib/modules/share-screen/components/control-bar/items/original-size-btn/index.d.ts +6 -0
  253. package/lib/modules/share-screen/components/control-bar/items/original-size-btn/index.js +32 -0
  254. package/lib/modules/share-screen/components/control-bar/items/zoom-in-btn/index.d.ts +6 -0
  255. package/lib/modules/share-screen/components/control-bar/items/zoom-in-btn/index.js +32 -0
  256. package/lib/modules/share-screen/components/control-bar/items/zoom-out-btn/index.d.ts +6 -0
  257. package/lib/modules/share-screen/components/control-bar/items/zoom-out-btn/index.js +32 -0
  258. package/lib/modules/share-screen/components/selection/index.js +28 -14
  259. package/lib/modules/share-screen/components/share-scenario/index.d.ts +5 -0
  260. package/lib/modules/share-screen/components/share-scenario/index.js +47 -0
  261. package/lib/modules/share-screen/index.d.ts +4 -2
  262. package/lib/modules/share-screen/index.js +11 -2
  263. package/lib/modules/share-screen/store.d.ts +32 -11
  264. package/lib/modules/share-screen/store.js +273 -192
  265. package/lib/modules/share-screen/view.js +2 -2
  266. package/lib/modules/state-bar/index.js +2 -3
  267. package/lib/modules/state-bar/layout-config.d.ts +2 -4
  268. package/lib/modules/state-bar/layout-config.js +10 -5
  269. package/lib/modules/state-bar/live-streaming-state.js +0 -1
  270. package/lib/modules/state-bar/store.d.ts +7 -7
  271. package/lib/modules/state-bar/store.js +17 -15
  272. package/lib/modules/state-bar/view.js +19 -23
  273. package/lib/modules/video-window/components/members/index.js +3 -2
  274. package/lib/modules/video-window/index.js +0 -3
  275. package/lib/modules/waiting-room-layout/index.css +3 -3
  276. package/lib/modules/waiting-room-layout/index.js +2 -2
  277. package/lib/modules/waiting-room-layout/view.js +1 -0
  278. package/lib/modules/whiteboard/components/control-bar/index.js +2 -2
  279. package/lib/modules/whiteboard/components/control-bar/store.d.ts +4 -1
  280. package/lib/modules/whiteboard/components/control-bar/store.js +4 -2
  281. package/lib/modules/whiteboard/components/toolbar/components/pen-picker.js +4 -4
  282. package/lib/modules/whiteboard/components/toolbar/hooks/index.d.ts +0 -14
  283. package/lib/modules/whiteboard/components/toolbar/hooks/index.js +4 -155
  284. package/lib/modules/whiteboard/components/toolbar/store.d.ts +4 -2
  285. package/lib/modules/whiteboard/components/toolbar/store.js +37 -25
  286. package/lib/modules/whiteboard/components/toolbar/style.css +1 -0
  287. package/lib/modules/whiteboard/index.d.ts +3 -1
  288. package/lib/modules/whiteboard/index.js +26 -23
  289. package/lib/modules/widget/view.js +4 -0
  290. package/lib/providers/ability-provider.d.ts +2 -0
  291. package/lib/providers/annotation-provider.d.ts +43 -47
  292. package/lib/providers/annotation-provider.js +94 -142
  293. package/lib/providers/app-list-provider.d.ts +98 -0
  294. package/lib/providers/app-list-provider.js +251 -0
  295. package/lib/providers/device-provider.d.ts +31 -23
  296. package/lib/providers/device-provider.js +493 -444
  297. package/lib/providers/device-stream-provider.js +2 -2
  298. package/lib/providers/event-provider.d.ts +0 -4
  299. package/lib/providers/event-provider.js +0 -10
  300. package/lib/providers/interpreter-provider.js +10 -7
  301. package/lib/providers/privilege-provider.d.ts +1 -1
  302. package/lib/providers/privilege-provider.js +3 -2
  303. package/lib/providers/renderer-provider.d.ts +1 -0
  304. package/lib/providers/renderer-provider.js +7 -2
  305. package/lib/providers/room-provider.d.ts +3 -1
  306. package/lib/providers/room-provider.js +40 -14
  307. package/lib/providers/screen-share-provider.d.ts +73 -17
  308. package/lib/providers/screen-share-provider.js +222 -100
  309. package/lib/providers/sharing-provider.d.ts +0 -1
  310. package/lib/providers/sharing-provider.js +3 -9
  311. package/lib/providers/user-setting-storage-provider.d.ts +1 -0
  312. package/lib/providers/user-setting-storage-provider.js +5 -12
  313. package/lib/providers/widget-provider.d.ts +19 -0
  314. package/lib/providers/widget-provider.js +28 -2
  315. package/lib/runtime.d.ts +10 -1
  316. package/lib/scenes/main-scene.d.ts +12 -2
  317. package/lib/scenes/main-scene.js +54 -28
  318. package/lib/scenes/waiting-scene.d.ts +11 -0
  319. package/lib/scenes/waiting-scene.js +34 -8
  320. package/lib/schema.d.ts +6 -0
  321. package/lib/schema.js +5 -1
  322. package/lib/shared-data-source/annotation-data.d.ts +17 -0
  323. package/lib/shared-data-source/annotation-data.js +110 -0
  324. package/lib/shared-data-source/app-list-data.d.ts +34 -0
  325. package/lib/shared-data-source/app-list-data.js +133 -0
  326. package/lib/shared-data-source/config.d.ts +26 -7
  327. package/lib/shared-data-source/config.js +29 -11
  328. package/lib/shared-data-source/confirm-data.d.ts +25 -0
  329. package/lib/shared-data-source/confirm-data.js +97 -0
  330. package/lib/shared-data-source/interpreter.d.ts +1 -0
  331. package/lib/shared-data-source/layout-data.d.ts +2 -0
  332. package/lib/shared-data-source/layout-data.js +14 -3
  333. package/lib/shared-data-source/meeting-time.d.ts +23 -1
  334. package/lib/shared-data-source/meeting-time.js +160 -43
  335. package/lib/shared-data-source/member-data.d.ts +10 -9
  336. package/lib/shared-data-source/member-data.js +55 -48
  337. package/lib/shared-data-source/screen-share-data.d.ts +100 -17
  338. package/lib/shared-data-source/screen-share-data.js +142 -22
  339. package/lib/shared-data-source/setting.d.ts +36 -4
  340. package/lib/shared-data-source/setting.js +92 -57
  341. package/lib/shared-data-source/video-window.d.ts +3 -0
  342. package/lib/shared-data-source/video-window.js +52 -30
  343. package/lib/shared-data-source/waiting-room.js +4 -2
  344. package/lib/translations/enUS.d.ts +62 -7
  345. package/lib/translations/enUS.js +71 -14
  346. package/lib/translations/zhCN.d.ts +62 -7
  347. package/lib/translations/zhCN.js +73 -16
  348. package/lib/type.d.ts +23 -5
  349. package/lib/type.js +6 -2
  350. package/lib/ui-manager.d.ts +5 -16
  351. package/lib/ui-manager.js +15 -57
  352. package/lib/ui-scene.d.ts +31 -6
  353. package/lib/ui-scene.js +180 -169
  354. package/lib/utilities/constant.d.ts +67 -63
  355. package/lib/utilities/constant.js +65 -61
  356. package/lib/utilities/dialog-utils.d.ts +66 -0
  357. package/lib/utilities/dialog-utils.js +188 -0
  358. package/lib/utilities/logger.js +3 -3
  359. package/lib/utilities/meeting-detail.js +1 -1
  360. package/lib/utilities/parameters.d.ts +1 -0
  361. package/lib/utilities/parameters.js +5 -1
  362. package/lib/utilities/renderer-event.d.ts +1 -1
  363. package/lib/utilities/screen-capture-permission.d.ts +1 -0
  364. package/lib/utilities/screen-capture-permission.js +9 -1
  365. package/lib/utilities/tools.d.ts +0 -66
  366. package/lib/utilities/tools.js +9 -186
  367. package/package.json +5 -6
  368. package/public/index.html +11 -1
  369. package/lib/modules/action-bar/components/apps/app-list.d.ts +0 -3
  370. package/lib/modules/action-bar/components/apps/useAppItemOptions.d.ts +0 -17
  371. package/lib/modules/action-bar/components/apps/useAppItemOptions.js +0 -30
  372. package/lib/modules/action-bar/components/apps/useBeautyBackground.d.ts +0 -10
  373. package/lib/modules/action-bar/components/apps/useBeautyBackground.js +0 -36
  374. package/lib/modules/action-bar/components/apps/useInterpreter.d.ts +0 -14
  375. package/lib/modules/action-bar/components/apps/useInterpreter.js +0 -37
  376. package/lib/modules/action-bar/components/apps/useLiveStreaming.d.ts +0 -16
  377. package/lib/modules/action-bar/components/apps/useLiveStreaming.js +0 -41
  378. package/lib/modules/action-bar/components/apps/useWidgetList.d.ts +0 -10
  379. package/lib/modules/action-bar/components/apps/useWidgetList.js +0 -39
  380. package/lib/modules/annotation/components/control-bar/index.css +0 -48
  381. package/lib/modules/annotation/components/control-bar/index.d.ts +0 -3
  382. package/lib/modules/annotation/components/control-bar/index.js +0 -142
  383. package/lib/modules/annotation/components/toolbar/index.d.ts +0 -0
  384. package/lib/modules/annotation/components/toolbar/index.js +0 -1
  385. package/lib/modules/dialog/components/chat/electron.d.ts +0 -2
  386. package/lib/modules/dialog/components/chat/electron.js +0 -35
  387. package/lib/modules/dialog/components/chat/index.js +0 -67
  388. package/lib/modules/dialog/components/confirm-leave-meeting/index.d.ts +0 -6
  389. package/lib/modules/dialog/components/connection-gateway/electron.d.ts +0 -5
  390. package/lib/modules/dialog/components/connection-gateway/electron.js +0 -33
  391. package/lib/modules/dialog/components/device-setting/electron.d.ts +0 -2
  392. package/lib/modules/dialog/components/device-setting/electron.js +0 -37
  393. package/lib/modules/dialog/components/interpreter/electron.d.ts +0 -2
  394. package/lib/modules/dialog/components/interpreter/index.js +0 -33
  395. package/lib/modules/dialog/components/invite/index.d.ts +0 -3
  396. package/lib/modules/dialog/components/live-streaming/index.d.ts +0 -4
  397. package/lib/modules/dialog/components/participant/electron.d.ts +0 -2
  398. package/lib/modules/dialog/components/participant/electron.js +0 -35
  399. package/lib/modules/dialog/components/participant/index.d.ts +0 -2
  400. package/lib/modules/dialog/components/participant/index.js +0 -65
  401. package/lib/modules/dialog/components/pre-setting/electron.d.ts +0 -2
  402. package/lib/modules/dialog/components/pre-setting/electron.js +0 -51
  403. package/lib/modules/dialog/components/pre-setting/index.js +0 -38
  404. package/lib/modules/dialog/components/pre-setting-container/component/body.d.ts +0 -8
  405. package/lib/modules/dialog/components/pre-setting-container/component/body.js +0 -78
  406. package/lib/modules/dialog/components/pre-setting-container/index.css +0 -82
  407. package/lib/modules/dialog/components/pre-setting-container/index.d.ts +0 -18
  408. package/lib/modules/dialog/components/pre-setting-container/index.js +0 -116
  409. package/lib/modules/dialog/components/rename/index.js +0 -72
  410. package/lib/modules/dialog/dialogs.d.ts +0 -3
  411. package/lib/modules/dialog/dialogs.js +0 -28
  412. package/lib/utilities/setting-config-storage.d.ts +0 -18
  413. package/lib/utilities/setting-config-storage.js +0 -133
  414. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/color-tool/color-panel/index.d.ts +0 -0
  415. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/color-tool/color-panel/index.js +0 -0
  416. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/color-tool/index.d.ts +0 -0
  417. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/color-tool/index.js +0 -0
  418. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/graphic-tool/graphic-panel/index.d.ts +0 -0
  419. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/graphic-tool/graphic-panel/index.js +0 -0
  420. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/graphic-tool/graphic-panel/libs.d.ts +0 -0
  421. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/graphic-tool/graphic-panel/libs.js +0 -0
  422. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/graphic-tool/index.d.ts +0 -0
  423. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/graphic-tool/index.js +0 -0
  424. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/item/item.d.ts +0 -0
  425. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/item/style.css +0 -0
  426. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/panel/index.d.ts +0 -0
  427. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/panel/index.js +0 -0
  428. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/panel/style.css +0 -0
  429. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/pen-tool/index.d.ts +0 -0
  430. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/pen-tool/index.js +0 -0
  431. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/pen-tool/pen-panel/index.d.ts +0 -0
  432. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/tips/index.d.ts +0 -0
  433. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/tips/index.js +0 -0
  434. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/components/tips/style.css +0 -0
  435. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/style.css +0 -0
  436. /package/lib/{modules/annotation/components → fragments/annotation}/toolbar/view.d.ts +0 -0
  437. /package/lib/modules/{action-bar/components → components}/apps/app-item/index.css +0 -0
  438. /package/lib/modules/{action-bar/components → components}/apps/app-item/index.js +0 -0
  439. /package/lib/modules/{action-bar/components → components}/apps/index.css +0 -0
  440. /package/lib/modules/dialog/{components → dialogs}/annotation-tool/index.d.ts +0 -0
  441. /package/lib/modules/dialog/{components → dialogs}/confirm/index.d.ts +0 -0
  442. /package/lib/modules/dialog/{components → dialogs}/confirm/index.js +0 -0
  443. /package/lib/modules/dialog/{components → dialogs}/connection-gateway/index.d.ts +0 -0
  444. /package/lib/modules/dialog/{components → dialogs}/connection-gateway/tabs.d.ts +0 -0
  445. /package/lib/modules/dialog/{components → dialogs}/connection-gateway/tabs.js +0 -0
  446. /package/lib/modules/dialog/{components → dialogs}/control-bar/index.d.ts +0 -0
  447. /package/lib/modules/dialog/{components → dialogs}/device-setting/index.css +0 -0
  448. /package/lib/modules/dialog/{components → dialogs}/device-setting/index.d.ts +0 -0
  449. /package/lib/modules/dialog/{components → dialogs}/interpreter/index.css +0 -0
  450. /package/lib/modules/dialog/{components → dialogs}/interpreter/index.d.ts +0 -0
  451. /package/lib/modules/dialog/{components → dialogs}/pre-setting/index.css +0 -0
  452. /package/lib/modules/dialog/{components → dialogs}/pre-setting/index.d.ts +0 -0
  453. /package/lib/modules/dialog/{components → dialogs}/rename/index.d.ts +0 -0
  454. /package/lib/modules/dialog/{components → dialogs}/share-screen-selection/index.d.ts +0 -0
  455. /package/lib/modules/dialog/{components → dialogs}/system-preference/assets/bg1.png +0 -0
  456. /package/lib/modules/dialog/{components → dialogs}/system-preference/assets/bg2.png +0 -0
  457. /package/lib/modules/dialog/{components → dialogs}/system-preference/assets/fcr_png_host.png +0 -0
  458. /package/lib/modules/dialog/{components → dialogs}/system-preference/electron.d.ts +0 -0
  459. /package/lib/modules/dialog/{components → dialogs}/system-preference/electron.js +0 -0
  460. /package/lib/modules/dialog/{components → dialogs}/system-preference/index.css +0 -0
  461. /package/lib/modules/dialog/{components → dialogs}/system-preference/index.d.ts +0 -0
  462. /package/lib/modules/dialog/{components → dialogs}/system-preference/index.js +0 -0
  463. /package/lib/modules/dialog/{components → dialogs}/toast/index.d.ts +0 -0
  464. /package/lib/modules/dialog/{components → dialogs}/toast/index.js +0 -0
  465. /package/lib/modules/dialog/{components → dialogs}/video-window/index.d.ts +0 -0
  466. /package/lib/modules/dialog/{components → dialogs}/whiteboard/index.d.ts +0 -0
  467. /package/lib/modules/dialog/{components → dialogs}/widget/electron.d.ts +0 -0
  468. /package/lib/modules/dialog/{components → dialogs}/widget/index.d.ts +0 -0
@@ -2,16 +2,11 @@
2
2
 
3
3
  require("core-js/modules/es.symbol.js");
4
4
  require("core-js/modules/es.symbol.description.js");
5
- require("core-js/modules/es.symbol.iterator.js");
6
5
  require("core-js/modules/es.symbol.to-primitive.js");
7
6
  require("core-js/modules/es.error.cause.js");
8
7
  require("core-js/modules/es.error.to-string.js");
9
- require("core-js/modules/es.array.from.js");
10
8
  require("core-js/modules/es.array.is-array.js");
11
- require("core-js/modules/es.array.slice.js");
12
9
  require("core-js/modules/es.date.to-primitive.js");
13
- require("core-js/modules/es.date.to-string.js");
14
- require("core-js/modules/es.function.bind.js");
15
10
  require("core-js/modules/es.function.name.js");
16
11
  require("core-js/modules/es.map.js");
17
12
  require("core-js/modules/es.number.constructor.js");
@@ -42,13 +37,17 @@ Object.defineProperty(exports, "__esModule", {
42
37
  exports.AnnotationStoreContext = exports.AnnotationStore = void 0;
43
38
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
44
39
  require("core-js/modules/es.array.concat.js");
40
+ require("core-js/modules/es.array.filter.js");
45
41
  require("core-js/modules/es.array.find.js");
46
42
  require("core-js/modules/es.array.for-each.js");
47
43
  require("core-js/modules/es.array.includes.js");
48
44
  require("core-js/modules/es.array.iterator.js");
45
+ require("core-js/modules/es.array.map.js");
49
46
  require("core-js/modules/es.array.push.js");
50
47
  require("core-js/modules/es.date.to-json.js");
48
+ require("core-js/modules/es.function.bind.js");
51
49
  require("core-js/modules/es.json.stringify.js");
50
+ require("core-js/modules/es.object.keys.js");
52
51
  require("core-js/modules/es.object.to-string.js");
53
52
  require("core-js/modules/es.promise.js");
54
53
  require("core-js/modules/es.regexp.constructor.js");
@@ -60,8 +59,10 @@ require("core-js/modules/es.regexp.to-string.js");
60
59
  require("core-js/modules/es.string.iterator.js");
61
60
  require("core-js/modules/es.weak-map.js");
62
61
  require("core-js/modules/esnext.iterator.constructor.js");
62
+ require("core-js/modules/esnext.iterator.filter.js");
63
63
  require("core-js/modules/esnext.iterator.find.js");
64
64
  require("core-js/modules/esnext.iterator.for-each.js");
65
+ require("core-js/modules/esnext.iterator.map.js");
65
66
  require("core-js/modules/esnext.weak-map.delete-all.js");
66
67
  require("core-js/modules/esnext.weak-map.emplace.js");
67
68
  require("core-js/modules/web.dom-collections.for-each.js");
@@ -81,17 +82,15 @@ var _annotationProvider = require("../../providers/annotation-provider");
81
82
  var _mobx = require("mobx");
82
83
  var _fcrCore = require("fcr-core");
83
84
  var _type2 = require("fcr-core/lib/room-control/sharing-control/type");
84
- var _store = require("../whiteboard/components/toolbar/store");
85
85
  var _i18n = require("agora-ui-foundation/lib/i18n");
86
86
  var _logger = require("../../utilities/logger");
87
87
  var _isNumber = _interopRequireDefault(require("lodash/isNumber"));
88
88
  var _env = require("agora-foundation/lib/utilities/env");
89
89
  var _type3 = require("../whiteboard/type");
90
+ var _type4 = require("fcr-core/lib/type");
91
+ var _annotationToolbarStore = require("./annotation-toolbar-store");
90
92
  var _AnnotationStore;
91
- var _initProto, _init_resetToolbarStore, _init_isShowToolbar, _setToolsShowDecs, _zoomInDecs, _zoomOutDecs, _fullContainerDecs, _setOriginScalcDecs, _drawReceiverBoardDecs, _handleBoardDomLoadDecs, _handleBoardContainerDomLoadDecs, _annotationEndedDecs, _mountDecs, _unmountDecs, _ref;
92
- 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; } } }; }
93
- 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; } }
94
- 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; }
93
+ var _initProto, _init_receiverAllOpenStateReady, _handleReceiverBoardDecs, _handleBoardDomLoadDecs, _handleBoardContainerDomLoadDecs, _annotationaEndEffectThenCloseBoardDecs, _mountDecs, _unmountDecs, _annotationStartTriggerEffectDecs, _ref;
95
94
  function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
96
95
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
97
96
  function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
@@ -103,13 +102,11 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
103
102
  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; }
104
103
  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; }
105
104
  var _A = /*#__PURE__*/new WeakMap();
106
- var _B = /*#__PURE__*/new WeakMap();
107
- _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], _drawReceiverBoardDecs = [_mobx.action, _mobx.action.bound], _handleBoardDomLoadDecs = [_mobx.action, _mobx.action.bound], _handleBoardContainerDomLoadDecs = [_mobx.action, _mobx.action.bound], _annotationEndedDecs = [_mobx.action, _mobx.action.bound], _mountDecs = [_mobx.action, _mobx.action.bound], _unmountDecs = [_mobx.action, _mobx.action.bound], "logger");
105
+ _ref = (_handleReceiverBoardDecs = [_mobx.action, _mobx.action.bound], _handleBoardDomLoadDecs = [_mobx.action, _mobx.action.bound], _handleBoardContainerDomLoadDecs = [_mobx.action, _mobx.action.bound], _annotationaEndEffectThenCloseBoardDecs = [_mobx.action, _mobx.action.bound], _mountDecs = [_mobx.action, _mobx.action.bound], _unmountDecs = [_mobx.action, _mobx.action.bound], _annotationStartTriggerEffectDecs = [_mobx.action, _mobx.action.bound], "logger");
108
106
  var AnnotationStore = exports.AnnotationStore = /*#__PURE__*/function () {
109
107
  function AnnotationStore(_ref2) {
110
108
  var _this = this;
111
109
  var dialogProvider = _ref2.dialogProvider,
112
- deviceProvider = _ref2.deviceProvider,
113
110
  annotationProvider = _ref2.annotationProvider,
114
111
  sharingProvider = _ref2.sharingProvider,
115
112
  memberDataSource = _ref2.memberDataSource,
@@ -120,7 +117,8 @@ var AnnotationStore = exports.AnnotationStore = /*#__PURE__*/function () {
120
117
  messageProvider = _ref2.messageProvider,
121
118
  localStorageProvider = _ref2.localStorageProvider,
122
119
  eventProvider = _ref2.eventProvider,
123
- abilityProvider = _ref2.abilityProvider;
120
+ abilityProvider = _ref2.abilityProvider,
121
+ sharedAnnotationDataSource = _ref2.sharedAnnotationDataSource;
124
122
  (0, _classCallCheck2["default"])(this, AnnotationStore);
125
123
  (0, _defineProperty2["default"])(this, _ref, (_initProto(this), (0, _logger.createLogger)({
126
124
  prefix: 'AnnotationStore'
@@ -128,6 +126,7 @@ var AnnotationStore = exports.AnnotationStore = /*#__PURE__*/function () {
128
126
  (0, _defineProperty2["default"])(this, "_disposers", []);
129
127
  (0, _defineProperty2["default"])(this, "_annotationControl", undefined);
130
128
  (0, _defineProperty2["default"])(this, "_resizeWatcherTimer", null);
129
+ (0, _defineProperty2["default"])(this, "_shareScreenOwnerId", '');
131
130
  (0, _defineProperty2["default"])(this, "_currentShareInfo", {
132
131
  id: '',
133
132
  type: _type.AgoraRtcScreenCaptureType.SCREEN,
@@ -148,39 +147,34 @@ var AnnotationStore = exports.AnnotationStore = /*#__PURE__*/function () {
148
147
  }
149
148
  }
150
149
  });
151
- _classPrivateFieldInitSpec(this, _A, _init_resetToolbarStore(this, false));
152
- _classPrivateFieldInitSpec(this, _B, _init_isShowToolbar(this, false));
150
+ (0, _defineProperty2["default"])(this, "_sharingObserver", {
151
+ onScreenSharingUpdated: this._handleOnScreenSharingUpdated
152
+ });
153
+ (0, _defineProperty2["default"])(this, "_annotationObserver", {
154
+ onConnectionStateUpdated: this._handleOnAnnotationConnectionStateUpdated
155
+ });
156
+ // 接收端是否全部的前提工作都做完了,做完了,放出承载节点
157
+ // 在承载节点的handleDomLoaded后,挂载白板
158
+ _classPrivateFieldInitSpec(this, _A, _init_receiverAllOpenStateReady(this, false));
153
159
  (0, _defineProperty2["default"])(this, "_toolbarStore", undefined);
154
160
  (0, _defineProperty2["default"])(this, "_boardOriginWidth", 0);
161
+ (0, _defineProperty2["default"])(this, "_prevSetLocalVideoSize", {
162
+ width: 0,
163
+ height: 0
164
+ });
155
165
  (0, _defineProperty2["default"])(this, "_mounted", false);
156
- (0, _defineProperty2["default"])(this, "_boardContainerObserver", new ResizeObserver(function (entries) {
157
- var _iterator = _createForOfIteratorHelper(entries),
158
- _step;
159
- try {
160
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
161
- var entry = _step.value;
162
- var height = entry.contentRect.height;
163
- // 大小变化后的处理逻辑
164
- if (height > 0 && _this._memberDataSource.shareScreenVideoRatio > 0 && _this._boardDom) {
165
- var ratio = _this._memberDataSource.shareScreenVideoRatio;
166
- var newWidth = height * ratio;
167
- _this._boardOriginWidth = newWidth;
168
- _this._boardDom.style.width = "".concat(newWidth, "px");
169
- }
170
- }
171
- } catch (err) {
172
- _iterator.e(err);
173
- } finally {
174
- _iterator.f();
175
- }
176
- }));
166
+ (0, _defineProperty2["default"])(this, "_streamObserver", {
167
+ onLocalVideoStatsUpdated: this._handleOnLocalVideoStatsUpdated.bind(this)
168
+ });
169
+ (0, _defineProperty2["default"])(this, "_annotationEndLock", null);
177
170
  localStorageProvider.write('annotation_nickname', memberDataSource.localUser.userName);
178
171
  this._dialogProvider = dialogProvider;
179
- this._deviceProvider = deviceProvider;
180
172
  this._annotationProvider = annotationProvider;
181
173
  this._sharingProvider = sharingProvider;
182
174
  this._memberDataSource = memberDataSource;
183
175
  this._roomControl = roomControl;
176
+ this._streamControl = this._roomControl.getStreamControl();
177
+ this._streamControl.addObserver(this._streamObserver);
184
178
  this._sharedSecuritySharedDataSource = sharedSecuritySharedDataSource;
185
179
  this._sharedScreenSharedDataSource = sharedScreenSharedDataSource;
186
180
  this._dialogProvider.addObserver(this._dialogObserver);
@@ -188,130 +182,90 @@ var AnnotationStore = exports.AnnotationStore = /*#__PURE__*/function () {
188
182
  this._messageProvider = messageProvider;
189
183
  this._eventProvider = eventProvider;
190
184
  this._abilityProvider = abilityProvider;
191
- this._disposers.push((0, _mobx.reaction)(function () {
192
- return _this.annotating;
193
- }, function (annotating) {
194
- if (_this._isLocalUserSharingOwner) {
195
- if (annotating) {
196
- _this._removeWindowResizeListenner();
197
- } else {
198
- _this._addWindowResizeListenner();
199
- }
200
- }
201
- }), (0, _mobx.reaction)(function () {
202
- return _this.isSeizeStream;
203
- }, function (state) {
204
- _this.logger.info('[Annotation]: isSeizeStream changed to ', state);
205
- if (state) {
206
- _this._sharedScreenSharedDataSource.setIsSeizeStream(false);
207
- if (_this._isLocalUserSharingOwner) {
208
- _this._annotationProvider.hideAnnotationWindow();
209
- _this._removeWindowResizeListenner();
210
- } else {
211
- _this._annotationEnded();
212
- }
213
- }
214
- }), (0, _mobx.reaction)(function () {
215
- return _this._memberDataSource.shareScreenVideoRatio;
216
- }, function (ratio) {
217
- if (ratio > 0) {
218
- _this.drawReceiverBoard(ratio);
185
+ this._sharedAnnotationDataSource = sharedAnnotationDataSource;
186
+ this._sharingControl = this._sharingProvider.getSharingControl();
187
+ this._sharingControl.addObserver(this._sharingObserver);
188
+ this._getCurrentAnnotationControl();
189
+ var exitScreenShareOwner = this._sharedScreenSharedDataSource.screenSharingOwner;
190
+ if (exitScreenShareOwner) {
191
+ this._shareScreenOwnerId = exitScreenShareOwner.userId;
192
+ if (this._sharingControl.getScreenSharingState() === _type2.FcrScreenSharingState.START_WHIT_ANNOTATION) {
193
+ this._annotationReceiverMainStart();
219
194
  }
220
- }),
195
+ }
196
+ this._disposers.push(
197
+ // reaction(
198
+ // () => this.annotating,
199
+ // (annotating) => {
200
+ // if (this._isLocalUserSharingOwner) {
201
+ // if (annotating) {
202
+ // this._removeWindowResizeListenner();
203
+ // } else {
204
+ // this._addWindowResizeListenner();
205
+ // }
206
+ // }
207
+ // },
208
+ // ),
221
209
  // reaction(
222
- // () => this._memberDataSource.shareScreenVideoSize,
223
- // (size) => {
224
- // if (size && this._boardDom) {
225
- // this.logger.info('annotation shareScreenVideoSize: ', size);
226
- // calcAnnotationAreaSize(this._boardDom, size.width, size.height);
210
+ // () => this._sharedScreenSharedDataSource.screenShareVideoRatio,
211
+ // (ratio) => {
212
+ // if (ratio > 0) {
213
+ // this.handleReceiverBoard(ratio);
227
214
  // }
228
215
  // },
229
216
  // ),
230
217
  (0, _mobx.reaction)(function () {
231
- return _this.isScreenSharing;
232
- }, function (sharing) {
233
- _this.logger.info("[Annotation]: screen sharing reaction sharing changed to ".concat(sharing, ", isReplaceScreen is ").concat(_this.isReplaceScreen, ", isSeizeStream is ").concat(_this.isSeizeStream));
234
- // web 开启屏幕共享时不需要走这个逻辑
235
- if (_this.isReplaceScreen || _this.isSeizeStream || !(0, _env.isElectron)()) return;
236
- if (_this._isLocalUserSharingOwner) {
237
- if (sharing) {
238
- _this.screenSharingStarted();
239
- } else {
240
- _this._removeWindowResizeListenner();
241
- }
218
+ return _this.sharingInReplace;
219
+ }, function (sharingInReplace) {
220
+ // web 被替换时不需要走这个逻辑
221
+ if (sharingInReplace && (0, _env.isElectron)() && _this._isLocalUserSharingOwner) {
222
+ // await new Promise((resolve) => {
223
+ // // 延迟两秒,等待标注内容清理,清理方法在 sdk 中虽然看起来是同步的,但是实际上会有无法清理的情况出现
224
+ // sendEvent({ action: ToolbarEvents.CLEAN, payload: null });
225
+ // setTimeout(() => resolve(true), 1000);
226
+ // });
227
+ (0, _rendererEvent.sendEvent)({
228
+ action: _type3.ToolbarEvents.CLEAN,
229
+ payload: null
230
+ });
231
+ _this.logger.info("[Annotation]: sharingInReplace changed to ".concat(sharingInReplace, ", currentShareInfo is ").concat(JSON.stringify(_this._currentShareInfo)));
232
+ _this._removeWindowResizeListenner();
233
+ _this._annotationProvider.hideAnnotationWindow();
234
+ _this._annotationProvider.setBoundsToAnnotationWindow();
235
+ setTimeout(function () {
236
+ return _this.screenSharingStarted(true);
237
+ }, 200);
242
238
  }
243
239
  }), (0, _mobx.reaction)(function () {
244
- return _this.isReplaceScreen;
245
- }, /*#__PURE__*/function () {
246
- var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(isReplaceScreen) {
247
- return _regenerator["default"].wrap(function (_context) {
248
- while (1) switch (_context.prev = _context.next) {
249
- case 0:
250
- if (!(isReplaceScreen && (0, _env.isElectron)())) {
251
- _context.next = 2;
252
- break;
253
- }
254
- _context.next = 1;
255
- return new Promise(function (resolve) {
256
- // 延迟两秒,等待标注内容清理,清理方法在 sdk 中虽然看起来是同步的,但是实际上会有无法清理的情况出现
257
- (0, _rendererEvent.sendEvent)({
258
- action: _type3.ToolbarEvents.CLEAN,
259
- payload: null
260
- });
261
- setTimeout(function () {
262
- return resolve(true);
263
- }, 2000);
264
- });
265
- case 1:
266
- _this.logger.info("[Annotation]: isReplaceScreen changed to ".concat(isReplaceScreen, ", currentShareInfo is ").concat(JSON.stringify(_this._currentShareInfo)));
267
- _this._removeWindowResizeListenner();
268
- _this._annotationProvider.hideAnnotationWindow();
269
- _this._annotationProvider.setBoundsToAnnotationWindow();
270
- setTimeout(_this.screenSharingStarted);
271
- _this._sharedScreenSharedDataSource.setIsReplaceScreen(false);
272
- case 2:
273
- case "end":
274
- return _context.stop();
275
- }
276
- }, _callee);
277
- }));
278
- return function (_x) {
279
- return _ref3.apply(this, arguments);
280
- };
281
- }()), (0, _mobx.reaction)(function () {
282
- return _this._annotationProvider.annotationState;
283
- }, function (state) {
284
- _this.logger.info('annotation transaction state: ', state);
285
- if (state === _annotationProvider.FcrAnnotationState.START) {
286
- _this.logger.info('annotation transaction start');
287
- _this._annotationControl = _this._annotationProvider.annotationControl;
288
- _this._toolbarStore = new _store.ToolbarStore(_this._annotationControl, _this._roomControl, _this._annotationProvider, eventProvider);
289
- _this.resetToolbarStore = true;
290
- } else {
291
- _this._annotationEnded();
240
+ return _this.annotationHasStart;
241
+ }, function (hasStart) {
242
+ if (hasStart && !_this._isLocalUserSharingOwner) {
243
+ /** 不是发起端并且annotation白板变为了连接状态 */
244
+ _this.logger.info('[Annotation] start step2 ===> annotation board has connected, then we trigger effect');
245
+ _this._annotationStartTriggerEffect();
292
246
  }
293
247
  }), (0, _mobx.reaction)(function () {
294
- return _this._sharedScreenSharedDataSource.screenSharingState;
248
+ return _this._sharedScreenSharedDataSource.localUserScreenSharingState;
295
249
  }, function (state) {
296
250
  if (state === _fcrCore.FcrMediaSourceState.CLOSE && _this._isLocalUserSharingOwner) {
297
- _this.logger.info('[Annotation]: screenSharingState is close, isReplaceScreen is ', _this.isReplaceScreen);
298
- if (!_this.isReplaceScreen && (0, _env.isElectron)()) {
299
- _this._annotationProvider.hideAnnotationWindow();
251
+ _this.logger.info('[Annotation]: localUserScreenSharingState is close, isReplaceScreen is ', _this.sharingInReplace);
252
+ if (!_this.sharingInReplace && (0, _env.isElectron)()) {
253
+ _this._annotationProvider.closeAnnotationWindow();
300
254
  _this._removeWindowResizeListenner();
301
255
  }
302
256
  }
303
257
  }), (0, _mobx.reaction)(function () {
304
258
  return _this.allowAnnotationWriteState;
305
259
  }, function (canWrite) {
306
- if (!_this._isLocalUserSharingOwner) {
307
- var toastText = canWrite ? (0, _i18n.transI18n)('fmt_screenshare_toast_host_enabled_annotations') : (0, _i18n.transI18n)('fmt_screenshare_toast_host_disabled_annotations');
260
+ if (!_this._isLocalUserSharingOwner && !canWrite) {
261
+ var toastText = (0, _i18n.transI18n)('fmt_screenshare_toast_host_disabled_annotations');
308
262
  _this._messageProvider.showToast({
309
263
  type: 'info',
310
264
  message: toastText
311
265
  });
312
266
  }
313
267
  if (!canWrite) {
314
- _this.isShowToolbar = false;
268
+ _this._setIsShowToolbar(false);
315
269
  }
316
270
  }), (0, _mobx.reaction)(function () {
317
271
  return _this.isShowToolbar;
@@ -321,7 +275,7 @@ var AnnotationStore = exports.AnnotationStore = /*#__PURE__*/function () {
321
275
  }));
322
276
  }
323
277
  return (0, _createClass2["default"])(AnnotationStore, [{
324
- key: "resetToolbarStore",
278
+ key: "receiverAllOpenStateReady",
325
279
  get: function get() {
326
280
  return _classPrivateFieldGet(_A, this);
327
281
  },
@@ -329,12 +283,9 @@ var AnnotationStore = exports.AnnotationStore = /*#__PURE__*/function () {
329
283
  _classPrivateFieldSet(_A, this, v);
330
284
  }
331
285
  }, {
332
- key: "isShowToolbar",
286
+ key: "screenShareVideoRatio",
333
287
  get: function get() {
334
- return _classPrivateFieldGet(_B, this);
335
- },
336
- set: function set(v) {
337
- _classPrivateFieldSet(_B, this, v);
288
+ return this._sharedScreenSharedDataSource.screenShareVideoRatio;
338
289
  }
339
290
  }, {
340
291
  key: "hasAnnotationWritePermission",
@@ -356,6 +307,11 @@ var AnnotationStore = exports.AnnotationStore = /*#__PURE__*/function () {
356
307
  get: function get() {
357
308
  return this._annotationProvider.screenShareWindowData;
358
309
  }
310
+ }, {
311
+ key: "isShowToolbar",
312
+ get: function get() {
313
+ return this._annotationProvider.isShowToolbar;
314
+ }
359
315
  }, {
360
316
  key: "isScreenSharing",
361
317
  get: function get() {
@@ -381,15 +337,20 @@ var AnnotationStore = exports.AnnotationStore = /*#__PURE__*/function () {
381
337
  get: function get() {
382
338
  return this._memberDataSource.localUser;
383
339
  }
340
+ }, {
341
+ key: "sharingInReplace",
342
+ get: function get() {
343
+ return this._sharedScreenSharedDataSource.sharingInReplace;
344
+ }
384
345
  }, {
385
346
  key: "scalcValue",
386
347
  get: function get() {
387
- return this._annotationProvider.scalcValue;
348
+ return this._sharedScreenSharedDataSource.screenShareScalcValue;
388
349
  }
389
350
  }, {
390
351
  key: "annotationHasStart",
391
352
  get: function get() {
392
- return this._annotationProvider.annotationHasStart;
353
+ return this._sharedAnnotationDataSource.annotationHasStart;
393
354
  }
394
355
  }, {
395
356
  key: "annotating",
@@ -407,11 +368,6 @@ var AnnotationStore = exports.AnnotationStore = /*#__PURE__*/function () {
407
368
  var _this$screenSharingOw;
408
369
  return this._privilegeProvider.allowAnnotationWriteState() || this.isLocalUserHost || ((_this$screenSharingOw = this.screenSharingOwner) === null || _this$screenSharingOw === void 0 ? void 0 : _this$screenSharingOw.userId) === this.localUser.userId;
409
370
  }
410
- }, {
411
- key: "isReplaceScreen",
412
- get: function get() {
413
- return this._sharedScreenSharedDataSource.isReplaceScreen;
414
- }
415
371
  }, {
416
372
  key: "isSeizeStream",
417
373
  get: function get() {
@@ -434,55 +390,26 @@ var AnnotationStore = exports.AnnotationStore = /*#__PURE__*/function () {
434
390
  return (_this$_toolbarStore2 = this._toolbarStore) === null || _this$_toolbarStore2 === void 0 ? void 0 : _this$_toolbarStore2.observables.currentTool;
435
391
  }
436
392
  }, {
437
- key: "setToolsShow",
438
- value: function setToolsShow() {
439
- this.logger.info('setToolsShow ', this.allowAnnotationWriteState);
440
- if (this.allowAnnotationWriteState) {
441
- var currentFlag = this.isShowToolbar;
442
- this.isShowToolbar = !currentFlag;
443
- }
444
- }
445
- }, {
446
- key: "zoomIn",
447
- value: function zoomIn() {
448
- this._annotationProvider.zoomIn();
449
- }
450
- }, {
451
- key: "zoomOut",
452
- value: function zoomOut() {
453
- this._annotationProvider.zoomOut();
393
+ key: "boardMainWindow",
394
+ get: function get() {
395
+ return this._sharedAnnotationDataSource.boardMainWindow;
454
396
  }
455
397
  }, {
456
- key: "fullContainer",
457
- value: function fullContainer() {
458
- var ratio = this._memberDataSource.shareScreenVideoRatio;
459
- if (ratio > 0 && this._boardContainerDom) {
398
+ key: "handleReceiverBoard",
399
+ value: function handleReceiverBoard(paramRatio) {
400
+ if (this._boardContainerDom && this._boardDom) {
401
+ var _this$boardMainWindow;
460
402
  var _this$_boardContainer = this._boardContainerDom.getBoundingClientRect(),
461
- width = _this$_boardContainer.width,
462
403
  height = _this$_boardContainer.height;
463
- var _getBoundingClientRec = this._boardDom.getBoundingClientRect(),
464
- boardWidth = _getBoundingClientRec.width,
465
- boardHeight = _getBoundingClientRec.height;
466
- var scalc = width / boardWidth;
467
- this._annotationProvider.fullContainer(scalc);
468
- }
469
- }
470
- }, {
471
- key: "setOriginScalc",
472
- value: function setOriginScalc() {
473
- this._annotationProvider.setOriginScalc();
474
- }
475
- }, {
476
- key: "drawReceiverBoard",
477
- value: function drawReceiverBoard(paramRatio) {
478
- if (this._boardContainerDom && this._boardDom) {
479
- var _this$_boardContainer2 = this._boardContainerDom.getBoundingClientRect(),
480
- height = _this$_boardContainer2.height;
481
- var ratio = (0, _isNumber["default"])(paramRatio) ? paramRatio : this._memberDataSource.shareScreenVideoRatio;
404
+ var ratio = (0, _isNumber["default"])(paramRatio) ? paramRatio : this._sharedScreenSharedDataSource.screenShareVideoRatio;
482
405
  var newWidth = height * ratio;
483
406
  this._boardOriginWidth = newWidth;
484
407
  this._boardDom.style.width = "".concat(newWidth, "px");
485
408
  this._boardDom.style.height = "".concat(height, "px");
409
+ (_this$boardMainWindow = this.boardMainWindow) === null || _this$boardMainWindow === void 0 || _this$boardMainWindow.updateWindowSize({
410
+ width: newWidth,
411
+ height: height
412
+ });
486
413
  this.logger.info("[Annotation] [drawReceiverBoard] ratio: ".concat(ratio, ", width: ").concat(newWidth, " , height: ").concat(height));
487
414
  }
488
415
  }
@@ -491,12 +418,17 @@ var AnnotationStore = exports.AnnotationStore = /*#__PURE__*/function () {
491
418
  value: function handleBoardDomLoad(ref) {
492
419
  this._boardDom = ref;
493
420
  if (this._boardDom) {
494
- var _this$_boardDom$getBo = this._boardDom.getBoundingClientRect(),
495
- height = _this$_boardDom$getBo.height;
496
- this._boardOriginWidth = height * this._memberDataSource.shareScreenVideoRatio;
421
+ // const { height } = this._boardDom.getBoundingClientRect();
422
+ // const haveCanUseBackup = this._checkSharingwindowBackupSize();
423
+ // if (this._boardOriginWidth === 0 && haveCanUseBackup) {
424
+ // this._setBoardDomWithBackupWindowSize(height);
425
+ // } else {
426
+ // this._boardOriginWidth = height * this._sharedScreenSharedDataSource.screenShareVideoRatio;
427
+ // }
497
428
  this._mount();
498
429
  } else {
499
430
  this._mounted = false;
431
+ this._boardOriginWidth = 0;
500
432
  }
501
433
  }
502
434
  }, {
@@ -504,74 +436,179 @@ var AnnotationStore = exports.AnnotationStore = /*#__PURE__*/function () {
504
436
  value: function handleBoardContainerDomLoad(ref) {
505
437
  if (ref) {
506
438
  this._boardContainerDom = ref;
507
- this._boardContainerObserver.observe(ref);
508
439
  }
509
440
  }
510
441
  }, {
511
442
  key: "screenSharingStarted",
512
- value: function screenSharingStarted() {
443
+ value: function screenSharingStarted(isReplaceScreen) {
513
444
  this._currentShareInfo = this._annotationProvider.currentShareInfo;
514
445
  this.logger.info("[Annotation]: screenSharingStarting with currentShareInfo: ".concat(JSON.stringify(this._currentShareInfo)));
515
446
  this._annotationProvider.setBoundsToAnnotationWindow();
516
- (0, _rendererEvent.sendEvent)({
517
- action: _constant.FcrUIRendererEventAction.SET_ANNOTATION_TO_SHOW,
518
- payload: true
519
- });
520
- this.logger.info('[Annotation]: screenSharingStarted will add window resize listenner');
447
+ this._removeWindowResizeListenner();
448
+ if (isReplaceScreen) {
449
+ this._annotationProvider.showAnnotationWindow();
450
+ } else {
451
+ this._annotationProvider.openAnnotationWindow();
452
+ this.logger.info('[Annotation]: screenSharingStarted will add window resize listenner');
453
+ }
521
454
  this._addWindowResizeListenner();
522
455
  }
523
456
  }, {
524
457
  key: "release",
525
458
  value: function release() {
459
+ this._annotationaEndEffectThenCloseBoard();
526
460
  this._disposers.forEach(function (disposer) {
527
461
  return disposer();
528
462
  });
529
463
  this._dialogProvider.removeObserver(this._dialogObserver);
464
+ this._streamControl.removeObserver(this._streamObserver);
465
+ this._sharingControl.removeObserver(this._sharingObserver);
466
+ this._clearCurrentAnnotationControl();
530
467
  this._removeWindowResizeListenner();
531
- this._unmount();
532
- this._boardContainerObserver.disconnect();
533
468
  }
534
469
  }, {
535
- key: "_annotationEnded",
536
- value: function _annotationEnded() {
537
- var _this$_annotationProv, _this$_toolbarStore3;
538
- this.logger.info('[Annotation]: annotation transaction end');
539
- this._messageProvider.showToast({
540
- message: (0, _i18n.transI18n)('fmt_screenshare_toast_annotation_controls_screen_sharing_disabled'),
541
- type: 'info'
470
+ key: "_clearCurrentAnnotationControl",
471
+ value: function _clearCurrentAnnotationControl() {
472
+ if (this._annotationControl) {
473
+ this._annotationControl.removeObserver(this._annotationObserver);
474
+ this._annotationControl = undefined;
475
+ }
476
+ }
477
+ }, {
478
+ key: "_getCurrentAnnotationControl",
479
+ value: function _getCurrentAnnotationControl() {
480
+ this._clearCurrentAnnotationControl();
481
+ var newAnnotationControl = this._sharingProvider.getSharingControl().getAnnotationControl();
482
+ this._annotationControl = newAnnotationControl;
483
+ newAnnotationControl === null || newAnnotationControl === void 0 || newAnnotationControl.addObserver(this._annotationObserver);
484
+ return this._annotationControl;
485
+ }
486
+
487
+ /**
488
+ * 根据 发起屏幕共享状态,是startOnlyScreen,且自己本人是发起端
489
+ * 则发起端: 同步bounds与updateViewPort并进行打开fragment
490
+ */
491
+ }, {
492
+ key: "_annotationSenderMainStart",
493
+ value: (function () {
494
+ var _annotationSenderMainStart2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
495
+ return _regenerator["default"].wrap(function (_context) {
496
+ while (1) switch (_context.prev = _context.next) {
497
+ case 0:
498
+ this.logger.info('annotation sender main start');
499
+ if (!this._isLocalUserSharingOwner) {
500
+ _context.next = 2;
501
+ break;
502
+ }
503
+ if (!this._annotationEndLock) {
504
+ _context.next = 1;
505
+ break;
506
+ }
507
+ this.logger.info('annotation sender main start in await lock');
508
+ _context.next = 1;
509
+ return this._annotationEndLock;
510
+ case 1:
511
+ this.logger.info('annotation sender main start in sender branch');
512
+ this.screenSharingStarted(false);
513
+ case 2:
514
+ case "end":
515
+ return _context.stop();
516
+ }
517
+ }, _callee, this);
518
+ }));
519
+ function _annotationSenderMainStart() {
520
+ return _annotationSenderMainStart2.apply(this, arguments);
521
+ }
522
+ return _annotationSenderMainStart;
523
+ }()
524
+ /**
525
+ * 根据 发起屏幕共享状态中包含startWithAnnotation,
526
+ * 则接收端:1.去进行 step1 连接白板 2.在连接完成的状态后并拿到boardMainWindow后,进行 step2 后置的 工具栏初始化 + 白板尺寸修正(过期)
527
+ */
528
+ )
529
+ }, {
530
+ key: "_annotationReceiverMainStart",
531
+ value: (function () {
532
+ var _annotationReceiverMainStart2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
533
+ return _regenerator["default"].wrap(function (_context2) {
534
+ while (1) switch (_context2.prev = _context2.next) {
535
+ case 0:
536
+ this.logger.info('[Annotation] receiver main start');
537
+ if (this._isLocalUserSharingOwner) {
538
+ _context2.next = 2;
539
+ break;
540
+ }
541
+ if (!this._annotationEndLock) {
542
+ _context2.next = 1;
543
+ break;
544
+ }
545
+ this.logger.info('[Annotation] receiver main start in await lock');
546
+ _context2.next = 1;
547
+ return this._annotationEndLock;
548
+ case 1:
549
+ this.logger.info('[Annotation] receiver main start in receiver branch');
550
+ this._connectAnnotaionBoard(this._shareScreenOwnerId);
551
+ case 2:
552
+ case "end":
553
+ return _context2.stop();
554
+ }
555
+ }, _callee2, this);
556
+ }));
557
+ function _annotationReceiverMainStart() {
558
+ return _annotationReceiverMainStart2.apply(this, arguments);
559
+ }
560
+ return _annotationReceiverMainStart;
561
+ }()
562
+ /**
563
+ * 根据 1.白板的连接状态变为未连接状态 2.屏幕共享结束后
564
+ * 进行后置的 工具栏,画布清理和toast提示 + 关闭白板卸载节点的操作
565
+ */
566
+ )
567
+ }, {
568
+ key: "_annotationaEndEffectThenCloseBoard",
569
+ value: function _annotationaEndEffectThenCloseBoard() {
570
+ var _this2 = this;
571
+ this._annotationEndLock = new Promise(function (resolve) {
572
+ try {
573
+ var _this2$_toolbarStore;
574
+ (_this2$_toolbarStore = _this2._toolbarStore) === null || _this2$_toolbarStore === void 0 || _this2$_toolbarStore.resetToolbarVars();
575
+ _this2._messageProvider.showToast({
576
+ message: (0, _i18n.transI18n)('fmt_screenshare_toast_annotation_controls_screen_sharing_disabled'),
577
+ type: 'info'
578
+ });
579
+ _this2._setIsShowToolbar(false);
580
+ _this2._clearAnnotationWhiteboardToolbar();
581
+ _this2._sharedAnnotationDataSource.setAnnotationState(_annotationProvider.FcrAnnotationState.END);
582
+ _this2._unmount();
583
+ } catch (e) {} finally {
584
+ console.log('[Annotation]: annotation receiver end resolve');
585
+ resolve();
586
+ }
542
587
  });
543
- (_this$_annotationProv = this._annotationProvider.boardMainWindow) === null || _this$_annotationProv === void 0 || _this$_annotationProv.clean();
544
- (_this$_toolbarStore3 = this._toolbarStore) === null || _this$_toolbarStore3 === void 0 || _this$_toolbarStore3.resetToolbarVars();
545
- this.resetToolbarStore = false;
546
- this._boardContainerObserver.disconnect();
547
- this.isShowToolbar = false;
548
- this._toolbarStore = undefined;
549
- this._unmount();
588
+ }
589
+ }, {
590
+ key: "_setIsShowToolbar",
591
+ value: function _setIsShowToolbar(isShow) {
592
+ this._annotationProvider.setIsShowToolbar(isShow);
550
593
  }
551
594
  }, {
552
595
  key: "_mount",
553
596
  value: function _mount() {
554
- this.logger.info('annotation mount boardMainWindow: ', this._annotationProvider.boardMainWindow);
555
- this.logger.info('annotation mount boardDom: ', this._boardDom);
556
- if (this._annotationProvider.boardMainWindow && this._boardDom && !this._mounted) {
557
- var _this$_toolbarStore4;
558
- this.logger.info('annotation mount start: ', this._boardDom);
597
+ if (this.boardMainWindow && this._boardDom && !this._mounted) {
598
+ var _this$_toolbarStore3;
559
599
  this._mounted = true;
560
- var view = this._annotationProvider.boardMainWindow.getContentView();
600
+ var view = this.boardMainWindow.getContentView();
561
601
  this._boardDom.appendChild(view);
562
- this.logger.info('annotation mount boardMainWindow contentView append: ', view);
563
- this.logger.info('annotation mount success');
564
- (_this$_toolbarStore4 = this._toolbarStore) === null || _this$_toolbarStore4 === void 0 || _this$_toolbarStore4.resetToolbarVars();
602
+ (_this$_toolbarStore3 = this._toolbarStore) === null || _this$_toolbarStore3 === void 0 || _this$_toolbarStore3.resetToolbarVars();
565
603
  }
566
604
  }
567
605
  }, {
568
606
  key: "_unmount",
569
607
  value: function _unmount() {
570
- this.logger.info('annotation unmount ');
571
- if (this._mounted && this._annotationProvider.boardMainWindow) {
572
- var _this$_boardDom;
573
- (_this$_boardDom = this._boardDom) === null || _this$_boardDom === void 0 || _this$_boardDom.removeChild(this._annotationProvider.boardMainWindow.getContentView());
574
- this.logger.info('annotation unmount remove mainWindow contentView');
608
+ this.logger.info('[Annotation] unmount ');
609
+ if (this._mounted && this.boardMainWindow) {
610
+ this._deleteBoardDomContent();
611
+ this.logger.info('[Annotation] unmount remove mainWindow contentView');
575
612
  this._close();
576
613
  }
577
614
  this._mounted = false;
@@ -580,8 +617,27 @@ var AnnotationStore = exports.AnnotationStore = /*#__PURE__*/function () {
580
617
  key: "_close",
581
618
  value: function _close() {
582
619
  if (this._annotationControl) {
620
+ this.logger.info('[Annotation] core close');
583
621
  this._annotationControl.close();
584
- this.logger.info('annotation close');
622
+ }
623
+ }
624
+ }, {
625
+ key: "_handleOnLocalVideoStatsUpdated",
626
+ value: function _handleOnLocalVideoStatsUpdated(roomId, streamId, stats) {
627
+ var dimensions = stats.dimensions;
628
+ var width = dimensions.width,
629
+ height = dimensions.height;
630
+ if (!width || !height) {
631
+ return;
632
+ }
633
+ var stream = this._streamControl.getStreamByStreamId(streamId);
634
+ var isScreenShareStream = (stream === null || stream === void 0 ? void 0 : stream.videoSourceType) === _fcrCore.FcrVideoSourceType.SCREEN;
635
+ if (isScreenShareStream) {
636
+ if (width !== this._prevSetLocalVideoSize.width || height !== this._prevSetLocalVideoSize.height) {
637
+ this._prevSetLocalVideoSize.width = width;
638
+ this._prevSetLocalVideoSize.height = height;
639
+ this._annotationProvider.updateWindowSize(width, height);
640
+ }
585
641
  }
586
642
  }
587
643
  }, {
@@ -599,10 +655,10 @@ var AnnotationStore = exports.AnnotationStore = /*#__PURE__*/function () {
599
655
  }, {
600
656
  key: "_updateBoundsByActiveWindow",
601
657
  value: function _updateBoundsByActiveWindow() {
602
- var _this2 = this;
658
+ var _this3 = this;
603
659
  var windows = window.runtime.getWindows();
604
660
  var activeWindow = windows.find(function (win) {
605
- return win.id === +_this2._currentShareInfo.id;
661
+ return win.id === +_this3._currentShareInfo.id;
606
662
  });
607
663
  var _this$_currentShareIn = this._currentShareInfo,
608
664
  id = _this$_currentShareIn.id,
@@ -613,53 +669,237 @@ var AnnotationStore = exports.AnnotationStore = /*#__PURE__*/function () {
613
669
  y = bounds.y;
614
670
  var activeBounds = activeWindow === null || activeWindow === void 0 ? void 0 : activeWindow.getBounds();
615
671
  var isSharingWindow = activeWindow && activeWindow.id === +id;
616
- var _ref4 = (activeWindow === null || activeWindow === void 0 ? void 0 : activeWindow.getBounds()) || {},
617
- aw = _ref4.width,
618
- ah = _ref4.height,
619
- ax = _ref4.x,
620
- ay = _ref4.y;
672
+ var _ref3 = (activeWindow === null || activeWindow === void 0 ? void 0 : activeWindow.getBounds()) || {},
673
+ aw = _ref3.width,
674
+ ah = _ref3.height,
675
+ ax = _ref3.x,
676
+ ay = _ref3.y;
621
677
  var isNewBounds = aw !== width || ah !== height || ax !== x || ay !== y;
622
- this.logger.info("updateBoundsByActiveWindow ".concat(JSON.stringify({
623
- activeBounds: activeBounds,
624
- width: width,
625
- height: height,
626
- isSharingWindow: isSharingWindow,
627
- isNewBounds: isNewBounds,
628
- activeWindow: activeWindow,
629
- id: id
630
- })));
678
+ // this.logger.info(
679
+ // `updateBoundsByActiveWindow ${JSON.stringify({
680
+ // activeBounds,
681
+ // width,
682
+ // height,
683
+ // isSharingWindow,
684
+ // isNewBounds,
685
+ // activeWindow,
686
+ // id,
687
+ // })}`,
688
+ // );
631
689
  if (isSharingWindow && isNewBounds) {
632
690
  this._updateAnnotationBounds(activeBounds);
633
- this.logger.info('The window bounds is the different as the current share bounds');
691
+ // this.logger.info('The window bounds is the different as the current share bounds');
634
692
  }
635
693
  }
636
694
  }, {
637
695
  key: "_addWindowResizeListenner",
638
696
  value: function _addWindowResizeListenner() {
639
- var _this3 = this;
640
- var isDisplay = this._currentShareInfo.type === _type.AgoraRtcScreenCaptureType.SCREEN;
641
- this.logger.info("current sharing type is screen: ".concat(isDisplay, ", has watch resize timer: ").concat(!!this._resizeWatcherTimer));
642
- if (isDisplay) return;
643
- if (!this._resizeWatcherTimer) {
697
+ var _this4 = this;
698
+ if (!this._resizeWatcherTimer && (0, _env.isElectron)()) {
644
699
  this._resizeWatcherTimer = setInterval(function () {
645
- _this3.logger.info("addWindowResizeListenner interval ".concat(_this3._currentShareInfo));
646
- _this3._updateBoundsByActiveWindow();
647
- }, 3000);
700
+ // this.logger.info(`addWindowResizeListenner interval ${this._currentShareInfo}`);
701
+ _this4._updateBoundsByActiveWindow();
702
+ }, 2000);
648
703
  }
649
704
  }
650
705
  }, {
651
706
  key: "_removeWindowResizeListenner",
652
707
  value: function _removeWindowResizeListenner() {
653
- if (this._resizeWatcherTimer) {
708
+ if (this._resizeWatcherTimer && (0, _env.isElectron)()) {
654
709
  clearInterval(this._resizeWatcherTimer);
655
710
  this._resizeWatcherTimer = null;
656
711
  }
657
712
  }
713
+ }, {
714
+ key: "_checkSharingwindowBackupSize",
715
+ value: function _checkSharingwindowBackupSize() {
716
+ var size = this._sharingProvider.getSharingControl().getSharingWindowSize();
717
+ this.logger.info('[Annotation][checkSharingwindowBackupSize] default size: ', size);
718
+ return !!(size && size.width > 0 && size.height > 0);
719
+ }
720
+ }, {
721
+ key: "_setBoardDomWithBackupWindowSize",
722
+ value: function _setBoardDomWithBackupWindowSize(containerHeight) {
723
+ var size = this._sharingProvider.getSharingControl().getSharingWindowSize();
724
+ var getWidth = size.width;
725
+ var getHeight = size.height;
726
+ var ratio = getWidth / getHeight;
727
+ var newWidth = containerHeight * ratio;
728
+ this._boardOriginWidth = newWidth;
729
+ if (this._boardDom) {
730
+ var _this$boardMainWindow2;
731
+ this._boardDom.style.width = "".concat(newWidth, "px");
732
+ this._boardDom.style.height = "".concat(containerHeight, "px");
733
+ (_this$boardMainWindow2 = this.boardMainWindow) === null || _this$boardMainWindow2 === void 0 || _this$boardMainWindow2.updateWindowSize({
734
+ width: newWidth,
735
+ height: containerHeight
736
+ });
737
+ }
738
+ }
739
+ }, {
740
+ key: "_renewAnnotationWhiteboardToolbar",
741
+ value: function _renewAnnotationWhiteboardToolbar() {
742
+ this._toolbarStore = new _annotationToolbarStore.AnnotationReceiverToolbarStore(this._annotationControl, this._roomControl, this._annotationProvider, this._eventProvider, this._sharedAnnotationDataSource);
743
+ this.logger.info('[Annotation][renewAnnotationWhiteboardToolbar] is done');
744
+ this.receiverAllOpenStateReady = true;
745
+ }
746
+ }, {
747
+ key: "_clearAnnotationWhiteboardToolbar",
748
+ value: function _clearAnnotationWhiteboardToolbar() {
749
+ this._toolbarStore = undefined;
750
+ this.logger.info('[Annotation][clearAnnotationWhiteboardToolbar] is done');
751
+ this.receiverAllOpenStateReady = false;
752
+ }
753
+ }, {
754
+ key: "_participantShareCanWeAnnotation",
755
+ value: function _participantShareCanWeAnnotation() {
756
+ var streams = this._streamControl.getStreams();
757
+ var _notSupportPlatform = [_type4.FcrPlatform.WEB_DESKTOP, _type4.FcrPlatform.WEB_MOBILE, _type4.FcrPlatform.IOS];
758
+ var streamLists = Object.keys(streams).map(function (key) {
759
+ return streams[key];
760
+ });
761
+ var screenShareStreams = streamLists.map(function (streamList) {
762
+ return streamList.find(function (streamInfo) {
763
+ return streamInfo.videoSourceType === _fcrCore.FcrVideoSourceType.SCREEN;
764
+ });
765
+ }).filter(Boolean);
766
+ if (screenShareStreams.length > 0) {
767
+ var screenShareOwnerInfo = screenShareStreams[0];
768
+ var _participantPlatform = screenShareOwnerInfo === null || screenShareOwnerInfo === void 0 ? void 0 : screenShareOwnerInfo.owner.platform;
769
+ this.logger.info("[Annotation] current share participant platform: ".concat(_participantPlatform));
770
+ if (typeof _participantPlatform !== 'undefined' && !_notSupportPlatform.includes(_participantPlatform)) {
771
+ return true;
772
+ } else {
773
+ return false;
774
+ }
775
+ }
776
+ return false;
777
+ }
778
+
779
+ /**
780
+ * 接收端step1
781
+ * 判断状态,打开批注(core: 进入房间,初始化白板APP)
782
+ */
783
+ }, {
784
+ key: "_connectAnnotaionBoard",
785
+ value: function _connectAnnotaionBoard(screenShareOwnerId) {
786
+ if (this._participantShareCanWeAnnotation()) {
787
+ this.logger.info('[Annotation] we can receive annotation from share platform');
788
+ this._getCurrentAnnotationControl();
789
+ if (this._annotationControl) {
790
+ if (screenShareOwnerId !== this._memberDataSource.localUser.userId) {
791
+ this._deleteBoardDomContent();
792
+ this.logger.info('[Annotation] start step1 == > receiver enter core open');
793
+ this._annotationControl.open();
794
+ }
795
+ }
796
+ }
797
+ }
798
+
799
+ /**
800
+ * 接收端step2
801
+ * 白板连接成功,进行后置副作用操作
802
+ */
803
+ }, {
804
+ key: "_annotationStartTriggerEffect",
805
+ value: (function () {
806
+ var _annotationStartTriggerEffect2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3() {
807
+ return _regenerator["default"].wrap(function (_context3) {
808
+ while (1) switch (_context3.prev = _context3.next) {
809
+ case 0:
810
+ if (!this._annotationEndLock) {
811
+ _context3.next = 1;
812
+ break;
813
+ }
814
+ this.logger.info('annotation start in await lock');
815
+ _context3.next = 1;
816
+ return this._annotationEndLock;
817
+ case 1:
818
+ this.logger.info('annotation start after await lock');
819
+ this._renewAnnotationWhiteboardToolbar();
820
+ case 2:
821
+ case "end":
822
+ return _context3.stop();
823
+ }
824
+ }, _callee3, this);
825
+ }));
826
+ function _annotationStartTriggerEffect() {
827
+ return _annotationStartTriggerEffect2.apply(this, arguments);
828
+ }
829
+ return _annotationStartTriggerEffect;
830
+ }())
831
+ }, {
832
+ key: "_handleOnScreenSharingUpdated",
833
+ value: function _handleOnScreenSharingUpdated(ownerStream, state) {
834
+ this._shareScreenOwnerId = (ownerStream === null || ownerStream === void 0 ? void 0 : ownerStream.owner.userId) || '';
835
+ // if (state === FcrScreenSharingState.START_WHIT_ANNOTATION) {
836
+ // this.logger.info('[Annotation] transaction main start');
837
+ // this._annotationMainStart();
838
+ // } else {
839
+ // this.logger.info('[Annotation] main end , because current sharing not with annotation');
840
+ // if (this._isLocalUserSharingOwner) {
841
+ // /** 屏幕共享的状态没有包含批注,当前是发起者,则关闭fragment */
842
+ // this._annotationProvider.closeAnnotationWindow();
843
+ // } else {
844
+ // /** 屏幕共享的状态没有包含批注,接收端进行总体的关闭 */
845
+ // this._annotationaEndEffectThenCloseBoard();
846
+ // }
847
+ // }
848
+ if (state === _type2.FcrScreenSharingState.START_ONLY_SCREEN) {
849
+ this.logger.info('[Annotation] sender transaction main start');
850
+ this._annotationSenderMainStart();
851
+ } else if (state === _type2.FcrScreenSharingState.START_WHIT_ANNOTATION) {
852
+ this.logger.info('[Annotation] receiver transaction main start');
853
+ this._annotationReceiverMainStart();
854
+ } else if (state === _type2.FcrScreenSharingState.END) {
855
+ this.logger.info('[Annotation] main end , because current sharing not with annotation');
856
+ if (this._isLocalUserSharingOwner) {
857
+ /** 屏幕共享的状态没有包含批注,当前是发起者,则关闭fragment */
858
+ this._annotationProvider.closeAnnotationWindow();
859
+ } else {
860
+ /** 屏幕共享的状态没有包含批注,接收端进行总体的关闭 */
861
+ this._annotationaEndEffectThenCloseBoard();
862
+ }
863
+ }
864
+ }
865
+ }, {
866
+ key: "_handleOnAnnotationConnectionStateUpdated",
867
+ value: function _handleOnAnnotationConnectionStateUpdated(state) {
868
+ if (state === _fcrCore.FcrConnectionState.CONNECTED) {
869
+ var _this$_annotationCont;
870
+ var mainWindow = (_this$_annotationCont = this._annotationControl) === null || _this$_annotationCont === void 0 ? void 0 : _this$_annotationCont.getMainWindow();
871
+ this.logger.info("[Annotation] annotation board connected, we get boardMainWindow in callback!");
872
+ this._sharedAnnotationDataSource.setBoardMainWindow(mainWindow);
873
+ this._sharedAnnotationDataSource.setAnnotationState(_annotationProvider.FcrAnnotationState.START);
874
+ } else {
875
+ if (state === _fcrCore.FcrConnectionState.DISCONNECTED || state === _fcrCore.FcrConnectionState.ABORTED) {
876
+ this.logger.info('[Annotation] main end because annotation board not connected');
877
+ /** 批注白板的连接状态没有连接成功,进行总体的关闭 */
878
+ this._annotationaEndEffectThenCloseBoard();
879
+ }
880
+ this._sharedAnnotationDataSource.setAnnotationState(_annotationProvider.FcrAnnotationState.END);
881
+ }
882
+ }
883
+ }, {
884
+ key: "_deleteBoardDomContent",
885
+ value: function _deleteBoardDomContent() {
886
+ if (this._boardDom && this.boardMainWindow) {
887
+ this.logger.info('[Annotation] delete old boardMainWindow');
888
+ this._boardDom.removeChild(this.boardMainWindow.getContentView());
889
+ this._sharedAnnotationDataSource.setBoardMainWindow(null);
890
+ }
891
+ }
892
+ }, {
893
+ key: "syncScreenShareOwnerOpenDone",
894
+ value: function syncScreenShareOwnerOpenDone() {
895
+ var _this$_annotationCont2;
896
+ this.logger.info('[Annotation] syncScreenShareOwnerOpenDone');
897
+ (_this$_annotationCont2 = this._annotationControl) === null || _this$_annotationCont2 === void 0 || _this$_annotationCont2.syncScreenShareOwnerAnnotationOpenDone();
898
+ }
658
899
  }]);
659
900
  }();
660
901
  _AnnotationStore = AnnotationStore;
661
- var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_AnnotationStore, [[_mobx.observable, 1, "resetToolbarStore"], [_mobx.observable, 1, "isShowToolbar"], [_mobx.computed, 3, "scalcValue"], [_mobx.computed, 3, "annotating"], [_decorator.bound, 2, "isAnnotationSupported"], [_decorator.bound, 2, "getToolbarStore"], [_setToolsShowDecs, 18, "setToolsShow"], [_zoomInDecs, 18, "zoomIn"], [_zoomOutDecs, 18, "zoomOut"], [_fullContainerDecs, 18, "fullContainer"], [_setOriginScalcDecs, 18, "setOriginScalc"], [_drawReceiverBoardDecs, 18, "drawReceiverBoard"], [_handleBoardDomLoadDecs, 18, "handleBoardDomLoad"], [_handleBoardContainerDomLoadDecs, 18, "handleBoardContainerDomLoad"], [_decorator.bound, 2, "screenSharingStarted"], [_decorator.bound, 2, "release"], [_annotationEndedDecs, 18, "_annotationEnded"], [_mountDecs, 18, "_mount"], [_unmountDecs, 18, "_unmount"], [_decorator.bound, 2, "_close"], [_decorator.bound, 2, "_updateAnnotationBounds"], [_decorator.bound, 2, "_updateBoundsByActiveWindow"], [_decorator.bound, 2, "_addWindowResizeListenner"], [_decorator.bound, 2, "_removeWindowResizeListenner"]], []).e, 3);
662
- _init_resetToolbarStore = _applyDecs$e[0];
663
- _init_isShowToolbar = _applyDecs$e[1];
664
- _initProto = _applyDecs$e[2];
902
+ var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_AnnotationStore, [[_mobx.observable, 1, "receiverAllOpenStateReady"], [_mobx.computed, 3, "scalcValue"], [_mobx.computed, 3, "annotating"], [_decorator.bound, 2, "isAnnotationSupported"], [_decorator.bound, 2, "getToolbarStore"], [_handleReceiverBoardDecs, 18, "handleReceiverBoard"], [_handleBoardDomLoadDecs, 18, "handleBoardDomLoad"], [_handleBoardContainerDomLoadDecs, 18, "handleBoardContainerDomLoad"], [_decorator.bound, 2, "screenSharingStarted"], [_decorator.bound, 2, "release"], [_decorator.bound, 2, "_clearCurrentAnnotationControl"], [_decorator.bound, 2, "_getCurrentAnnotationControl"], [_decorator.bound, 2, "_annotationSenderMainStart"], [_decorator.bound, 2, "_annotationReceiverMainStart"], [_annotationaEndEffectThenCloseBoardDecs, 18, "_annotationaEndEffectThenCloseBoard"], [_mountDecs, 18, "_mount"], [_unmountDecs, 18, "_unmount"], [_decorator.bound, 2, "_close"], [_decorator.bound, 2, "_handleOnLocalVideoStatsUpdated"], [_decorator.bound, 2, "_updateAnnotationBounds"], [_decorator.bound, 2, "_updateBoundsByActiveWindow"], [_decorator.bound, 2, "_addWindowResizeListenner"], [_decorator.bound, 2, "_removeWindowResizeListenner"], [_decorator.bound, 2, "_checkSharingwindowBackupSize"], [_decorator.bound, 2, "_setBoardDomWithBackupWindowSize"], [_decorator.bound, 2, "_renewAnnotationWhiteboardToolbar"], [_decorator.bound, 2, "_clearAnnotationWhiteboardToolbar"], [_decorator.bound, 2, "_participantShareCanWeAnnotation"], [_decorator.bound, 2, "_connectAnnotaionBoard"], [_annotationStartTriggerEffectDecs, 18, "_annotationStartTriggerEffect"], [_decorator.bound, 2, "_handleOnScreenSharingUpdated"], [_decorator.bound, 2, "_handleOnAnnotationConnectionStateUpdated"], [_decorator.bound, 2, "_deleteBoardDomContent"], [_decorator.bound, 2, "syncScreenShareOwnerOpenDone"]], []).e, 2);
903
+ _init_receiverAllOpenStateReady = _applyDecs$e[0];
904
+ _initProto = _applyDecs$e[1];
665
905
  var AnnotationStoreContext = exports.AnnotationStoreContext = /*#__PURE__*/(0, _react.createContext)({});