fcr-ui-scene 3.1.1 → 3.3.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.
- package/installer/icons/favicon.ico +0 -0
- package/installer/icons/favicon.png +0 -0
- package/installer/mac/entitlements.mac.plist +16 -0
- package/lib/base.d.ts +0 -1
- package/lib/base.js +16 -0
- package/lib/common/device-store.d.ts +4 -5
- package/lib/common/device-store.js +178 -86
- package/lib/common/device-stream-store.d.ts +3 -2
- package/lib/common/device-stream-store.js +94 -72
- package/lib/common/event-store.d.ts +20 -3
- package/lib/common/event-store.js +43 -5
- package/lib/common/security-store.d.ts +16 -16
- package/lib/common/security-store.js +278 -124
- package/lib/electron/app.js +13 -5
- package/lib/electron/bootstrap-dev.d.ts +1 -0
- package/lib/electron/bootstrap-dev.js +51 -0
- package/lib/electron/bootstrap-sdk.d.ts +1 -0
- package/lib/electron/bootstrap-sdk.js +56 -0
- package/lib/electron/bootstrap.d.ts +1 -0
- package/lib/electron/bootstrap.js +56 -0
- package/lib/electron/default-options.js +1 -1
- package/lib/electron/dev.d.ts +1 -0
- package/lib/electron/dev.js +51 -0
- package/lib/electron/injections.d.ts +3 -4
- package/lib/electron/injections.js +46 -33
- package/lib/electron/logger.d.ts +6 -0
- package/lib/electron/logger.js +66 -0
- package/lib/electron/main.js +15 -11
- package/lib/electron/plugins/meeting-state.d.ts +2 -0
- package/lib/electron/plugins/meeting-state.js +39 -0
- package/lib/electron/preload.js +2 -1
- package/lib/electron/tools.js +9 -0
- package/lib/electron/window.d.ts +1 -1
- package/lib/electron/window.js +14 -2
- package/lib/fragments/control-bar/context.d.ts +0 -1
- package/lib/fragments/control-bar/control-bar-store.d.ts +34 -1
- package/lib/fragments/control-bar/control-bar-store.js +394 -81
- package/lib/fragments/control-bar/device/index.js +12 -3
- package/lib/fragments/control-bar/index.css +15 -10
- package/lib/fragments/control-bar/index.js +19 -1
- package/lib/fragments/control-bar/meeting-details/meeting-detail.css +109 -0
- package/lib/fragments/control-bar/meeting-details/meeting-details-portal.d.ts +3 -0
- package/lib/fragments/control-bar/meeting-details/meeting-details-portal.js +60 -0
- package/lib/fragments/control-bar/meeting-details/meeting-details.d.ts +2 -0
- package/lib/fragments/control-bar/meeting-details/meeting-details.js +179 -0
- package/lib/fragments/control-bar/more-actions/index.css +53 -0
- package/lib/fragments/control-bar/more-actions/index.js +77 -37
- package/lib/fragments/control-bar/security-content/index.css +10 -0
- package/lib/fragments/control-bar/security-content/index.js +43 -18
- package/lib/fragments/control-bar/view.js +8 -2
- package/lib/fragments/live-streaming/context.d.ts +0 -1
- package/lib/fragments/live-streaming/store.js +27 -17
- package/lib/fragments/share-screen-selection/context.d.ts +0 -1
- package/lib/fragments/share-screen-selection/selection-store.d.ts +0 -1
- package/lib/fragments/share-screen-selection/selection-store.js +34 -33
- package/lib/fragments/share-screen-selection/view.js +7 -0
- package/lib/fragments/toolbar/components/color-picker/components/color.js +2 -0
- package/lib/fragments/toolbar/components/color-picker/components/panel.js +4 -0
- package/lib/fragments/toolbar/components/color-picker/components/picker.js +2 -0
- package/lib/fragments/toolbar/components/color-picker/index.js +5 -1
- package/lib/fragments/toolbar/components/color-picker.js +3 -1
- package/lib/fragments/toolbar/components/eraser-picker.js +4 -13
- package/lib/fragments/toolbar/components/extension-toolbar-item.js +5 -0
- package/lib/fragments/toolbar/components/extra-tool-picker.js +4 -0
- package/lib/fragments/toolbar/components/pen-picker.js +2 -0
- package/lib/fragments/toolbar/components/screen-capture-picker.js +2 -0
- package/lib/fragments/toolbar/components/shape-picker.js +2 -0
- package/lib/fragments/toolbar/hooks.d.ts +1 -1
- package/lib/fragments/toolbar/hooks.js +13 -8
- package/lib/fragments/toolbar/store.d.ts +4 -4
- package/lib/fragments/toolbar/store.js +20 -2
- package/lib/fragments/toolbar/view.js +2 -0
- package/lib/global.d.ts +1 -0
- package/lib/hooks/meeting-time.d.ts +2 -2
- package/lib/login-confirm-dialog.d.ts +12 -0
- package/lib/login-confirm-dialog.js +80 -0
- package/lib/modules/action-bar/action-bar-collapes-items.js +14 -5
- package/lib/modules/action-bar/chat/index.js +6 -6
- package/lib/modules/action-bar/context.d.ts +0 -1
- package/lib/modules/action-bar/device/index.css +7 -2
- package/lib/modules/action-bar/device/index.d.ts +2 -2
- package/lib/modules/action-bar/device/index.js +6 -4
- package/lib/modules/action-bar/index.css +63 -12
- package/lib/modules/action-bar/index.d.ts +3 -2
- package/lib/modules/action-bar/index.dev.js +8 -7
- package/lib/modules/action-bar/index.js +21 -0
- package/lib/modules/action-bar/item-placement.d.ts +1 -2
- package/lib/modules/action-bar/item.js +5 -0
- package/lib/modules/action-bar/leave/assign-host.d.ts +3 -1
- package/lib/modules/action-bar/leave/assign-host.js +7 -7
- package/lib/modules/action-bar/leave/index.js +35 -7
- package/lib/modules/action-bar/leave/leave-meeting.d.ts +11 -1
- package/lib/modules/action-bar/leave/leave-meeting.js +25 -16
- package/lib/modules/action-bar/more/poppover-content.d.ts +0 -1
- package/lib/modules/action-bar/more/poppover-content.js +14 -4
- package/lib/modules/action-bar/participants/index.css +12 -0
- package/lib/modules/action-bar/participants/index.js +21 -14
- package/lib/modules/action-bar/screen-share/index.js +5 -1
- package/lib/modules/action-bar/screen-share/submenu.js +17 -22
- package/lib/modules/action-bar/security/drop-menu.js +124 -14
- package/lib/modules/action-bar/security/index.js +1 -1
- package/lib/modules/action-bar/settings/index.js +1 -1
- package/lib/modules/action-bar/store.d.ts +45 -21
- package/lib/modules/action-bar/store.js +544 -134
- package/lib/modules/action-bar/view.js +65 -42
- package/lib/modules/audio-stream/index.js +12 -6
- package/lib/modules/chat/chat-bar/index.js +46 -27
- package/lib/modules/chat/chat-select/index.css +19 -4
- package/lib/modules/chat/chat-select/index.d.ts +0 -1
- package/lib/modules/chat/chat-select/index.js +29 -3
- package/lib/modules/chat/chat.d.ts +2 -3
- package/lib/modules/chat/chat.js +210 -107
- package/lib/modules/chat/contex.d.ts +0 -1
- package/lib/modules/chat/demo-wrapper.d.ts +0 -1
- package/lib/modules/chat/index.css +49 -0
- package/lib/modules/chat/index.d.ts +3 -3
- package/lib/modules/chat/index.dev.js +4 -4
- package/lib/modules/chat/index.js +32 -11
- package/lib/modules/chat/message-list.js +81 -49
- package/lib/modules/chat/store.d.ts +50 -4
- package/lib/modules/chat/store.js +303 -124
- package/lib/modules/chat/util.js +1 -1
- package/lib/modules/connection-gateway/components/phone/components/callinfo/index.js +2 -0
- package/lib/modules/connection-gateway/components/phone/index.js +2 -0
- package/lib/modules/connection-gateway/index.d.ts +3 -2
- package/lib/modules/connection-gateway/index.js +2 -0
- package/lib/modules/connection-gateway/store.d.ts +6 -4
- package/lib/modules/connection-gateway/store.js +46 -15
- package/lib/modules/device-pretest/audio-preview/microphone-detection.d.ts +1 -0
- package/lib/modules/device-pretest/audio-preview/microphone-detection.js +3 -2
- package/lib/modules/device-pretest/audio-preview/speaker-control.d.ts +0 -1
- package/lib/modules/device-pretest/audio-preview/speaker-control.js +1 -1
- package/lib/modules/device-pretest/context.d.ts +0 -1
- package/lib/modules/device-pretest/index.css +0 -4
- package/lib/modules/device-pretest/index.d.ts +0 -1
- package/lib/modules/device-pretest/index.js +2 -1
- package/lib/modules/device-pretest/settings/beauty.js +19 -6
- package/lib/modules/device-pretest/settings/video-effect.d.ts +0 -1
- package/lib/modules/device-pretest/settings/video-settings-basic.js +1 -0
- package/lib/modules/device-pretest/settings/virtual-background-setting.js +2 -0
- package/lib/modules/device-pretest/store.js +34 -19
- package/lib/modules/dialog/components/chat/electron.js +3 -2
- package/lib/modules/dialog/components/chat/index.js +1 -1
- package/lib/modules/dialog/components/confirm/electron.js +7 -5
- package/lib/modules/dialog/components/confirm/index.js +16 -2
- package/lib/modules/dialog/components/connection-gateway/electron.js +4 -2
- package/lib/modules/dialog/components/connection-gateway/index.css +0 -2
- package/lib/modules/dialog/components/device-setting/electron.d.ts +2 -0
- package/lib/modules/dialog/components/device-setting/electron.js +74 -0
- package/lib/modules/dialog/components/device-setting/index.css +26 -0
- package/lib/modules/dialog/components/device-setting/index.d.ts +4 -0
- package/lib/modules/dialog/components/device-setting/index.js +60 -0
- package/lib/modules/dialog/components/operation-waiting-room/electron.d.ts +5 -0
- package/lib/modules/dialog/components/operation-waiting-room/electron.js +89 -0
- package/lib/modules/dialog/components/operation-waiting-room/index.css +44 -0
- package/lib/modules/dialog/components/operation-waiting-room/index.d.ts +5 -0
- package/lib/modules/dialog/components/operation-waiting-room/index.js +156 -0
- package/lib/modules/dialog/components/participant/electron.js +8 -2
- package/lib/modules/dialog/components/remove-admit-waiting-room/electron.d.ts +5 -0
- package/lib/modules/dialog/components/remove-admit-waiting-room/electron.js +89 -0
- package/lib/modules/dialog/components/remove-admit-waiting-room/index.css +50 -0
- package/lib/modules/dialog/components/remove-admit-waiting-room/index.d.ts +5 -0
- package/lib/modules/dialog/components/remove-admit-waiting-room/index.js +90 -0
- package/lib/modules/dialog/components/share-screen-selection/index.js +1 -1
- package/lib/modules/dialog/components/whiteboard/index.js +2 -1
- package/lib/modules/dialog/context.d.ts +0 -1
- package/lib/modules/dialog/dialogs.d.ts +0 -2
- package/lib/modules/dialog/dialogs.js +62 -103
- package/lib/modules/dialog/index.css +7 -6
- package/lib/modules/dialog/index.d.ts +1 -1
- package/lib/modules/dialog/index.js +17 -0
- package/lib/modules/dialog/store.d.ts +6 -2
- package/lib/modules/dialog/store.js +52 -9
- package/lib/modules/dialog/view.js +2 -0
- package/lib/modules/event-notification/context.d.ts +2 -0
- package/lib/modules/event-notification/context.js +9 -0
- package/lib/modules/event-notification/index.css +58 -0
- package/lib/modules/event-notification/index.d.ts +13 -0
- package/lib/modules/event-notification/index.js +48 -0
- package/lib/modules/event-notification/store.d.ts +17 -0
- package/lib/modules/event-notification/store.js +133 -0
- package/lib/modules/event-notification/view.d.ts +5 -0
- package/lib/modules/event-notification/view.js +114 -0
- package/lib/modules/event-toast/context.d.ts +0 -1
- package/lib/modules/event-toast/store.js +16 -0
- package/lib/modules/invite/context.d.ts +0 -1
- package/lib/modules/invite/index.css +4 -4
- package/lib/modules/invite/index.d.ts +2 -2
- package/lib/modules/invite/pstn-invite.js +4 -1
- package/lib/modules/invite/store.d.ts +2 -2
- package/lib/modules/invite/store.js +27 -7
- package/lib/modules/invite/voip-invite.d.ts +0 -1
- package/lib/modules/invite/voip-invite.js +1 -1
- package/lib/modules/layout/components/Aside.d.ts +0 -1
- package/lib/modules/layout/components/Aside.js +4 -1
- package/lib/modules/layout/components/Carousel.js +6 -5
- package/lib/modules/layout/components/Gallery.js +16 -9
- package/lib/modules/layout/components/Layout.js +82 -57
- package/lib/modules/layout/components/index.css +42 -5
- package/lib/modules/layout/components/index.js +3 -0
- package/lib/modules/layout/context.d.ts +0 -1
- package/lib/modules/layout/index.css +30 -0
- package/lib/modules/layout/index.dev.js +11 -11
- package/lib/modules/layout/index.js +0 -6
- package/lib/modules/layout/member-window/index.css +5 -5
- package/lib/modules/layout/member-window/index.d.ts +7 -7
- package/lib/modules/layout/member-window/index.js +59 -13
- package/lib/modules/layout/store.d.ts +61 -50
- package/lib/modules/layout/store.js +517 -342
- package/lib/modules/layout/type.d.ts +2 -1
- package/lib/modules/layout/video-window-datasource.d.ts +14 -8
- package/lib/modules/layout/video-window-datasource.js +129 -78
- package/lib/modules/live-streaming/context.d.ts +0 -1
- package/lib/modules/live-streaming/index.d.ts +2 -2
- package/lib/modules/live-streaming/index.dev.js +5 -4
- package/lib/modules/live-streaming/store.d.ts +2 -2
- package/lib/modules/live-streaming/store.js +32 -11
- package/lib/modules/participant/attendee/index.d.ts +12 -3
- package/lib/modules/participant/attendee/index.js +142 -30
- package/lib/modules/participant/context.d.ts +0 -1
- package/lib/modules/participant/index.css +20 -0
- package/lib/modules/participant/index.d.ts +5 -2
- package/lib/modules/participant/index.dev.js +14 -12
- package/lib/modules/participant/index.js +27 -0
- package/lib/modules/participant/member-list-data-source.d.ts +3 -3
- package/lib/modules/participant/member-list-data-source.js +29 -3
- package/lib/modules/participant/room-control-drop-menu/index.css +37 -0
- package/lib/modules/participant/room-control-drop-menu/index.js +35 -1
- package/lib/modules/participant/store.d.ts +59 -34
- package/lib/modules/participant/store.js +541 -222
- package/lib/modules/participant/view.d.ts +6 -6
- package/lib/modules/participant/view.js +138 -34
- package/lib/modules/setting/audio-settings/audio-settings.js +16 -12
- package/lib/modules/setting/audio-settings/index.css +2 -2
- package/lib/modules/setting/context.d.ts +0 -1
- package/lib/modules/setting/general-settings/general-settings.js +2 -1
- package/lib/modules/setting/general-settings/index.css +2 -2
- package/lib/modules/setting/index.css +1 -5
- package/lib/modules/setting/index.d.ts +2 -2
- package/lib/modules/setting/index.dev.js +14 -12
- package/lib/modules/setting/index.js +16 -0
- package/lib/modules/setting/minutes-settings/index.css +65 -0
- package/lib/modules/setting/minutes-settings/minutes-settings.d.ts +4 -0
- package/lib/modules/setting/minutes-settings/minutes-settings.js +159 -0
- package/lib/modules/setting/state/index.css +0 -4
- package/lib/modules/setting/state/index.js +11 -1
- package/lib/modules/setting/storage-settings/storage-settings.js +1 -1
- package/lib/modules/setting/store.d.ts +7 -5
- package/lib/modules/setting/store.js +69 -46
- package/lib/modules/setting/translate-settings/index.css +45 -0
- package/lib/modules/setting/translate-settings/language-select.d.ts +12 -0
- package/lib/modules/setting/translate-settings/language-select.js +50 -0
- package/lib/modules/setting/translate-settings/translate-settings.d.ts +4 -0
- package/lib/modules/setting/translate-settings/translate-settings.js +139 -0
- package/lib/modules/setting/video-settings/index.css +15 -6
- package/lib/modules/setting/video-settings/video-settings-basic.js +3 -2
- package/lib/modules/setting/video-settings/video-settings.js +5 -1
- package/lib/modules/setting/view.js +34 -2
- package/lib/modules/share-screen/index.d.ts +4 -2
- package/lib/modules/share-screen/index.dev.js +17 -14
- package/lib/modules/share-screen/index.js +2 -0
- package/lib/modules/share-screen/selection/index.css +2 -0
- package/lib/modules/share-screen/selection/index.js +44 -6
- package/lib/modules/share-screen/share-state-bar/index.css +49 -11
- package/lib/modules/share-screen/share-state-bar/index.d.ts +0 -1
- package/lib/modules/share-screen/share-state-bar/index.js +51 -20
- package/lib/modules/share-screen/store.d.ts +23 -13
- package/lib/modules/share-screen/store.js +733 -606
- package/lib/modules/state-bar/context.d.ts +0 -1
- package/lib/modules/state-bar/index.css +2 -2
- package/lib/modules/state-bar/index.d.ts +2 -2
- package/lib/modules/state-bar/index.dev.js +12 -10
- package/lib/modules/state-bar/layout-config.js +2 -0
- package/lib/modules/state-bar/live-streaming-state.js +3 -0
- package/lib/modules/state-bar/meeting-detail.css +6 -4
- package/lib/modules/state-bar/meeting-details.js +29 -3
- package/lib/modules/state-bar/meeting-network-state.css +14 -3
- package/lib/modules/state-bar/meeting-network-state.js +10 -4
- package/lib/modules/state-bar/recording.js +9 -11
- package/lib/modules/state-bar/store.d.ts +7 -5
- package/lib/modules/state-bar/store.js +68 -8
- package/lib/modules/state-bar/view.js +4 -8
- package/lib/modules/video-window/context.d.ts +0 -1
- package/lib/modules/video-window/deviceState/index.d.ts +3 -3
- package/lib/modules/video-window/index.css +1 -0
- package/lib/modules/video-window/members/index.js +7 -4
- package/lib/modules/video-window/store.d.ts +5 -4
- package/lib/modules/video-window/store.js +49 -17
- package/lib/modules/video-window/topControl/index.js +7 -0
- package/lib/modules/video-window/view.js +2 -0
- package/lib/modules/waiting-room-layout/context.d.ts +2 -0
- package/lib/modules/waiting-room-layout/context.js +9 -0
- package/lib/modules/waiting-room-layout/index.css +71 -0
- package/lib/modules/waiting-room-layout/index.d.ts +8 -0
- package/lib/modules/waiting-room-layout/index.js +47 -0
- package/lib/modules/waiting-room-layout/store.d.ts +30 -0
- package/lib/modules/waiting-room-layout/store.js +189 -0
- package/lib/modules/waiting-room-layout/type.d.ts +0 -0
- package/lib/modules/waiting-room-layout/type.js +1 -0
- package/lib/modules/waiting-room-layout/view.d.ts +3 -0
- package/lib/modules/waiting-room-layout/view.js +67 -0
- package/lib/modules/whiteboard/app.js +2 -8
- package/lib/modules/whiteboard/components/control-bar/index.css +3 -0
- package/lib/modules/whiteboard/components/control-bar/store.d.ts +0 -1
- package/lib/modules/whiteboard/components/control-bar/store.js +29 -29
- package/lib/modules/whiteboard/components/loading/index.js +2 -2
- package/lib/modules/whiteboard/components/multi-window/index.js +8 -3
- package/lib/modules/whiteboard/components/pagination/store.d.ts +0 -1
- package/lib/modules/whiteboard/components/progress/electron.js +3 -2
- package/lib/modules/whiteboard/components/progress/style.css +4 -3
- package/lib/modules/whiteboard/components/switch-theme/index.css +4 -0
- package/lib/modules/whiteboard/components/switch-theme/index.d.ts +2 -1
- package/lib/modules/whiteboard/components/switch-theme/index.js +29 -17
- package/lib/modules/whiteboard/components/switch-theme/item.d.ts +1 -0
- package/lib/modules/whiteboard/components/switch-theme/item.js +11 -2
- package/lib/modules/whiteboard/components/switch-theme/libs.d.ts +2 -1
- package/lib/modules/whiteboard/components/switch-theme/libs.js +21 -20
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/panel.js +2 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/index.js +3 -1
- package/lib/modules/whiteboard/components/toolbar/components/eraser-picker.js +11 -9
- package/lib/modules/whiteboard/components/toolbar/components/extra-tool-picker.js +4 -0
- package/lib/modules/whiteboard/components/toolbar/components/move-handle.js +5 -0
- package/lib/modules/whiteboard/components/toolbar/components/pen-picker.js +2 -0
- package/lib/modules/whiteboard/components/toolbar/components/shape-picker.js +18 -12
- package/lib/modules/whiteboard/components/toolbar/hooks/index.d.ts +3 -3
- package/lib/modules/whiteboard/components/toolbar/hooks/index.js +16 -11
- package/lib/modules/whiteboard/components/toolbar/index.js +9 -0
- package/lib/modules/whiteboard/components/toolbar/store.d.ts +8 -7
- package/lib/modules/whiteboard/components/toolbar/store.js +25 -4
- package/lib/modules/whiteboard/context.d.ts +7 -3
- package/lib/modules/whiteboard/context.js +6 -4
- package/lib/modules/whiteboard/index.d.ts +6 -8
- package/lib/modules/whiteboard/index.js +310 -255
- package/lib/modules/whiteboard/type.d.ts +4 -12
- package/lib/modules/whiteboard/type.js +6 -16
- package/lib/modules/whiteboard/utils.d.ts +1 -0
- package/lib/modules/whiteboard/utils.js +12 -1
- package/lib/plugins/browser-runtime-plugin.js +2 -1
- package/lib/plugins/module-dev-plugin.js +12 -10
- package/lib/plugins/multi-lang-plugin.d.ts +1 -5
- package/lib/plugins/multi-lang-plugin.js +2 -0
- package/lib/runtime.d.ts +3 -5
- package/lib/translations/enUS.d.ts +590 -0
- package/lib/translations/enUS.js +608 -6
- package/lib/translations/zhCN.d.ts +588 -0
- package/lib/translations/zhCN.js +604 -4
- package/lib/type.d.ts +6 -2
- package/lib/ui-manager.d.ts +7 -3
- package/lib/ui-manager.js +597 -143
- package/lib/ui-scene.d.ts +1 -0
- package/lib/ui-scene.js +32 -22
- package/lib/utilities/board-context.d.ts +0 -1
- package/lib/utilities/constant.d.ts +47 -5
- package/lib/utilities/constant.js +44 -1
- package/lib/utilities/copyText.js +1 -1
- package/lib/utilities/extract.js +26 -3
- package/lib/utilities/hooks.js +2 -0
- package/lib/utilities/parameters.js +2 -2
- package/lib/utilities/renderer-event.js +28 -0
- package/lib/utilities/renderer.d.ts +1 -0
- package/lib/utilities/renderer.js +15 -6
- package/lib/utilities/tools.js +5 -2
- package/lib/utilities/ui-resources.d.ts +2 -2
- package/lib/utilities/ui-resources.js +20 -3
- package/lib/utilities/video-track-render-context.d.ts +0 -1
- package/package.json +17 -16
- package/public/assets/fcr_defaultpage.png +0 -0
- package/public/assets/login_confirm.png +0 -0
- package/public/index.html +29 -11
- package/lib/modules/device-pretest/settings/index.css +0 -15
- package/lib/modules/participant/attendee/participants-more-action.d.ts +0 -18
- package/lib/modules/participant/attendee/participants-more-action.js +0 -275
|
@@ -18,6 +18,24 @@ require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
|
18
18
|
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
19
19
|
require("core-js/modules/es.object.keys.js");
|
|
20
20
|
require("core-js/modules/es.reflect.construct.js");
|
|
21
|
+
require("core-js/modules/esnext.async-iterator.filter.js");
|
|
22
|
+
require("core-js/modules/esnext.function.metadata.js");
|
|
23
|
+
require("core-js/modules/esnext.iterator.filter.js");
|
|
24
|
+
require("core-js/modules/esnext.map.delete-all.js");
|
|
25
|
+
require("core-js/modules/esnext.map.emplace.js");
|
|
26
|
+
require("core-js/modules/esnext.map.every.js");
|
|
27
|
+
require("core-js/modules/esnext.map.filter.js");
|
|
28
|
+
require("core-js/modules/esnext.map.find.js");
|
|
29
|
+
require("core-js/modules/esnext.map.find-key.js");
|
|
30
|
+
require("core-js/modules/esnext.map.includes.js");
|
|
31
|
+
require("core-js/modules/esnext.map.key-of.js");
|
|
32
|
+
require("core-js/modules/esnext.map.map-keys.js");
|
|
33
|
+
require("core-js/modules/esnext.map.map-values.js");
|
|
34
|
+
require("core-js/modules/esnext.map.merge.js");
|
|
35
|
+
require("core-js/modules/esnext.map.reduce.js");
|
|
36
|
+
require("core-js/modules/esnext.map.some.js");
|
|
37
|
+
require("core-js/modules/esnext.map.update.js");
|
|
38
|
+
require("core-js/modules/esnext.symbol.metadata.js");
|
|
21
39
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
22
40
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
23
41
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -40,6 +58,38 @@ require("core-js/modules/es.set.js");
|
|
|
40
58
|
require("core-js/modules/es.string.includes.js");
|
|
41
59
|
require("core-js/modules/es.string.iterator.js");
|
|
42
60
|
require("core-js/modules/es.weak-map.js");
|
|
61
|
+
require("core-js/modules/esnext.async-iterator.find.js");
|
|
62
|
+
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
63
|
+
require("core-js/modules/esnext.async-iterator.some.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.iterator.some.js");
|
|
68
|
+
require("core-js/modules/esnext.set.add-all.js");
|
|
69
|
+
require("core-js/modules/esnext.set.delete-all.js");
|
|
70
|
+
require("core-js/modules/esnext.set.difference.v2.js");
|
|
71
|
+
require("core-js/modules/esnext.set.difference.js");
|
|
72
|
+
require("core-js/modules/esnext.set.every.js");
|
|
73
|
+
require("core-js/modules/esnext.set.filter.js");
|
|
74
|
+
require("core-js/modules/esnext.set.find.js");
|
|
75
|
+
require("core-js/modules/esnext.set.intersection.v2.js");
|
|
76
|
+
require("core-js/modules/esnext.set.intersection.js");
|
|
77
|
+
require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
|
|
78
|
+
require("core-js/modules/esnext.set.is-disjoint-from.js");
|
|
79
|
+
require("core-js/modules/esnext.set.is-subset-of.v2.js");
|
|
80
|
+
require("core-js/modules/esnext.set.is-subset-of.js");
|
|
81
|
+
require("core-js/modules/esnext.set.is-superset-of.v2.js");
|
|
82
|
+
require("core-js/modules/esnext.set.is-superset-of.js");
|
|
83
|
+
require("core-js/modules/esnext.set.join.js");
|
|
84
|
+
require("core-js/modules/esnext.set.map.js");
|
|
85
|
+
require("core-js/modules/esnext.set.reduce.js");
|
|
86
|
+
require("core-js/modules/esnext.set.some.js");
|
|
87
|
+
require("core-js/modules/esnext.set.symmetric-difference.v2.js");
|
|
88
|
+
require("core-js/modules/esnext.set.symmetric-difference.js");
|
|
89
|
+
require("core-js/modules/esnext.set.union.v2.js");
|
|
90
|
+
require("core-js/modules/esnext.set.union.js");
|
|
91
|
+
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
92
|
+
require("core-js/modules/esnext.weak-map.emplace.js");
|
|
43
93
|
require("core-js/modules/web.dom-collections.for-each.js");
|
|
44
94
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
45
95
|
require("core-js/modules/web.timers.js");
|
|
@@ -67,19 +117,22 @@ var _base = require("../../base");
|
|
|
67
117
|
var _store2 = require("./components/control-bar/store");
|
|
68
118
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
69
119
|
var _type2 = require("agora-edu-core/lib/type");
|
|
120
|
+
var _agoraEduCore = require("agora-edu-core");
|
|
70
121
|
var _enums = require("agora-edu-core/lib/room-control/whiteboard-control/enums");
|
|
71
122
|
var _libs = _interopRequireDefault(require("./components/switch-theme/libs"));
|
|
123
|
+
var _types = require("agora-edu-core/lib/room-control/whiteboard-control/types");
|
|
72
124
|
var _type3 = require("../layout/type");
|
|
73
125
|
var _i18n = require("agora-ui-foundation/lib/i18n");
|
|
126
|
+
var _type4 = require("agora-ui-foundation/lib/components/icon/type");
|
|
74
127
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
75
128
|
var _FcrWhiteboardUIModule;
|
|
76
|
-
var _initProto, _init__lonelyWindowState, _init__ownerUser, _init__isHost, _init__boardBackground, _init__localUser, _onPropertiesUpdateDecs, _mountDecs, _unmountDecs, _unloadDecs, _boardUIEventsDecs, _createToolbarUIContextDecs, _repositionToolbarDecs, _updateRedoDecs, _updateUndoDecs, _setConnectionStateDecs, _getSnapshotImageDecs, _openLonelyWindowDecs, _setJoinSuccessedDecs,
|
|
129
|
+
var _initProto, _init__lonelyWindowState, _init__ownerUser, _init__isHost, _init__boardBackground, _init__localUser, _onPropertiesUpdateDecs, _mountDecs, _unmountDecs, _unloadDecs, _boardUIEventsDecs, _createToolbarUIContextDecs, _repositionToolbarDecs, _updateRedoDecs, _updateUndoDecs, _setConnectionStateDecs, _getSnapshotImageDecs, _openLonelyWindowDecs, _setJoinSuccessedDecs, _ref;
|
|
77
130
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
78
131
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
79
132
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
80
133
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
81
|
-
function _classPrivateFieldInitSpec(
|
|
82
|
-
function _checkPrivateRedeclaration(
|
|
134
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
135
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
83
136
|
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
84
137
|
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
85
138
|
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"); }
|
|
@@ -93,7 +146,7 @@ var _B = /*#__PURE__*/new WeakMap();
|
|
|
93
146
|
var _C = /*#__PURE__*/new WeakMap();
|
|
94
147
|
var _D = /*#__PURE__*/new WeakMap();
|
|
95
148
|
var _E = /*#__PURE__*/new WeakMap();
|
|
96
|
-
_ref = (_onPropertiesUpdateDecs = [_mobx.action, _mobx.action.bound], _mountDecs = [_mobx.action, _mobx.action.bound], _unmountDecs = [_mobx.action, _mobx.action.bound], _unloadDecs = [_mobx.action, _mobx.action.bound], _boardUIEventsDecs = [_mobx.action, _mobx.action.bound], _createToolbarUIContextDecs = [_mobx.action, _mobx.action.bound], _repositionToolbarDecs = [_mobx.action, _mobx.action.bound], _updateRedoDecs = [_mobx.action, _mobx.action.bound], _updateUndoDecs = [_mobx.action, _mobx.action.bound], _setConnectionStateDecs = [_mobx.action, _mobx.action.bound], _getSnapshotImageDecs = [_mobx.action, _mobx.action.bound], _openLonelyWindowDecs = [_mobx.action, _mobx.action.bound], _setJoinSuccessedDecs = [_mobx.action, _mobx.action.bound],
|
|
149
|
+
_ref = (_onPropertiesUpdateDecs = [_mobx.action, _mobx.action.bound], _mountDecs = [_mobx.action, _mobx.action.bound], _unmountDecs = [_mobx.action, _mobx.action.bound], _unloadDecs = [_mobx.action, _mobx.action.bound], _boardUIEventsDecs = [_mobx.action, _mobx.action.bound], _createToolbarUIContextDecs = [_mobx.action, _mobx.action.bound], _repositionToolbarDecs = [_mobx.action, _mobx.action.bound], _updateRedoDecs = [_mobx.action, _mobx.action.bound], _updateUndoDecs = [_mobx.action, _mobx.action.bound], _setConnectionStateDecs = [_mobx.action, _mobx.action.bound], _getSnapshotImageDecs = [_mobx.action, _mobx.action.bound], _openLonelyWindowDecs = [_mobx.action, _mobx.action.bound], _setJoinSuccessedDecs = [_mobx.action, _mobx.action.bound], "_disposers");
|
|
97
150
|
var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/function (_UIModule) {
|
|
98
151
|
function FcrWhiteboardUIModule(_ref2) {
|
|
99
152
|
var _this;
|
|
@@ -107,10 +160,9 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
107
160
|
_this = _callSuper(this, FcrWhiteboardUIModule);
|
|
108
161
|
//@ts-ignore
|
|
109
162
|
(0, _defineProperty2["default"])(_this, _ref, (_initProto(_this), []));
|
|
110
|
-
(0, _defineProperty2["default"])(_this, "
|
|
111
|
-
(0, _defineProperty2["default"])(_this, "_connectionState", _enums.FcrBoardRoomConnectionState.DISCONNECTED);
|
|
163
|
+
(0, _defineProperty2["default"])(_this, "_connectionState", _agoraEduCore.FcrConnectionState.DISCONNECTED);
|
|
112
164
|
(0, _defineProperty2["default"])(_this, "_defaultBoardState", {
|
|
113
|
-
tool:
|
|
165
|
+
tool: _enums.FcrBoardToolType.LASER_POINTER,
|
|
114
166
|
strokeColor: '#fed130',
|
|
115
167
|
strokeWidth: 2
|
|
116
168
|
});
|
|
@@ -128,9 +180,9 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
128
180
|
(0, _defineProperty2["default"])(_this, "_joined", false);
|
|
129
181
|
(0, _defineProperty2["default"])(_this, "_grantedUsers", new Set());
|
|
130
182
|
_classPrivateFieldInitSpec(_this, _A, _init__lonelyWindowState(_this, _type.LonelyWindowState.DEFAULT));
|
|
131
|
-
_classPrivateFieldInitSpec(_this, _B, _init__ownerUser(_this,
|
|
183
|
+
_classPrivateFieldInitSpec(_this, _B, _init__ownerUser(_this, undefined));
|
|
132
184
|
_classPrivateFieldInitSpec(_this, _C, _init__isHost(_this, false));
|
|
133
|
-
_classPrivateFieldInitSpec(_this, _D, _init__boardBackground(_this, '#
|
|
185
|
+
_classPrivateFieldInitSpec(_this, _D, _init__boardBackground(_this, '#ffffff'));
|
|
134
186
|
_classPrivateFieldInitSpec(_this, _E, _init__localUser(_this));
|
|
135
187
|
_this._uiEventStore = uiEventStore;
|
|
136
188
|
_this._userControl = userControl;
|
|
@@ -146,22 +198,23 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
146
198
|
securityStore: securityStore
|
|
147
199
|
});
|
|
148
200
|
whiteboardControl.addObserver({
|
|
149
|
-
|
|
201
|
+
onActive: function onActive(ownerId, operatorUser) {
|
|
202
|
+
_this.onPropertiesUpdate({
|
|
203
|
+
operatorUser: operatorUser
|
|
204
|
+
});
|
|
205
|
+
},
|
|
206
|
+
onInactive: function onInactive(reason, operatorUser) {
|
|
150
207
|
var _this$_ownerUser;
|
|
151
|
-
_this.logger.info('onBoardActiveInfoUpdated', isActive, operatorUser);
|
|
152
208
|
var currentUserId = _this._localUser.userId;
|
|
153
|
-
|
|
154
|
-
if (reason === _enums.FcrBoardActiveInfoReason.REPLACE && userId !== currentUserId && ((_this$_ownerUser = _this._ownerUser) === null || _this$_ownerUser === void 0 ? void 0 : _this$_ownerUser.userId) === currentUserId) {
|
|
209
|
+
if (reason === _types.FcrBoardInactiveReason.SEIZE && (operatorUser === null || operatorUser === void 0 ? void 0 : operatorUser.userId) !== currentUserId && ((_this$_ownerUser = _this._ownerUser) === null || _this$_ownerUser === void 0 ? void 0 : _this$_ownerUser.userId) === currentUserId) {
|
|
155
210
|
_this._alertWhenReplace(operatorUser);
|
|
156
211
|
return;
|
|
157
212
|
}
|
|
158
|
-
|
|
159
|
-
operatorUser: operatorUser
|
|
160
|
-
}) : _this.onDestroy({
|
|
213
|
+
_this.onDestroy({
|
|
161
214
|
operatorUser: operatorUser
|
|
162
215
|
});
|
|
163
216
|
},
|
|
164
|
-
|
|
217
|
+
onBackgroundColorUpdated: function onBackgroundColorUpdated(color) {
|
|
165
218
|
_this._setBackground(color);
|
|
166
219
|
}
|
|
167
220
|
});
|
|
@@ -169,7 +222,7 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
169
222
|
onStreamsRemoved: function onStreamsRemoved(roomId, events) {
|
|
170
223
|
var isReplaced = events.find(function (event) {
|
|
171
224
|
var _event$cause;
|
|
172
|
-
return ((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.data.reason) ===
|
|
225
|
+
return ((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.data.reason) === _types.FcrBoardInactiveReason.SEIZE;
|
|
173
226
|
});
|
|
174
227
|
var isMyStream = events.some(function (event) {
|
|
175
228
|
return event.modifiedStream.owner.userId === _this._localUser.userId;
|
|
@@ -213,7 +266,7 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
213
266
|
if (_this._isActive) {
|
|
214
267
|
_this._checkBoard();
|
|
215
268
|
_this._ownerUser = _this._userControl.getUser(activeInfo.ownerUserId);
|
|
216
|
-
_this._boardBackground = whiteboardControl.
|
|
269
|
+
_this._boardBackground = whiteboardControl.getBackgroundColor();
|
|
217
270
|
}
|
|
218
271
|
return _this;
|
|
219
272
|
}
|
|
@@ -364,15 +417,15 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
364
417
|
value: function onProcessEvent(event) {
|
|
365
418
|
var action = event.action,
|
|
366
419
|
payload = event.payload;
|
|
367
|
-
if (Object.values(
|
|
368
|
-
|
|
369
|
-
}
|
|
370
|
-
if (Object.values(
|
|
371
|
-
|
|
372
|
-
}
|
|
373
|
-
if (Object.values(
|
|
374
|
-
|
|
375
|
-
}
|
|
420
|
+
// if (Object.values(ToolbarEvents).includes(action)) {
|
|
421
|
+
// this._caseToolbarEvents(action as ToolbarEvents, payload);
|
|
422
|
+
// }
|
|
423
|
+
// if (Object.values(WhiteboardEvents).includes(action)) {
|
|
424
|
+
// this._boardObservble()[action as WhiteboardEvents](payload);
|
|
425
|
+
// }
|
|
426
|
+
// if (Object.values(WhiteboardUIEvents).includes(action)) {
|
|
427
|
+
// this._boardUIEvents(payload)[action as WhiteboardUIEvents](payload);
|
|
428
|
+
// }
|
|
376
429
|
if (action === _constant.RendererEventAction.GET_LOCAL_USER) {
|
|
377
430
|
(0, _rendererEvent.sendEvent)({
|
|
378
431
|
action: _constant.RendererEventAction.SET_LOCAL_USER,
|
|
@@ -420,30 +473,61 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
420
473
|
}, {
|
|
421
474
|
key: "mount",
|
|
422
475
|
value: function mount() {
|
|
423
|
-
var _this2 = this;
|
|
424
476
|
var _boardMainWindow = this._boardMainWindow,
|
|
425
477
|
_boardDom = this._boardDom;
|
|
426
478
|
if (_boardDom && _boardMainWindow && !this._mounted) {
|
|
427
|
-
var _this$_collectorDom;
|
|
428
479
|
this._mounted = true;
|
|
429
480
|
var aspectRatio = this._initHeight / this._initWidth;
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
481
|
+
var view = _boardMainWindow.getContentView();
|
|
482
|
+
_boardDom.appendChild(view);
|
|
483
|
+
_boardMainWindow.setContainerSizeRatio(aspectRatio);
|
|
484
|
+
this._addDisposers();
|
|
485
|
+
this._resetToolIfNeed();
|
|
486
|
+
this._repositionToolbar();
|
|
487
|
+
if (this._boardMainWindow) {
|
|
488
|
+
var _this$_ownerUser3, _this$_localUser, _this$_boardStore2, _this$_boardStore3;
|
|
489
|
+
this._setBackground(this._whiteboardControl.getBackgroundColor() || this._boardBackground);
|
|
490
|
+
this._toolbarStore.observables.layoutReady = [_type.LonelyWindowState.CLOSE, _type.LonelyWindowState.DEFAULT].includes(this._lonelyWindowState);
|
|
491
|
+
var activeInfo = this._whiteboardControl.getBoardActiveInfo();
|
|
492
|
+
this._ownerUser = this._userControl.getUser(activeInfo.ownerUserId);
|
|
493
|
+
this._isMyBoard = ((_this$_ownerUser3 = this._ownerUser) === null || _this$_ownerUser3 === void 0 ? void 0 : _this$_ownerUser3.userId) === ((_this$_localUser = this._localUser) === null || _this$_localUser === void 0 ? void 0 : _this$_localUser.userId);
|
|
494
|
+
(_this$_boardStore2 = this._boardStore) === null || _this$_boardStore2 === void 0 || _this$_boardStore2.setPrivilege(this._isMyBoard || this._isHost);
|
|
495
|
+
(_this$_boardStore3 = this._boardStore) === null || _this$_boardStore3 === void 0 || _this$_boardStore3.setWriteEnable(this._isMyBoard || this._isHost);
|
|
496
|
+
this._uiEventStore.sendEvent(_constant.UIAction.WHITEBOARD_CHANGED, {
|
|
497
|
+
action: _type.WhiteboardBaseEvents.SET_OWNER_USER_ID,
|
|
498
|
+
payload: activeInfo.ownerUserId
|
|
499
|
+
});
|
|
500
|
+
(0, _rendererEvent.sendEvent)({
|
|
501
|
+
action: _constant.RendererEventAction.SET_OWNER_USER,
|
|
502
|
+
payload: this._userControl.getUser(activeInfo.ownerUserId)
|
|
503
|
+
});
|
|
504
|
+
}
|
|
439
505
|
}
|
|
440
506
|
}
|
|
441
507
|
}, {
|
|
442
508
|
key: "unmount",
|
|
443
509
|
value: function unmount() {
|
|
444
510
|
if (this._mounted && this._boardMainWindow) {
|
|
445
|
-
|
|
511
|
+
var _this$_boardDom;
|
|
512
|
+
(_this$_boardDom = this._boardDom) === null || _this$_boardDom === void 0 || _this$_boardDom.removeChild(this._boardMainWindow.getContentView());
|
|
446
513
|
this._boardMainWindow = undefined;
|
|
514
|
+
if (this._lonelyWindowState === _type.LonelyWindowState.OPEN) {
|
|
515
|
+
this._openLonelyWindow();
|
|
516
|
+
}
|
|
517
|
+
if (this._lonelyWindowState === _type.LonelyWindowState.CLOSE) {
|
|
518
|
+
this._open();
|
|
519
|
+
}
|
|
520
|
+
this._uiEventStore.sendEvent(_constant.UIAction.WHITEBOARD_CHANGED, {
|
|
521
|
+
action: _type.WhiteboardBaseEvents.SET_OWNER_USER_ID,
|
|
522
|
+
payload: null
|
|
523
|
+
});
|
|
524
|
+
(0, _rendererEvent.sendEvent)({
|
|
525
|
+
action: _constant.RendererEventAction.SET_OWNER_USER,
|
|
526
|
+
payload: null
|
|
527
|
+
});
|
|
528
|
+
this._ownerUser = undefined;
|
|
529
|
+
this._initialized = false;
|
|
530
|
+
this._close();
|
|
447
531
|
}
|
|
448
532
|
this._mounted = false;
|
|
449
533
|
if (this._timer) clearTimeout(this._timer);
|
|
@@ -459,10 +543,10 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
459
543
|
}, {
|
|
460
544
|
key: "_setBackground",
|
|
461
545
|
value: function _setBackground() {
|
|
462
|
-
var bgColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '#
|
|
546
|
+
var bgColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '#ffffff';
|
|
463
547
|
if (this._boardMainWindow) {
|
|
464
548
|
var _this$_boardMainWindo;
|
|
465
|
-
var themes = _libs["default"];
|
|
549
|
+
var themes = (0, _libs["default"])(this._t);
|
|
466
550
|
var _ref4 = themes.find(function (theme) {
|
|
467
551
|
return theme.background === bgColor;
|
|
468
552
|
}) || {
|
|
@@ -470,53 +554,57 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
470
554
|
},
|
|
471
555
|
colors = _ref4.colors;
|
|
472
556
|
(_this$_boardMainWindo = this._boardMainWindow) === null || _this$_boardMainWindo === void 0 || _this$_boardMainWindo.setBackgroundColor(bgColor);
|
|
473
|
-
|
|
557
|
+
if (colors && colors.length > 0) {
|
|
558
|
+
this._toolbarStore.observables.colors = colors;
|
|
559
|
+
}
|
|
474
560
|
}
|
|
475
561
|
}
|
|
476
562
|
}, {
|
|
477
563
|
key: "_resetToolIfNeed",
|
|
478
564
|
value: function _resetToolIfNeed() {
|
|
479
|
-
var _this$
|
|
480
|
-
if (
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
}
|
|
565
|
+
var _this$_toolbarContext, _this$_toolbarContext2, _this$_toolbarContext3;
|
|
566
|
+
// if (this._boardMainWindow?.mounted) {
|
|
567
|
+
var _this$_defaultBoardSt = this._defaultBoardState,
|
|
568
|
+
strokeColor = _this$_defaultBoardSt.strokeColor,
|
|
569
|
+
strokeWidth = _this$_defaultBoardSt.strokeWidth,
|
|
570
|
+
tool = _this$_defaultBoardSt.tool;
|
|
571
|
+
(_this$_toolbarContext = this._toolbarContext) === null || _this$_toolbarContext === void 0 || _this$_toolbarContext.setStrokeColor(strokeColor);
|
|
572
|
+
(_this$_toolbarContext2 = this._toolbarContext) === null || _this$_toolbarContext2 === void 0 || _this$_toolbarContext2.setStrokeWidth(strokeWidth);
|
|
573
|
+
(_this$_toolbarContext3 = this._toolbarContext) === null || _this$_toolbarContext3 === void 0 || _this$_toolbarContext3.setTool(tool);
|
|
574
|
+
// }
|
|
490
575
|
}
|
|
491
576
|
}, {
|
|
492
577
|
key: "_checkBoard",
|
|
493
578
|
value: function _checkBoard() {
|
|
494
579
|
if (!this._initialized) {
|
|
495
580
|
this._open();
|
|
496
|
-
this._initialized = true;
|
|
497
581
|
}
|
|
498
582
|
}
|
|
499
583
|
}, {
|
|
500
584
|
key: "_boardUIEvents",
|
|
501
585
|
value: function _boardUIEvents(observables) {
|
|
502
|
-
var
|
|
586
|
+
var _this2 = this;
|
|
503
587
|
return {
|
|
504
588
|
handleBoardDomLoad: function handleBoardDomLoad(ref) {
|
|
505
|
-
|
|
506
|
-
if (
|
|
507
|
-
|
|
589
|
+
_this2._boardDom = ref;
|
|
590
|
+
if (_this2._boardDom) {
|
|
591
|
+
_this2.mount();
|
|
592
|
+
} else {
|
|
593
|
+
_this2._mounted = false;
|
|
508
594
|
}
|
|
509
595
|
},
|
|
510
596
|
handleCollectorDomLoad: function handleCollectorDomLoad(ref) {
|
|
511
|
-
|
|
597
|
+
_this2._collectorDom = ref;
|
|
512
598
|
},
|
|
513
599
|
handleClose: function handleClose() {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
600
|
+
// this._close();
|
|
601
|
+
// this._isActive = false;
|
|
602
|
+
// this.unmount();
|
|
603
|
+
// console.log('whiteboard close');
|
|
517
604
|
},
|
|
518
605
|
handleOpen: function handleOpen() {
|
|
519
|
-
|
|
606
|
+
// console.log('whiteboard open');
|
|
607
|
+
// !this._initialized && this._open();
|
|
520
608
|
},
|
|
521
609
|
setPrivilege: function setPrivilege(canOperate) {
|
|
522
610
|
observables.canOperate = canOperate;
|
|
@@ -524,7 +612,10 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
524
612
|
setWriteEnable: function setWriteEnable(enable) {
|
|
525
613
|
observables.writeEnabled = enable;
|
|
526
614
|
observables.canOperate = enable;
|
|
527
|
-
|
|
615
|
+
_this2._repositionToolbar();
|
|
616
|
+
},
|
|
617
|
+
setWhiteboardVisible: function setWhiteboardVisible(visible) {
|
|
618
|
+
observables.whiteboardVisible = visible;
|
|
528
619
|
}
|
|
529
620
|
};
|
|
530
621
|
}
|
|
@@ -550,7 +641,7 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
550
641
|
thatStyle.transition = 'transform ease .5s';
|
|
551
642
|
var scaleValue = this._controlbarStore.scaleValue;
|
|
552
643
|
if (_utils.ZOOM_IN_CANVAS) {
|
|
553
|
-
this._boardMainWindow.setViewMode(
|
|
644
|
+
// this._boardMainWindow.setViewMode(ViewMode.Freedom);
|
|
554
645
|
}
|
|
555
646
|
this._resetScaleState();
|
|
556
647
|
if (oprate === _type.WhiteboardControlbarEvents.ZOOMIN) {
|
|
@@ -583,20 +674,20 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
583
674
|
if (!_utils.ZOOM_IN_CANVAS) {
|
|
584
675
|
thatStyle.transform = "scale(".concat(value, ")");
|
|
585
676
|
} else {
|
|
586
|
-
this._boardMainWindow.zoom(value);
|
|
677
|
+
// this._boardMainWindow.zoom(value);
|
|
587
678
|
}
|
|
588
679
|
}
|
|
589
680
|
}
|
|
590
681
|
}, {
|
|
591
682
|
key: "_resetCanvasPosition",
|
|
592
683
|
value: function _resetCanvasPosition() {
|
|
593
|
-
var
|
|
684
|
+
var _this3 = this;
|
|
594
685
|
if (this._timer) clearTimeout(this._timer);
|
|
595
686
|
this._timer = setTimeout(function () {
|
|
596
|
-
if (!
|
|
597
|
-
|
|
598
|
-
var thatStyle =
|
|
599
|
-
|
|
687
|
+
if (!_this3._boardDom) return;
|
|
688
|
+
_this3._repositionToolbar();
|
|
689
|
+
var thatStyle = _this3._boardDom.style;
|
|
690
|
+
_this3._controlbarStore.scaleValue = 1;
|
|
600
691
|
thatStyle.transform = "scale(1)";
|
|
601
692
|
}, 300);
|
|
602
693
|
}
|
|
@@ -618,7 +709,8 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
618
709
|
connectionState: this._connectionState,
|
|
619
710
|
joinSuccessed: this._joinSuccessed,
|
|
620
711
|
progress: 0,
|
|
621
|
-
writeEnabled: this._isHost
|
|
712
|
+
writeEnabled: this._isHost,
|
|
713
|
+
whiteboardVisible: false
|
|
622
714
|
});
|
|
623
715
|
return _objectSpread({
|
|
624
716
|
observables: observables
|
|
@@ -627,24 +719,24 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
627
719
|
}, {
|
|
628
720
|
key: "_createToolbarUIContext",
|
|
629
721
|
value: function _createToolbarUIContext() {
|
|
630
|
-
var
|
|
722
|
+
var _this4 = this;
|
|
631
723
|
var observables = this._toolbarStore.observables;
|
|
632
724
|
this._toolbarContext = {
|
|
633
725
|
observables: observables,
|
|
634
726
|
redo: function redo() {
|
|
635
|
-
var
|
|
636
|
-
return (
|
|
727
|
+
var _this4$_boardMainWind;
|
|
728
|
+
return (_this4$_boardMainWind = _this4._boardMainWindow) === null || _this4$_boardMainWind === void 0 ? void 0 : _this4$_boardMainWind.redo();
|
|
637
729
|
},
|
|
638
730
|
undo: function undo() {
|
|
639
|
-
var
|
|
640
|
-
return (
|
|
731
|
+
var _this4$_boardMainWind2;
|
|
732
|
+
return (_this4$_boardMainWind2 = _this4._boardMainWindow) === null || _this4$_boardMainWind2 === void 0 ? void 0 : _this4$_boardMainWind2.undo();
|
|
641
733
|
},
|
|
642
734
|
clean: function clean() {
|
|
643
|
-
var
|
|
644
|
-
return (
|
|
735
|
+
var _this4$_boardMainWind3;
|
|
736
|
+
return (_this4$_boardMainWind3 = _this4._boardMainWindow) === null || _this4$_boardMainWind3 === void 0 ? void 0 : _this4$_boardMainWind3.clean();
|
|
645
737
|
},
|
|
646
738
|
saveDraft: function saveDraft() {
|
|
647
|
-
return
|
|
739
|
+
return _this4._getSnapshotImage();
|
|
648
740
|
},
|
|
649
741
|
clickExpansionTool: function clickExpansionTool() {},
|
|
650
742
|
setToolbarPosition: function setToolbarPosition(pos) {
|
|
@@ -654,39 +746,43 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
654
746
|
return observables.toolbarReleased = false;
|
|
655
747
|
},
|
|
656
748
|
setTool: function setTool(tool) {
|
|
657
|
-
var
|
|
749
|
+
var _this4$_boardMainWind4;
|
|
658
750
|
observables.currentTool = tool;
|
|
659
751
|
observables.currentShape = undefined;
|
|
660
|
-
(
|
|
752
|
+
(_this4$_boardMainWind4 = _this4._boardMainWindow) === null || _this4$_boardMainWind4 === void 0 || _this4$_boardMainWind4.setToolType(tool);
|
|
661
753
|
},
|
|
662
754
|
setPen: function setPen(shape) {
|
|
663
|
-
var
|
|
755
|
+
var _this4$_boardMainWind5, _this4$_boardMainWind6, _this4$_boardMainWind7;
|
|
664
756
|
observables.currentShape = shape;
|
|
665
757
|
observables.lastPen = shape;
|
|
666
758
|
observables.currentTool = undefined;
|
|
667
|
-
(
|
|
759
|
+
(_this4$_boardMainWind5 = _this4._boardMainWindow) === null || _this4$_boardMainWind5 === void 0 || _this4$_boardMainWind5.setToolType(_this4._convertShapeToBoardToolType(shape));
|
|
760
|
+
(_this4$_boardMainWind6 = _this4._boardMainWindow) === null || _this4$_boardMainWind6 === void 0 || _this4$_boardMainWind6.setStrokeWidth(observables.currentStrokeWidth);
|
|
761
|
+
(_this4$_boardMainWind7 = _this4._boardMainWindow) === null || _this4$_boardMainWind7 === void 0 || _this4$_boardMainWind7.setStrokeColor((0, _tinycolor["default"])(observables.currentColor).toRgb());
|
|
668
762
|
},
|
|
669
763
|
setShape: function setShape(shape) {
|
|
670
|
-
var
|
|
764
|
+
var _this4$_boardMainWind8, _this4$_boardMainWind9, _this4$_boardMainWind10;
|
|
671
765
|
observables.currentShape = shape;
|
|
672
766
|
observables.lastShape = shape;
|
|
673
767
|
observables.currentTool = undefined;
|
|
674
|
-
(
|
|
768
|
+
(_this4$_boardMainWind8 = _this4._boardMainWindow) === null || _this4$_boardMainWind8 === void 0 || _this4$_boardMainWind8.setToolType(_this4._convertShapeToBoardToolType(shape));
|
|
769
|
+
(_this4$_boardMainWind9 = _this4._boardMainWindow) === null || _this4$_boardMainWind9 === void 0 || _this4$_boardMainWind9.setStrokeWidth(observables.currentStrokeWidth);
|
|
770
|
+
(_this4$_boardMainWind10 = _this4._boardMainWindow) === null || _this4$_boardMainWind10 === void 0 || _this4$_boardMainWind10.setStrokeColor((0, _tinycolor["default"])(observables.currentColor).toRgb());
|
|
675
771
|
},
|
|
676
772
|
setStrokeColor: function setStrokeColor(color) {
|
|
677
|
-
var
|
|
773
|
+
var _this4$_boardMainWind11;
|
|
678
774
|
observables.currentColor = color;
|
|
679
|
-
(
|
|
775
|
+
(_this4$_boardMainWind11 = _this4._boardMainWindow) === null || _this4$_boardMainWind11 === void 0 || _this4$_boardMainWind11.setStrokeColor((0, _tinycolor["default"])(color).toRgb());
|
|
680
776
|
},
|
|
681
777
|
setStrokeWidth: function setStrokeWidth(strokeWidth) {
|
|
682
|
-
var
|
|
778
|
+
var _this4$_boardMainWind12;
|
|
683
779
|
observables.currentStrokeWidth = strokeWidth;
|
|
684
|
-
(
|
|
780
|
+
(_this4$_boardMainWind12 = _this4._boardMainWindow) === null || _this4$_boardMainWind12 === void 0 || _this4$_boardMainWind12.setStrokeWidth(strokeWidth);
|
|
685
781
|
},
|
|
686
782
|
releaseToolbar: function releaseToolbar() {
|
|
687
783
|
observables.toolbarReleased = true;
|
|
688
|
-
|
|
689
|
-
|
|
784
|
+
_this4._updateDockPlacement();
|
|
785
|
+
_this4._repositionToolbar();
|
|
690
786
|
},
|
|
691
787
|
captureScreen: function captureScreen() {
|
|
692
788
|
var hideWindow = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
@@ -695,8 +791,9 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
695
791
|
});
|
|
696
792
|
},
|
|
697
793
|
setTheme: (0, _mobx.action)(function (theme) {
|
|
698
|
-
|
|
794
|
+
_this4._setBackgroundColor(theme.background);
|
|
699
795
|
observables.colors = theme.colors;
|
|
796
|
+
observables.currentThemeType = theme;
|
|
700
797
|
}),
|
|
701
798
|
setCommonColor: (0, _mobx.action)(function (color) {
|
|
702
799
|
if (observables.commonColors.length < 2) observables.commonColors.push(color);
|
|
@@ -807,7 +904,7 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
807
904
|
value: function _setBackgroundColor(bgColor) {
|
|
808
905
|
var _this$_whiteboardCont3;
|
|
809
906
|
var color = bgColor || 'white';
|
|
810
|
-
(_this$_whiteboardCont3 = this._whiteboardControl) === null || _this$_whiteboardCont3 === void 0 || _this$_whiteboardCont3.
|
|
907
|
+
(_this$_whiteboardCont3 = this._whiteboardControl) === null || _this$_whiteboardCont3 === void 0 || _this$_whiteboardCont3.setBackgroundColor(color);
|
|
811
908
|
}
|
|
812
909
|
}, {
|
|
813
910
|
key: "_updateRedo",
|
|
@@ -836,6 +933,7 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
836
933
|
value: function _open() {
|
|
837
934
|
var _this$_whiteboardCont4;
|
|
838
935
|
this._joined = true;
|
|
936
|
+
this._initialized = true;
|
|
839
937
|
(_this$_whiteboardCont4 = this._whiteboardControl) === null || _this$_whiteboardCont4 === void 0 || _this$_whiteboardCont4.open();
|
|
840
938
|
}
|
|
841
939
|
}, {
|
|
@@ -849,17 +947,48 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
849
947
|
}
|
|
850
948
|
}, {
|
|
851
949
|
key: "_getSnapshotImage",
|
|
852
|
-
value: function
|
|
853
|
-
var
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
950
|
+
value: function () {
|
|
951
|
+
var _getSnapshotImage2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
952
|
+
var _this5 = this;
|
|
953
|
+
var mainWindow, _this$_roomControl$ge, progress, imageData, fileName;
|
|
954
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
955
|
+
while (1) switch (_context.prev = _context.next) {
|
|
956
|
+
case 0:
|
|
957
|
+
mainWindow = this._boardMainWindow;
|
|
958
|
+
if (!mainWindow) {
|
|
959
|
+
_context.next = 11;
|
|
960
|
+
break;
|
|
961
|
+
}
|
|
962
|
+
progress = setInterval(function () {
|
|
963
|
+
if (_this5._boardStore && _this5._boardStore.observables.progress < 100) {
|
|
964
|
+
_this5._boardStore.observables.progress += 1;
|
|
965
|
+
} else {
|
|
966
|
+
clearInterval(progress);
|
|
967
|
+
}
|
|
968
|
+
}, 10);
|
|
969
|
+
_context.next = 5;
|
|
970
|
+
return mainWindow.getSnapshotImage();
|
|
971
|
+
case 5:
|
|
972
|
+
imageData = _context.sent;
|
|
973
|
+
this._boardStore.observables.progress = 100;
|
|
974
|
+
clearInterval(progress);
|
|
975
|
+
fileName = "".concat((_this$_roomControl$ge = this._roomControl.getRoomInfo()) === null || _this$_roomControl$ge === void 0 ? void 0 : _this$_roomControl$ge.roomName, "_").concat((0, _dayjs["default"])().format('YYYYMMDD_HHmmSSS'), ".jpg");
|
|
976
|
+
(0, _utils.downloadImageData)(imageData, fileName);
|
|
977
|
+
this._uiEventStore.showToast({
|
|
978
|
+
type: 'info',
|
|
979
|
+
message: (0, _i18n.transI18n)('fmt_screenshare_whiteboard_tips_savedsuccessfully')
|
|
980
|
+
});
|
|
981
|
+
case 11:
|
|
982
|
+
case "end":
|
|
983
|
+
return _context.stop();
|
|
859
984
|
}
|
|
860
|
-
});
|
|
985
|
+
}, _callee, this);
|
|
986
|
+
}));
|
|
987
|
+
function _getSnapshotImage() {
|
|
988
|
+
return _getSnapshotImage2.apply(this, arguments);
|
|
861
989
|
}
|
|
862
|
-
|
|
990
|
+
return _getSnapshotImage;
|
|
991
|
+
}()
|
|
863
992
|
}, {
|
|
864
993
|
key: "_openLonelyWindow",
|
|
865
994
|
value: function _openLonelyWindow() {
|
|
@@ -878,200 +1007,126 @@ var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/functio
|
|
|
878
1007
|
}, {
|
|
879
1008
|
key: "_boardObservble",
|
|
880
1009
|
value: function _boardObservble() {
|
|
881
|
-
var
|
|
882
|
-
return {
|
|
883
|
-
onJoinSuccess: function () {
|
|
884
|
-
var _onJoinSuccess = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(mainWindow) {
|
|
885
|
-
var _this7$_whiteboardCon2, _this7$_whiteboardCon, ownerUserId, ownerUser;
|
|
886
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
887
|
-
while (1) switch (_context.prev = _context.next) {
|
|
888
|
-
case 0:
|
|
889
|
-
_this7.logger.info('Fcr board join success');
|
|
890
|
-
if (_this7._whiteboardControl) {
|
|
891
|
-
_this7$_whiteboardCon = (_this7$_whiteboardCon2 = _this7._whiteboardControl) === null || _this7$_whiteboardCon2 === void 0 ? void 0 : _this7$_whiteboardCon2.getBoardActiveInfo(), ownerUserId = _this7$_whiteboardCon.ownerUserId;
|
|
892
|
-
ownerUser = _this7._userControl.getUser(ownerUserId);
|
|
893
|
-
_this7._controlbarStore.ownerUser = ownerUser;
|
|
894
|
-
}
|
|
895
|
-
_context.next = 4;
|
|
896
|
-
return mainWindow.updateOperationPrivilege(true);
|
|
897
|
-
case 4:
|
|
898
|
-
mainWindow.addObserver(_this7._MainWindowEvents(mainWindow));
|
|
899
|
-
_this7._boardMainWindow = mainWindow;
|
|
900
|
-
_this7.mount();
|
|
901
|
-
case 7:
|
|
902
|
-
case "end":
|
|
903
|
-
return _context.stop();
|
|
904
|
-
}
|
|
905
|
-
}, _callee);
|
|
906
|
-
}));
|
|
907
|
-
function onJoinSuccess(_x) {
|
|
908
|
-
return _onJoinSuccess.apply(this, arguments);
|
|
909
|
-
}
|
|
910
|
-
return onJoinSuccess;
|
|
911
|
-
}(),
|
|
912
|
-
onJoinFailure: function onJoinFailure(e) {
|
|
913
|
-
_this7.logger.error('Fcr board join failure', e);
|
|
914
|
-
_this7._uiEventStore.showToast({
|
|
915
|
-
message: (0, _i18n.transI18n)('fmt_screenshare_whiteboard_tips_cannotjoin'),
|
|
916
|
-
type: 'warn'
|
|
917
|
-
});
|
|
918
|
-
},
|
|
919
|
-
onConnectionStateUpdated: function onConnectionStateUpdated(state) {
|
|
920
|
-
_this7.logger.info('Fcr board connection state changed to', state);
|
|
921
|
-
_this7._setConnectionState(state);
|
|
922
|
-
if (state === _enums.FcrBoardRoomConnectionState.DISCONNECTED) {
|
|
923
|
-
if (_this7._joined) {
|
|
924
|
-
var _this7$_whiteboardCon3;
|
|
925
|
-
(_this7$_whiteboardCon3 = _this7._whiteboardControl) === null || _this7$_whiteboardCon3 === void 0 || _this7$_whiteboardCon3.open();
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
|
-
if (state === _enums.FcrBoardRoomConnectionState.CONNECTED) {
|
|
929
|
-
_this7._setJoinSuccessed(true);
|
|
930
|
-
}
|
|
931
|
-
},
|
|
932
|
-
onMemberStateChanged: function onMemberStateChanged(state) {
|
|
933
|
-
_this7.logger.info('Fcr board member state changed to', state);
|
|
934
|
-
},
|
|
935
|
-
onPermissionDeny: function onPermissionDeny() {}
|
|
936
|
-
};
|
|
937
|
-
}
|
|
938
|
-
}, {
|
|
939
|
-
key: "_MainWindowEvents",
|
|
940
|
-
value: function _MainWindowEvents(mainWindow) {
|
|
941
|
-
var _this8 = this;
|
|
1010
|
+
var _this6 = this;
|
|
942
1011
|
return {
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
var _onMountSuccess = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
947
|
-
var _this8$_whiteboardCon, _this8$_ownerUser, _this8$_localUser, _this8$_boardStore, _this8$_boardStore2, activeInfo;
|
|
1012
|
+
onConnectionStateUpdated: function () {
|
|
1013
|
+
var _onConnectionStateUpdated = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(state) {
|
|
1014
|
+
var _this6$_whiteboardCon, mainWindow, _this6$_whiteboardCon2, ownerUserId, ownerUser;
|
|
948
1015
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
949
1016
|
while (1) switch (_context2.prev = _context2.next) {
|
|
950
1017
|
case 0:
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
1018
|
+
_this6.logger.info('Fcr board connection state changed to', state);
|
|
1019
|
+
_this6._setConnectionState(state);
|
|
1020
|
+
if (state === _agoraEduCore.FcrConnectionState.DISCONNECTED) {
|
|
1021
|
+
if (_this6._joined) {
|
|
1022
|
+
(_this6$_whiteboardCon = _this6._whiteboardControl) === null || _this6$_whiteboardCon === void 0 || _this6$_whiteboardCon.open();
|
|
1023
|
+
} else {
|
|
1024
|
+
_this6.unmount();
|
|
1025
|
+
_this6.unload();
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
if (state === _agoraEduCore.FcrConnectionState.CONNECTED) {
|
|
1029
|
+
_this6._setJoinSuccessed(true);
|
|
1030
|
+
mainWindow = _this6._whiteboardControl.getMainWindow();
|
|
1031
|
+
_this6.logger.info('Fcr board join success');
|
|
1032
|
+
if (_this6._whiteboardControl) {
|
|
1033
|
+
_this6$_whiteboardCon2 = _this6._whiteboardControl.getBoardActiveInfo(), ownerUserId = _this6$_whiteboardCon2.ownerUserId;
|
|
1034
|
+
ownerUser = _this6._userControl.getUser(ownerUserId);
|
|
1035
|
+
_this6._controlbarStore.ownerUser = ownerUser;
|
|
1036
|
+
}
|
|
1037
|
+
mainWindow.addObserver({
|
|
1038
|
+
onRedoStateUpdated: _this6._updateRedo,
|
|
1039
|
+
onUndoStateUpdated: _this6._updateUndo
|
|
971
1040
|
});
|
|
1041
|
+
_this6._boardMainWindow = mainWindow;
|
|
1042
|
+
_this6.mount();
|
|
972
1043
|
}
|
|
973
|
-
case
|
|
1044
|
+
case 4:
|
|
974
1045
|
case "end":
|
|
975
1046
|
return _context2.stop();
|
|
976
1047
|
}
|
|
977
1048
|
}, _callee2);
|
|
978
1049
|
}));
|
|
979
|
-
function
|
|
980
|
-
return
|
|
1050
|
+
function onConnectionStateUpdated(_x) {
|
|
1051
|
+
return _onConnectionStateUpdated.apply(this, arguments);
|
|
981
1052
|
}
|
|
982
|
-
return
|
|
983
|
-
}()
|
|
984
|
-
onUnmount: function onUnmount() {
|
|
985
|
-
if (_this8._lonelyWindowState === _type.LonelyWindowState.OPEN) {
|
|
986
|
-
_this8._openLonelyWindow();
|
|
987
|
-
}
|
|
988
|
-
if (_this8._lonelyWindowState === _type.LonelyWindowState.CLOSE) {
|
|
989
|
-
_this8._open();
|
|
990
|
-
}
|
|
991
|
-
_this8._uiEventStore.sendEvent(_constant.UIAction.WHITEBOARD_CHANGED, {
|
|
992
|
-
action: _type.WhiteboardBaseEvents.SET_OWNER_USER_ID,
|
|
993
|
-
payload: null
|
|
994
|
-
});
|
|
995
|
-
(0, _rendererEvent.sendEvent)({
|
|
996
|
-
action: _constant.RendererEventAction.SET_OWNER_USER,
|
|
997
|
-
payload: null
|
|
998
|
-
});
|
|
999
|
-
_this8._ownerUser = null;
|
|
1000
|
-
_this8._initialized = false;
|
|
1001
|
-
},
|
|
1002
|
-
onSnapshotSuccess: function onSnapshotSuccess(canvas) {
|
|
1003
|
-
var _this8$_roomControl$g;
|
|
1004
|
-
var fileName = "".concat((_this8$_roomControl$g = _this8._roomControl.getRoomInfo()) === null || _this8$_roomControl$g === void 0 ? void 0 : _this8$_roomControl$g.roomName, "_").concat((0, _dayjs["default"])().format('YYYYMMDD_HHmmSSS'), ".jpg");
|
|
1005
|
-
(0, _utils.downloadCanvasImage)(canvas, fileName);
|
|
1006
|
-
_this8._uiEventStore.showToast({
|
|
1007
|
-
type: 'info',
|
|
1008
|
-
message: (0, _i18n.transI18n)('fmt_screenshare_whiteboard_tips_savedsuccessfully')
|
|
1009
|
-
});
|
|
1010
|
-
},
|
|
1011
|
-
onFailure: function onFailure(reason) {
|
|
1012
|
-
_this8.logger.error('operation failure, reason: ', reason);
|
|
1013
|
-
if (reason === _type.FcrBoardMainWindowFailureReason.ResourceWindowAlreadyOpened) {
|
|
1014
|
-
_this8._uiEventStore.showToast({
|
|
1015
|
-
type: 'error',
|
|
1016
|
-
message: (0, _i18n.transI18n)('fmt_screenshare_whiteboard_tips_failed')
|
|
1017
|
-
});
|
|
1018
|
-
}
|
|
1019
|
-
if (reason === _type.FcrBoardMainWindowFailureReason.SnapshotFailure) {
|
|
1020
|
-
_this8._uiEventStore.showToast({
|
|
1021
|
-
type: 'error',
|
|
1022
|
-
message: (0, _i18n.transI18n)('fmt_screenshare_whiteboard_tips_failed')
|
|
1023
|
-
});
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1053
|
+
return onConnectionStateUpdated;
|
|
1054
|
+
}()
|
|
1026
1055
|
};
|
|
1027
1056
|
}
|
|
1028
1057
|
}, {
|
|
1029
1058
|
key: "_addDisposers",
|
|
1030
1059
|
value: function _addDisposers() {
|
|
1031
|
-
var
|
|
1060
|
+
var _this7 = this;
|
|
1032
1061
|
this._disposers.push((0, _mobx.reaction)(function () {
|
|
1033
|
-
return
|
|
1062
|
+
return _this7.hasPrivilege;
|
|
1034
1063
|
}, function (privilege) {
|
|
1035
|
-
var
|
|
1036
|
-
var p = privilege ||
|
|
1037
|
-
(
|
|
1038
|
-
(
|
|
1064
|
+
var _this7$_boardStore, _this7$_boardStore2;
|
|
1065
|
+
var p = privilege || _this7._isHost || _this7._isMyBoard;
|
|
1066
|
+
(_this7$_boardStore = _this7._boardStore) === null || _this7$_boardStore === void 0 || _this7$_boardStore.setWriteEnable(_this7._isHost || _this7._isMyBoard);
|
|
1067
|
+
(_this7$_boardStore2 = _this7._boardStore) === null || _this7$_boardStore2 === void 0 || _this7$_boardStore2.setPrivilege(p);
|
|
1039
1068
|
}), (0, _mobx.reaction)(function () {
|
|
1040
|
-
return
|
|
1069
|
+
return _this7._boardStore.observables.writeEnabled;
|
|
1041
1070
|
}, function (writeEnabled) {
|
|
1042
|
-
if (writeEnabled) setTimeout(
|
|
1071
|
+
if (writeEnabled) setTimeout(_this7._repositionToolbar, 0);
|
|
1043
1072
|
}), (0, _mobx.reaction)(function () {
|
|
1044
|
-
return
|
|
1073
|
+
return _this7._localUser;
|
|
1045
1074
|
}, function (user) {
|
|
1046
|
-
var
|
|
1047
|
-
|
|
1048
|
-
var hasPrivilege =
|
|
1049
|
-
(
|
|
1050
|
-
|
|
1075
|
+
var _this7$_boardStore3;
|
|
1076
|
+
_this7._isHost = [_type2.FcrUserRole.HOST, _type2.FcrUserRole.COHOST].includes(user.userRole);
|
|
1077
|
+
var hasPrivilege = _this7.hasPrivilege || _this7._isHost || _this7._isMyBoard;
|
|
1078
|
+
(_this7$_boardStore3 = _this7._boardStore) === null || _this7$_boardStore3 === void 0 || _this7$_boardStore3.setPrivilege(hasPrivilege);
|
|
1079
|
+
_this7._boardStore.setWriteEnable(_this7._isHost || _this7._isMyBoard);
|
|
1051
1080
|
}));
|
|
1052
1081
|
}
|
|
1053
1082
|
}, {
|
|
1054
1083
|
key: "_alertWhenReplace",
|
|
1055
1084
|
value: function _alertWhenReplace(userInfo) {
|
|
1056
|
-
var
|
|
1085
|
+
var _this8 = this;
|
|
1057
1086
|
var userRole = userInfo.userRole,
|
|
1058
1087
|
userName = userInfo.userName;
|
|
1059
1088
|
var dialogId = this._uiEventStore.openConfirmDialog({
|
|
1060
1089
|
title: (0, _i18n.transI18n)('fmt_screenshare_whiteboard_tips_stoppedboard'),
|
|
1061
1090
|
content: (_type2.FcrUserRole.HOST === userRole ? (0, _i18n.transI18n)('fmt_role_host') : _type2.FcrUserRole.COHOST === userRole ? (0, _i18n.transI18n)('fmt_role_cohost') : '') + "".concat(userName, " ").concat((0, _i18n.transI18n)('fmt_screenshare_whiteboard_lables_newshare')),
|
|
1062
1091
|
okText: (0, _i18n.transI18n)('fmt_screenshare_whiteboard_button_gotit'),
|
|
1092
|
+
showCancel: false,
|
|
1093
|
+
icon: _type4.FcrIconType.FCR_SCREENSHARING,
|
|
1063
1094
|
onOk: function onOk() {
|
|
1064
|
-
|
|
1095
|
+
_this8._uiEventStore.closeDialog(dialogId);
|
|
1065
1096
|
},
|
|
1066
1097
|
onCancel: function onCancel() {
|
|
1067
|
-
|
|
1098
|
+
_this8._uiEventStore.closeDialog(dialogId);
|
|
1068
1099
|
}
|
|
1069
1100
|
});
|
|
1070
1101
|
}
|
|
1102
|
+
}, {
|
|
1103
|
+
key: "_convertShapeToBoardToolType",
|
|
1104
|
+
value: function _convertShapeToBoardToolType(shape) {
|
|
1105
|
+
switch (shape) {
|
|
1106
|
+
case _enums.FcrBoardShape.Arrow:
|
|
1107
|
+
return _enums.FcrBoardToolType.ARROW;
|
|
1108
|
+
case _enums.FcrBoardShape.Curve:
|
|
1109
|
+
return _enums.FcrBoardToolType.CURVE;
|
|
1110
|
+
case _enums.FcrBoardShape.Ellipse:
|
|
1111
|
+
return _enums.FcrBoardToolType.ELLIPSE;
|
|
1112
|
+
case _enums.FcrBoardShape.Pentagram:
|
|
1113
|
+
return _enums.FcrBoardToolType.PENTAGRAM;
|
|
1114
|
+
case _enums.FcrBoardShape.Rectangle:
|
|
1115
|
+
return _enums.FcrBoardToolType.RECTANGLE;
|
|
1116
|
+
case _enums.FcrBoardShape.Rhombus:
|
|
1117
|
+
return _enums.FcrBoardToolType.RHOMBUS;
|
|
1118
|
+
case _enums.FcrBoardShape.Straight:
|
|
1119
|
+
return _enums.FcrBoardToolType.STRAIGHT;
|
|
1120
|
+
case _enums.FcrBoardShape.Triangle:
|
|
1121
|
+
return _enums.FcrBoardToolType.TRIANGLE;
|
|
1122
|
+
default:
|
|
1123
|
+
return _enums.FcrBoardToolType.NONE;
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1071
1126
|
}]);
|
|
1072
1127
|
}(_base.UIModule);
|
|
1073
1128
|
_FcrWhiteboardUIModule = FcrWhiteboardUIModule;
|
|
1074
|
-
var _applyDecs$e = _applyDecs(_FcrWhiteboardUIModule, [[_mobx.observable, 1, "_lonelyWindowState"], [_mobx.observable, 1, "_ownerUser"], [_mobx.observable, 1, "_isHost"], [_mobx.observable, 1, "_boardBackground"], [_mobx.observable, 1, "_localUser"], [_mobx.computed, 3, "hasPrivilege"], [_decorator.bound, 2, "onProcessEvent"], [_onPropertiesUpdateDecs, 18, "onPropertiesUpdate"], [_mountDecs, 18, "mount"], [_unmountDecs, 18, "unmount"], [_unloadDecs, 18, "unload"], [_boardUIEventsDecs, 18, "_boardUIEvents"], [_decorator.bound, 2, "_setCanvasBound"], [_decorator.bound, 2, "_resetCanvasPosition"], [_createToolbarUIContextDecs, 18, "_createToolbarUIContext"], [_decorator.bound, 2, "_updateDockPosition"], [_decorator.bound, 2, "_updateDockPlacement"], [_repositionToolbarDecs, 18, "_repositionToolbar"], [_decorator.bound, 2, "_updateMaxVisibleTools"], [_decorator.bound, 2, "_setBackgroundColor"], [_updateRedoDecs, 18, "_updateRedo"], [_updateUndoDecs, 18, "_updateUndo"], [_setConnectionStateDecs, 18, "_setConnectionState"], [_decorator.bound, 2, "_close"], [_getSnapshotImageDecs, 18, "_getSnapshotImage"], [_openLonelyWindowDecs, 18, "_openLonelyWindow"], [_setJoinSuccessedDecs, 18, "_setJoinSuccessed"]
|
|
1129
|
+
var _applyDecs$e = _applyDecs(_FcrWhiteboardUIModule, [[_mobx.observable, 1, "_lonelyWindowState"], [_mobx.observable, 1, "_ownerUser"], [_mobx.observable, 1, "_isHost"], [_mobx.observable, 1, "_boardBackground"], [_mobx.observable, 1, "_localUser"], [_mobx.computed, 3, "hasPrivilege"], [_decorator.bound, 2, "onProcessEvent"], [_onPropertiesUpdateDecs, 18, "onPropertiesUpdate"], [_mountDecs, 18, "mount"], [_unmountDecs, 18, "unmount"], [_unloadDecs, 18, "unload"], [_boardUIEventsDecs, 18, "_boardUIEvents"], [_decorator.bound, 2, "_setCanvasBound"], [_decorator.bound, 2, "_resetCanvasPosition"], [_createToolbarUIContextDecs, 18, "_createToolbarUIContext"], [_decorator.bound, 2, "_updateDockPosition"], [_decorator.bound, 2, "_updateDockPlacement"], [_repositionToolbarDecs, 18, "_repositionToolbar"], [_decorator.bound, 2, "_updateMaxVisibleTools"], [_decorator.bound, 2, "_setBackgroundColor"], [_updateRedoDecs, 18, "_updateRedo"], [_updateUndoDecs, 18, "_updateUndo"], [_setConnectionStateDecs, 18, "_setConnectionState"], [_decorator.bound, 2, "_close"], [_getSnapshotImageDecs, 18, "_getSnapshotImage"], [_openLonelyWindowDecs, 18, "_openLonelyWindow"], [_setJoinSuccessedDecs, 18, "_setJoinSuccessed"]], [], 0, void 0, _base.UIModule).e;
|
|
1075
1130
|
var _applyDecs$e2 = (0, _slicedToArray2["default"])(_applyDecs$e, 6);
|
|
1076
1131
|
_init__lonelyWindowState = _applyDecs$e2[0];
|
|
1077
1132
|
_init__ownerUser = _applyDecs$e2[1];
|