fcr-ui-scene-mobile 3.4.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/lib/assets/ground_glass_bg.png +0 -0
- package/lib/base.d.ts +11 -0
- package/lib/base.js +39 -0
- package/lib/common/device-store.d.ts +86 -0
- package/lib/common/device-store.js +642 -0
- package/lib/common/device-stream-store.d.ts +26 -0
- package/lib/common/device-stream-store.js +298 -0
- package/lib/common/event-store.d.ts +124 -0
- package/lib/common/event-store.js +249 -0
- package/lib/common/global-context.d.ts +11 -0
- package/lib/common/global-context.js +9 -0
- package/lib/common/member-list-data-source.d.ts +28 -0
- package/lib/common/member-list-data-source.js +305 -0
- package/lib/common/participant-store.d.ts +195 -0
- package/lib/common/participant-store.js +1577 -0
- package/lib/common/security-store.d.ts +119 -0
- package/lib/common/security-store.js +948 -0
- package/lib/common/setting-store.d.ts +181 -0
- package/lib/common/setting-store.js +797 -0
- package/lib/common/type.d.ts +73 -0
- package/lib/common/type.js +22 -0
- package/lib/config/default-config.d.ts +32 -0
- package/lib/config/default-config.js +39 -0
- package/lib/config/setting-config.d.ts +16 -0
- package/lib/config/setting-config.js +17 -0
- package/lib/creator.d.ts +10 -0
- package/lib/creator.js +49 -0
- package/lib/global.d.ts +8 -0
- package/lib/hooks/meeting-time.d.ts +15 -0
- package/lib/hooks/meeting-time.js +92 -0
- package/lib/hooks/useIsNodePresent.d.ts +4 -0
- package/lib/hooks/useIsNodePresent.js +53 -0
- package/lib/hooks/useOnRefMount.d.ts +2 -0
- package/lib/hooks/useOnRefMount.js +27 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +50 -0
- package/lib/mobile-global.css +28 -0
- package/lib/modules/action-bar/bottom-icons.d.ts +17 -0
- package/lib/modules/action-bar/bottom-icons.js +160 -0
- package/lib/modules/action-bar/context.d.ts +2 -0
- package/lib/modules/action-bar/context.js +9 -0
- package/lib/modules/action-bar/index.css +33 -0
- package/lib/modules/action-bar/index.d.ts +27 -0
- package/lib/modules/action-bar/index.js +46 -0
- package/lib/modules/action-bar/member-list-popup/attendee/index.css +130 -0
- package/lib/modules/action-bar/member-list-popup/attendee/index.d.ts +19 -0
- package/lib/modules/action-bar/member-list-popup/attendee/index.js +252 -0
- package/lib/modules/action-bar/member-list-popup/attendee/list.d.ts +1 -0
- package/lib/modules/action-bar/member-list-popup/attendee/list.js +82 -0
- package/lib/modules/action-bar/member-list-popup/index.css +35 -0
- package/lib/modules/action-bar/member-list-popup/index.d.ts +7 -0
- package/lib/modules/action-bar/member-list-popup/index.js +40 -0
- package/lib/modules/action-bar/member-list-popup/participant-more-actions/index.css +0 -0
- package/lib/modules/action-bar/member-list-popup/participant-more-actions/index.d.ts +12 -0
- package/lib/modules/action-bar/member-list-popup/participant-more-actions/index.js +58 -0
- package/lib/modules/action-bar/more-popup/index.css +71 -0
- package/lib/modules/action-bar/more-popup/index.d.ts +2 -0
- package/lib/modules/action-bar/more-popup/index.js +126 -0
- package/lib/modules/action-bar/store.d.ts +196 -0
- package/lib/modules/action-bar/store.js +1425 -0
- package/lib/modules/action-bar/type.d.ts +6 -0
- package/lib/modules/action-bar/type.js +13 -0
- package/lib/modules/action-bar/view.d.ts +2 -0
- package/lib/modules/action-bar/view.js +75 -0
- package/lib/modules/audio-stream/ index.d.ts +19 -0
- package/lib/modules/audio-stream/ index.js +109 -0
- package/lib/modules/audio-stream/index.d.ts +25 -0
- package/lib/modules/audio-stream/index.js +135 -0
- package/lib/modules/chat/chat-bar/index.css +97 -0
- package/lib/modules/chat/chat-bar/index.d.ts +12 -0
- package/lib/modules/chat/chat-bar/index.js +129 -0
- package/lib/modules/chat/chat-notification/index.css +71 -0
- package/lib/modules/chat/chat-notification/index.d.ts +3 -0
- package/lib/modules/chat/chat-notification/index.js +75 -0
- package/lib/modules/chat/chat-select/index.css +183 -0
- package/lib/modules/chat/chat-select/index.d.ts +12 -0
- package/lib/modules/chat/chat-select/index.js +223 -0
- package/lib/modules/chat/contex.d.ts +2 -0
- package/lib/modules/chat/contex.js +9 -0
- package/lib/modules/chat/demo-wrapper.d.ts +1 -0
- package/lib/modules/chat/demo-wrapper.js +42 -0
- package/lib/modules/chat/index.css +108 -0
- package/lib/modules/chat/index.d.ts +28 -0
- package/lib/modules/chat/index.dev.d.ts +1 -0
- package/lib/modules/chat/index.dev.js +58 -0
- package/lib/modules/chat/index.js +208 -0
- package/lib/modules/chat/message-list.d.ts +22 -0
- package/lib/modules/chat/message-list.js +617 -0
- package/lib/modules/chat/mock.d.ts +2 -0
- package/lib/modules/chat/mock.js +283 -0
- package/lib/modules/chat/store.d.ts +183 -0
- package/lib/modules/chat/store.js +1101 -0
- package/lib/modules/chat/util.d.ts +6 -0
- package/lib/modules/chat/util.js +69 -0
- package/lib/modules/chat/view.d.ts +11 -0
- package/lib/modules/chat/view.js +414 -0
- package/lib/modules/layout/bottom-drawer/index.css +34 -0
- package/lib/modules/layout/bottom-drawer/index.d.ts +3 -0
- package/lib/modules/layout/bottom-drawer/index.js +129 -0
- package/lib/modules/layout/components/Layout.d.ts +1 -0
- package/lib/modules/layout/components/Layout.js +98 -0
- package/lib/modules/layout/components/equip-request-popup/index.css +30 -0
- package/lib/modules/layout/components/equip-request-popup/index.d.ts +3 -0
- package/lib/modules/layout/components/equip-request-popup/index.js +78 -0
- package/lib/modules/layout/components/index.css +78 -0
- package/lib/modules/layout/components/index.d.ts +2 -0
- package/lib/modules/layout/components/index.js +25 -0
- package/lib/modules/layout/context.d.ts +2 -0
- package/lib/modules/layout/context.js +9 -0
- package/lib/modules/layout/drawer-header/index.css +27 -0
- package/lib/modules/layout/drawer-header/index.d.ts +10 -0
- package/lib/modules/layout/drawer-header/index.js +54 -0
- package/lib/modules/layout/index.css +22 -0
- package/lib/modules/layout/index.d.ts +8 -0
- package/lib/modules/layout/index.js +47 -0
- package/lib/modules/layout/store.d.ts +59 -0
- package/lib/modules/layout/store.js +379 -0
- package/lib/modules/layout/type.d.ts +65 -0
- package/lib/modules/layout/type.js +52 -0
- package/lib/modules/layout/view.d.ts +2 -0
- package/lib/modules/layout/view.js +10 -0
- package/lib/modules/member-layout/context.d.ts +2 -0
- package/lib/modules/member-layout/context.js +9 -0
- package/lib/modules/member-layout/data.d.ts +2 -0
- package/lib/modules/member-layout/data.js +304 -0
- package/lib/modules/member-layout/grid/index.css +98 -0
- package/lib/modules/member-layout/grid/index.d.ts +21 -0
- package/lib/modules/member-layout/grid/index.js +316 -0
- package/lib/modules/member-layout/index.css +88 -0
- package/lib/modules/member-layout/index.d.ts +8 -0
- package/lib/modules/member-layout/index.js +45 -0
- package/lib/modules/member-layout/share-toast/index.css +30 -0
- package/lib/modules/member-layout/share-toast/index.d.ts +5 -0
- package/lib/modules/member-layout/share-toast/index.js +43 -0
- package/lib/modules/member-layout/speaker/index.css +30 -0
- package/lib/modules/member-layout/speaker/index.d.ts +9 -0
- package/lib/modules/member-layout/speaker/index.js +28 -0
- package/lib/modules/member-layout/store.d.ts +70 -0
- package/lib/modules/member-layout/store.js +479 -0
- package/lib/modules/member-layout/user/index.css +121 -0
- package/lib/modules/member-layout/user/index.d.ts +34 -0
- package/lib/modules/member-layout/user/index.js +355 -0
- package/lib/modules/member-layout/user/types.d.ts +16 -0
- package/lib/modules/member-layout/user/types.js +6 -0
- package/lib/modules/member-layout/view.d.ts +2 -0
- package/lib/modules/member-layout/view.js +225 -0
- package/lib/modules/state-bar/context.d.ts +2 -0
- package/lib/modules/state-bar/context.js +9 -0
- package/lib/modules/state-bar/index.css +79 -0
- package/lib/modules/state-bar/index.d.ts +17 -0
- package/lib/modules/state-bar/index.js +55 -0
- package/lib/modules/state-bar/leaving-room/index.css +14 -0
- package/lib/modules/state-bar/leaving-room/index.d.ts +7 -0
- package/lib/modules/state-bar/leaving-room/index.js +38 -0
- package/lib/modules/state-bar/meeting-detail/index.css +72 -0
- package/lib/modules/state-bar/meeting-detail/index.d.ts +2 -0
- package/lib/modules/state-bar/meeting-detail/index.js +59 -0
- package/lib/modules/state-bar/meeting-detail/meeting-info/copy.d.ts +4 -0
- package/lib/modules/state-bar/meeting-detail/meeting-info/copy.js +81 -0
- package/lib/modules/state-bar/meeting-detail/meeting-info/index.css +92 -0
- package/lib/modules/state-bar/meeting-detail/meeting-info/index.d.ts +2 -0
- package/lib/modules/state-bar/meeting-detail/meeting-info/index.js +188 -0
- package/lib/modules/state-bar/meeting-detail/net-quality/index.css +27 -0
- package/lib/modules/state-bar/meeting-detail/net-quality/index.d.ts +2 -0
- package/lib/modules/state-bar/meeting-detail/net-quality/index.js +87 -0
- package/lib/modules/state-bar/store.d.ts +76 -0
- package/lib/modules/state-bar/store.js +561 -0
- package/lib/modules/state-bar/view.d.ts +7 -0
- package/lib/modules/state-bar/view.js +215 -0
- package/lib/modules/whiteboard/app.d.ts +2 -0
- package/lib/modules/whiteboard/app.js +41 -0
- package/lib/modules/whiteboard/components/control-bar/index.css +53 -0
- package/lib/modules/whiteboard/components/control-bar/index.d.ts +2 -0
- package/lib/modules/whiteboard/components/control-bar/index.js +156 -0
- package/lib/modules/whiteboard/components/control-bar/store.d.ts +35 -0
- package/lib/modules/whiteboard/components/control-bar/store.js +288 -0
- package/lib/modules/whiteboard/components/loading/index.css +76 -0
- package/lib/modules/whiteboard/components/loading/index.d.ts +2 -0
- package/lib/modules/whiteboard/components/loading/index.js +68 -0
- package/lib/modules/whiteboard/components/loading/loading.png +0 -0
- package/lib/modules/whiteboard/components/multi-window/index.css +65 -0
- package/lib/modules/whiteboard/components/multi-window/index.d.ts +5 -0
- package/lib/modules/whiteboard/components/multi-window/index.js +39 -0
- package/lib/modules/whiteboard/components/pagination/index.css +228 -0
- package/lib/modules/whiteboard/components/pagination/index.d.ts +15 -0
- package/lib/modules/whiteboard/components/pagination/index.js +163 -0
- package/lib/modules/whiteboard/components/pagination/store.d.ts +18 -0
- package/lib/modules/whiteboard/components/pagination/store.js +17 -0
- package/lib/modules/whiteboard/components/progress/index.d.ts +5 -0
- package/lib/modules/whiteboard/components/progress/index.js +43 -0
- package/lib/modules/whiteboard/components/progress/style.css +52 -0
- package/lib/modules/whiteboard/components/scene-pagination.d.ts +1 -0
- package/lib/modules/whiteboard/components/scene-pagination.js +30 -0
- package/lib/modules/whiteboard/components/switch-theme/index.css +98 -0
- package/lib/modules/whiteboard/components/switch-theme/index.d.ts +3 -0
- package/lib/modules/whiteboard/components/switch-theme/index.js +89 -0
- package/lib/modules/whiteboard/components/switch-theme/item.d.ts +9 -0
- package/lib/modules/whiteboard/components/switch-theme/item.js +53 -0
- package/lib/modules/whiteboard/components/switch-theme/libs.d.ts +4 -0
- package/lib/modules/whiteboard/components/switch-theme/libs.js +29 -0
- package/lib/modules/whiteboard/components/toolbar/ style.css +588 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/color.d.ts +5 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/color.js +38 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/panel.d.ts +1 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/panel.js +107 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/picker.d.ts +1 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/picker.js +59 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/index.d.ts +2 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/index.js +44 -0
- package/lib/modules/whiteboard/components/toolbar/components/eraser-picker.d.ts +4 -0
- package/lib/modules/whiteboard/components/toolbar/components/eraser-picker.js +89 -0
- package/lib/modules/whiteboard/components/toolbar/components/extra-tool-picker.d.ts +1 -0
- package/lib/modules/whiteboard/components/toolbar/components/extra-tool-picker.js +63 -0
- package/lib/modules/whiteboard/components/toolbar/components/history.d.ts +2 -0
- package/lib/modules/whiteboard/components/toolbar/components/history.js +46 -0
- package/lib/modules/whiteboard/components/toolbar/components/icons/fold-icon.d.ts +2 -0
- package/lib/modules/whiteboard/components/toolbar/components/icons/fold-icon.js +39 -0
- package/lib/modules/whiteboard/components/toolbar/components/icons/move-icon.d.ts +1 -0
- package/lib/modules/whiteboard/components/toolbar/components/icons/move-icon.js +66 -0
- package/lib/modules/whiteboard/components/toolbar/components/move-handle.d.ts +5 -0
- package/lib/modules/whiteboard/components/toolbar/components/move-handle.js +134 -0
- package/lib/modules/whiteboard/components/toolbar/components/pen-picker.d.ts +4 -0
- package/lib/modules/whiteboard/components/toolbar/components/pen-picker.js +106 -0
- package/lib/modules/whiteboard/components/toolbar/components/shape-picker.d.ts +4 -0
- package/lib/modules/whiteboard/components/toolbar/components/shape-picker.js +168 -0
- package/lib/modules/whiteboard/components/toolbar/hooks/index.d.ts +14 -0
- package/lib/modules/whiteboard/components/toolbar/hooks/index.js +211 -0
- package/lib/modules/whiteboard/components/toolbar/index.d.ts +2 -0
- package/lib/modules/whiteboard/components/toolbar/index.js +183 -0
- package/lib/modules/whiteboard/components/toolbar/store.d.ts +51 -0
- package/lib/modules/whiteboard/components/toolbar/store.js +248 -0
- package/lib/modules/whiteboard/context.d.ts +69 -0
- package/lib/modules/whiteboard/context.js +36 -0
- package/lib/modules/whiteboard/index.d.ts +119 -0
- package/lib/modules/whiteboard/index.js +1134 -0
- package/lib/modules/whiteboard/style.css +143 -0
- package/lib/modules/whiteboard/type.d.ts +94 -0
- package/lib/modules/whiteboard/type.js +89 -0
- package/lib/modules/whiteboard/utils.d.ts +12 -0
- package/lib/modules/whiteboard/utils.js +36 -0
- package/lib/plugins/css-preset-plugin.d.ts +1 -0
- package/lib/plugins/css-preset-plugin.js +29 -0
- package/lib/plugins/module-dev-plugin.d.ts +12 -0
- package/lib/plugins/module-dev-plugin.js +183 -0
- package/lib/plugins/multi-lang-plugin.d.ts +1 -0
- package/lib/plugins/multi-lang-plugin.js +19 -0
- package/lib/plugins/rtm-plugin.d.ts +1 -0
- package/lib/plugins/rtm-plugin.js +5 -0
- package/lib/plugins/web-rtc-plugin.d.ts +1 -0
- package/lib/plugins/web-rtc-plugin.js +5 -0
- package/lib/translations/enUS.d.ts +1855 -0
- package/lib/translations/enUS.js +1895 -0
- package/lib/translations/zhCN.d.ts +1852 -0
- package/lib/translations/zhCN.js +1892 -0
- package/lib/type.d.ts +121 -0
- package/lib/type.js +46 -0
- package/lib/ui-manager.d.ts +32 -0
- package/lib/ui-manager.js +426 -0
- package/lib/ui-scene.d.ts +14 -0
- package/lib/ui-scene.js +141 -0
- package/lib/utilities/board-context.d.ts +4 -0
- package/lib/utilities/board-context.js +12 -0
- package/lib/utilities/constant.d.ts +286 -0
- package/lib/utilities/constant.js +271 -0
- package/lib/utilities/copyText.d.ts +2 -0
- package/lib/utilities/copyText.js +43 -0
- package/lib/utilities/extract.d.ts +5 -0
- package/lib/utilities/extract.js +117 -0
- package/lib/utilities/hooks.d.ts +14 -0
- package/lib/utilities/hooks.js +101 -0
- package/lib/utilities/mute-action.d.ts +4 -0
- package/lib/utilities/mute-action.js +48 -0
- package/lib/utilities/parameters.d.ts +7 -0
- package/lib/utilities/parameters.js +20 -0
- package/lib/utilities/regex.d.ts +1 -0
- package/lib/utilities/regex.js +14 -0
- package/lib/utilities/tools.d.ts +27 -0
- package/lib/utilities/tools.js +169 -0
- package/lib/utilities/useNamespace.d.ts +15 -0
- package/lib/utilities/useNamespace.js +66 -0
- package/package.json +63 -0
|
@@ -0,0 +1,1134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.symbol.js");
|
|
4
|
+
require("core-js/modules/es.symbol.description.js");
|
|
5
|
+
require("core-js/modules/es.symbol.to-primitive.js");
|
|
6
|
+
require("core-js/modules/es.error.cause.js");
|
|
7
|
+
require("core-js/modules/es.error.to-string.js");
|
|
8
|
+
require("core-js/modules/es.array.filter.js");
|
|
9
|
+
require("core-js/modules/es.array.is-array.js");
|
|
10
|
+
require("core-js/modules/es.date.to-primitive.js");
|
|
11
|
+
require("core-js/modules/es.function.name.js");
|
|
12
|
+
require("core-js/modules/es.map.js");
|
|
13
|
+
require("core-js/modules/es.number.constructor.js");
|
|
14
|
+
require("core-js/modules/es.object.create.js");
|
|
15
|
+
require("core-js/modules/es.object.define-properties.js");
|
|
16
|
+
require("core-js/modules/es.object.define-property.js");
|
|
17
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
18
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
19
|
+
require("core-js/modules/es.object.keys.js");
|
|
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");
|
|
39
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
40
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
41
|
+
Object.defineProperty(exports, "__esModule", {
|
|
42
|
+
value: true
|
|
43
|
+
});
|
|
44
|
+
exports.FcrWhiteboardUIModule = void 0;
|
|
45
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
46
|
+
require("core-js/modules/es.array.concat.js");
|
|
47
|
+
require("core-js/modules/es.array.find.js");
|
|
48
|
+
require("core-js/modules/es.array.for-each.js");
|
|
49
|
+
require("core-js/modules/es.array.includes.js");
|
|
50
|
+
require("core-js/modules/es.array.iterator.js");
|
|
51
|
+
require("core-js/modules/es.array.push.js");
|
|
52
|
+
require("core-js/modules/es.array.some.js");
|
|
53
|
+
require("core-js/modules/es.function.bind.js");
|
|
54
|
+
require("core-js/modules/es.object.assign.js");
|
|
55
|
+
require("core-js/modules/es.object.to-string.js");
|
|
56
|
+
require("core-js/modules/es.object.values.js");
|
|
57
|
+
require("core-js/modules/es.set.js");
|
|
58
|
+
require("core-js/modules/es.string.includes.js");
|
|
59
|
+
require("core-js/modules/es.string.iterator.js");
|
|
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");
|
|
93
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
94
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
95
|
+
require("core-js/modules/web.timers.js");
|
|
96
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
97
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
98
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
99
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
100
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
101
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
102
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
103
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
104
|
+
var _type = require("./type");
|
|
105
|
+
var _app = require("./app");
|
|
106
|
+
var _context3 = require("./context");
|
|
107
|
+
var _mobx = require("mobx");
|
|
108
|
+
var _utils = require("./utils");
|
|
109
|
+
var _decorator = require("agora-foundation/lib/decorator");
|
|
110
|
+
var _tinycolor = _interopRequireDefault(require("tinycolor2"));
|
|
111
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
112
|
+
var _multiWindow = require("./components/multi-window");
|
|
113
|
+
var _constant = require("../../utilities/constant");
|
|
114
|
+
var _store = require("./components/toolbar/store");
|
|
115
|
+
var _base = require("../../base");
|
|
116
|
+
var _store2 = require("./components/control-bar/store");
|
|
117
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
118
|
+
var _type2 = require("fcr-core/lib/type");
|
|
119
|
+
var _fcrCore = require("fcr-core");
|
|
120
|
+
var _enums = require("fcr-core/lib/room-control/whiteboard-control/enums");
|
|
121
|
+
var _libs = _interopRequireDefault(require("./components/switch-theme/libs"));
|
|
122
|
+
var _types = require("fcr-core/lib/room-control/whiteboard-control/types");
|
|
123
|
+
var _i18n = require("agora-ui-foundation/lib/i18n");
|
|
124
|
+
var _type3 = require("agora-ui-foundation/lib/components/icon/type");
|
|
125
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
126
|
+
var _FcrWhiteboardUIModule;
|
|
127
|
+
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; // import { sendEvent } from '../../utilities/renderer-event';
|
|
128
|
+
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; }
|
|
129
|
+
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; }
|
|
130
|
+
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)); }
|
|
131
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
132
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
133
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
134
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
135
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
136
|
+
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"); }
|
|
137
|
+
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function set(e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O["static"] = l, O["private"] = f, f ? 2 === o ? k = function k(e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) { return e[n]; }, (o < 2 || 4 === o) && (F = function F(e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == _typeof(P) && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol["for"]("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol["for"]("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function s(t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
138
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
139
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
140
|
+
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; }
|
|
141
|
+
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; }
|
|
142
|
+
var _A = /*#__PURE__*/new WeakMap();
|
|
143
|
+
var _B = /*#__PURE__*/new WeakMap();
|
|
144
|
+
var _C = /*#__PURE__*/new WeakMap();
|
|
145
|
+
var _D = /*#__PURE__*/new WeakMap();
|
|
146
|
+
var _E = /*#__PURE__*/new WeakMap();
|
|
147
|
+
_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");
|
|
148
|
+
var FcrWhiteboardUIModule = exports.FcrWhiteboardUIModule = /*#__PURE__*/function (_UIModule) {
|
|
149
|
+
function FcrWhiteboardUIModule(_ref2) {
|
|
150
|
+
var _this;
|
|
151
|
+
var uiEventStore = _ref2.uiEventStore,
|
|
152
|
+
userControl = _ref2.userControl,
|
|
153
|
+
roomControl = _ref2.roomControl,
|
|
154
|
+
whiteboardControl = _ref2.whiteboardControl,
|
|
155
|
+
streamControl = _ref2.streamControl,
|
|
156
|
+
securityStore = _ref2.securityStore;
|
|
157
|
+
(0, _classCallCheck2["default"])(this, FcrWhiteboardUIModule);
|
|
158
|
+
_this = _callSuper(this, FcrWhiteboardUIModule);
|
|
159
|
+
//@ts-ignore
|
|
160
|
+
(0, _defineProperty2["default"])(_this, _ref, (_initProto(_this), []));
|
|
161
|
+
(0, _defineProperty2["default"])(_this, "_connectionState", _fcrCore.FcrConnectionState.DISCONNECTED);
|
|
162
|
+
(0, _defineProperty2["default"])(_this, "_defaultBoardState", {
|
|
163
|
+
tool: _enums.FcrBoardToolType.LASER_POINTER,
|
|
164
|
+
strokeColor: '#fed130',
|
|
165
|
+
strokeWidth: 2
|
|
166
|
+
});
|
|
167
|
+
(0, _defineProperty2["default"])(_this, "_initWidth", 1920);
|
|
168
|
+
(0, _defineProperty2["default"])(_this, "_initHeight", 1220);
|
|
169
|
+
(0, _defineProperty2["default"])(_this, "_joinSuccessed", false);
|
|
170
|
+
(0, _defineProperty2["default"])(_this, "_isActive", false);
|
|
171
|
+
(0, _defineProperty2["default"])(_this, "_timer", null);
|
|
172
|
+
(0, _defineProperty2["default"])(_this, "_isMyBoard", false);
|
|
173
|
+
(0, _defineProperty2["default"])(_this, "_t", function (_t) {
|
|
174
|
+
return '';
|
|
175
|
+
});
|
|
176
|
+
(0, _defineProperty2["default"])(_this, "_mounted", false);
|
|
177
|
+
(0, _defineProperty2["default"])(_this, "_initialized", false);
|
|
178
|
+
(0, _defineProperty2["default"])(_this, "_joined", false);
|
|
179
|
+
(0, _defineProperty2["default"])(_this, "_grantedUsers", new Set());
|
|
180
|
+
(0, _defineProperty2["default"])(_this, "_streamObserver", {
|
|
181
|
+
onStreamsRemoved: _this._handleStreamsRemoved.bind(_this)
|
|
182
|
+
});
|
|
183
|
+
(0, _defineProperty2["default"])(_this, "_userObserver", {
|
|
184
|
+
onUserInfoUpdated: _this._handleUserInfoUpdated.bind(_this)
|
|
185
|
+
});
|
|
186
|
+
(0, _defineProperty2["default"])(_this, "_eventObserver", {
|
|
187
|
+
onEvent: _this.onEvent.bind(_this)
|
|
188
|
+
});
|
|
189
|
+
_classPrivateFieldInitSpec(_this, _A, _init__lonelyWindowState(_this, _type.LonelyWindowState.DEFAULT));
|
|
190
|
+
_classPrivateFieldInitSpec(_this, _B, _init__ownerUser(_this, undefined));
|
|
191
|
+
_classPrivateFieldInitSpec(_this, _C, _init__isHost(_this, false));
|
|
192
|
+
_classPrivateFieldInitSpec(_this, _D, _init__boardBackground(_this, '#ffffff'));
|
|
193
|
+
_classPrivateFieldInitSpec(_this, _E, _init__localUser(_this));
|
|
194
|
+
_this._uiEventStore = uiEventStore;
|
|
195
|
+
_this._userControl = userControl;
|
|
196
|
+
_this._roomControl = roomControl;
|
|
197
|
+
_this._securityStore = securityStore;
|
|
198
|
+
_this._whiteboardControl = whiteboardControl;
|
|
199
|
+
_this._streamControl = streamControl;
|
|
200
|
+
_this._whiteboardControl.addObserver(_this._boardObservble());
|
|
201
|
+
_this._toolbarStore = new _store.ToolbarStore();
|
|
202
|
+
_this._controlbarStore = new _store2.WhiteboardControlBarStore({
|
|
203
|
+
uiEventStore: uiEventStore,
|
|
204
|
+
streamControl: streamControl,
|
|
205
|
+
userControl: userControl,
|
|
206
|
+
securityStore: securityStore
|
|
207
|
+
});
|
|
208
|
+
_this._streamControl.addObserver(_this._streamObserver);
|
|
209
|
+
_this._userControl.addObserver(_this._userObserver);
|
|
210
|
+
_this._uiEventStore.addObserver(_this._eventObserver);
|
|
211
|
+
// this._openWhenIntialize();
|
|
212
|
+
_this._boardStore = _this._createBoardUIContext();
|
|
213
|
+
_this._localUser = _this._userControl.getLocalUser();
|
|
214
|
+
_this._isHost = [_type2.FcrUserRole.HOST, _type2.FcrUserRole.COHOST].includes(_this._localUser.userRole);
|
|
215
|
+
window.addEventListener('resize', _this._resetCanvasPosition);
|
|
216
|
+
var activeInfo = whiteboardControl.getBoardActiveInfo();
|
|
217
|
+
_this._isActive = activeInfo.isActive;
|
|
218
|
+
if (_this._isActive) {
|
|
219
|
+
_this._checkBoard();
|
|
220
|
+
_this._ownerUser = _this._userControl.getUser(activeInfo.ownerUserId);
|
|
221
|
+
_this._boardBackground = whiteboardControl.getBackgroundColor();
|
|
222
|
+
}
|
|
223
|
+
return _this;
|
|
224
|
+
}
|
|
225
|
+
(0, _inherits2["default"])(FcrWhiteboardUIModule, _UIModule);
|
|
226
|
+
return (0, _createClass2["default"])(FcrWhiteboardUIModule, [{
|
|
227
|
+
key: "_lonelyWindowState",
|
|
228
|
+
get: function get() {
|
|
229
|
+
return _classPrivateFieldGet(_A, this);
|
|
230
|
+
},
|
|
231
|
+
set: function set(v) {
|
|
232
|
+
_classPrivateFieldSet(_A, this, v);
|
|
233
|
+
}
|
|
234
|
+
}, {
|
|
235
|
+
key: "_ownerUser",
|
|
236
|
+
get: function get() {
|
|
237
|
+
return _classPrivateFieldGet(_B, this);
|
|
238
|
+
},
|
|
239
|
+
set: function set(v) {
|
|
240
|
+
_classPrivateFieldSet(_B, this, v);
|
|
241
|
+
}
|
|
242
|
+
}, {
|
|
243
|
+
key: "_isHost",
|
|
244
|
+
get: function get() {
|
|
245
|
+
return _classPrivateFieldGet(_C, this);
|
|
246
|
+
},
|
|
247
|
+
set: function set(v) {
|
|
248
|
+
_classPrivateFieldSet(_C, this, v);
|
|
249
|
+
}
|
|
250
|
+
}, {
|
|
251
|
+
key: "_boardBackground",
|
|
252
|
+
get: function get() {
|
|
253
|
+
return _classPrivateFieldGet(_D, this);
|
|
254
|
+
},
|
|
255
|
+
set: function set(v) {
|
|
256
|
+
_classPrivateFieldSet(_D, this, v);
|
|
257
|
+
}
|
|
258
|
+
}, {
|
|
259
|
+
key: "_localUser",
|
|
260
|
+
get: function get() {
|
|
261
|
+
return _classPrivateFieldGet(_E, this);
|
|
262
|
+
},
|
|
263
|
+
set: function set(v) {
|
|
264
|
+
_classPrivateFieldSet(_E, this, v);
|
|
265
|
+
}
|
|
266
|
+
}, {
|
|
267
|
+
key: "hasPrivilege",
|
|
268
|
+
get: function get() {
|
|
269
|
+
return false;
|
|
270
|
+
}
|
|
271
|
+
}, {
|
|
272
|
+
key: "contentAreaSize",
|
|
273
|
+
get: function get() {
|
|
274
|
+
var layoutContentDom = document.querySelector(".".concat(_utils.layoutContentClassName));
|
|
275
|
+
var contentAreaSize = {
|
|
276
|
+
width: 0,
|
|
277
|
+
height: 0,
|
|
278
|
+
top: 0,
|
|
279
|
+
left: 0
|
|
280
|
+
};
|
|
281
|
+
if (layoutContentDom) {
|
|
282
|
+
var _layoutContentDom$get = layoutContentDom.getBoundingClientRect(),
|
|
283
|
+
width = _layoutContentDom$get.width,
|
|
284
|
+
height = _layoutContentDom$get.height,
|
|
285
|
+
left = _layoutContentDom$get.left,
|
|
286
|
+
top = _layoutContentDom$get.top;
|
|
287
|
+
contentAreaSize.width = width;
|
|
288
|
+
contentAreaSize.height = height;
|
|
289
|
+
contentAreaSize.left = left;
|
|
290
|
+
contentAreaSize.top = top;
|
|
291
|
+
}
|
|
292
|
+
return contentAreaSize;
|
|
293
|
+
}
|
|
294
|
+
}, {
|
|
295
|
+
key: "getComponent",
|
|
296
|
+
value: function getComponent(dom) {
|
|
297
|
+
var component = /*#__PURE__*/(0, _jsxRuntime.jsx)(_context3.BoardUIContext.Provider, {
|
|
298
|
+
value: this._boardStore,
|
|
299
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_store.ToolbarContext.Provider, {
|
|
300
|
+
value: this._createToolbarUIContext(),
|
|
301
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_store2.WhiteboardControlBarUIContext.Provider, {
|
|
302
|
+
value: this._controlbarStore,
|
|
303
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_multiWindow.MultiWindowWidgetDialog, {
|
|
304
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_app.Whiteboard, {})
|
|
305
|
+
})
|
|
306
|
+
})
|
|
307
|
+
})
|
|
308
|
+
});
|
|
309
|
+
if (dom) {
|
|
310
|
+
dom.classList.add(_utils.widgetContainerClassName);
|
|
311
|
+
this._outerDom = dom;
|
|
312
|
+
return _reactDom["default"].render(component, dom);
|
|
313
|
+
}
|
|
314
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
315
|
+
className: _utils.widgetContainerClassName,
|
|
316
|
+
children: component
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
}, {
|
|
320
|
+
key: "onEvent",
|
|
321
|
+
value: function onEvent(event, payload) {
|
|
322
|
+
var _this$_whiteboardCont2;
|
|
323
|
+
switch (event) {
|
|
324
|
+
case _constant.UIAction.OPEN_WHITEBOARD:
|
|
325
|
+
if (!this._isActive) {
|
|
326
|
+
var _this$_whiteboardCont;
|
|
327
|
+
(_this$_whiteboardCont = this._whiteboardControl) === null || _this$_whiteboardCont === void 0 || _this$_whiteboardCont.active();
|
|
328
|
+
}
|
|
329
|
+
break;
|
|
330
|
+
case _constant.UIAction.CLOSE_WHITEBOARD:
|
|
331
|
+
(_this$_whiteboardCont2 = this._whiteboardControl) === null || _this$_whiteboardCont2 === void 0 || _this$_whiteboardCont2.inactive();
|
|
332
|
+
break;
|
|
333
|
+
case _constant.UIAction.WHITEBOARD_CHANGED:
|
|
334
|
+
this._setCanvasBound(payload.action);
|
|
335
|
+
if (payload.action === _type.WhiteboardControlbarEvents.LONEYWINDOW) {
|
|
336
|
+
this._lonelyWindowState = payload.payload ? _type.LonelyWindowState.OPEN : _type.LonelyWindowState.CLOSE;
|
|
337
|
+
this.onDestroy();
|
|
338
|
+
break;
|
|
339
|
+
}
|
|
340
|
+
if (payload.action === _type.WhiteboardControlbarEvents.ENABLE_CONTROL) {
|
|
341
|
+
var _this$_boardStore;
|
|
342
|
+
(_this$_boardStore = this._boardStore) === null || _this$_boardStore === void 0 || _this$_boardStore.setWriteEnable(payload.payload);
|
|
343
|
+
if (!payload.payload) this._resetToolIfNeed();
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
346
|
+
break;
|
|
347
|
+
case _constant.UIAction.TOGGLE_LAYOUT:
|
|
348
|
+
if (payload.layout === _type.FcrUIVideoWindowLayoutType.Gallery) {
|
|
349
|
+
if (this._boardDom) {
|
|
350
|
+
var style = {
|
|
351
|
+
width: '100%',
|
|
352
|
+
height: '100%',
|
|
353
|
+
left: 0,
|
|
354
|
+
top: 0
|
|
355
|
+
};
|
|
356
|
+
Object.assign(this._boardDom.style, style);
|
|
357
|
+
}
|
|
358
|
+
} else {
|
|
359
|
+
this._resetCanvasPosition();
|
|
360
|
+
}
|
|
361
|
+
break;
|
|
362
|
+
case _constant.UIAction.CAROUSEL_COLLAPSED:
|
|
363
|
+
this._resetCanvasPosition();
|
|
364
|
+
break;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}, {
|
|
368
|
+
key: "onProcessEvent",
|
|
369
|
+
value: function onProcessEvent(_event) {
|
|
370
|
+
// const { action } = event;
|
|
371
|
+
// if (Object.values(ToolbarEvents).includes(action)) {
|
|
372
|
+
// this._caseToolbarEvents(action as ToolbarEvents, payload);
|
|
373
|
+
// }
|
|
374
|
+
// if (Object.values(WhiteboardEvents).includes(action)) {
|
|
375
|
+
// this._boardObservble()[action as WhiteboardEvents](payload);
|
|
376
|
+
// }
|
|
377
|
+
// if (Object.values(WhiteboardUIEvents).includes(action)) {
|
|
378
|
+
// this._boardUIEvents(payload)[action as WhiteboardUIEvents](payload);
|
|
379
|
+
// }
|
|
380
|
+
// if (action === RendererEventAction.GET_LOCAL_USER) {
|
|
381
|
+
// sendEvent({
|
|
382
|
+
// action: RendererEventAction.SET_LOCAL_USER,
|
|
383
|
+
// payload: this._localUser,
|
|
384
|
+
// });
|
|
385
|
+
// }
|
|
386
|
+
// if (action === RendererEventAction.GET_OWNER_USER) {
|
|
387
|
+
// sendEvent({
|
|
388
|
+
// action: RendererEventAction.SET_OWNER_USER,
|
|
389
|
+
// payload: this._ownerUser,
|
|
390
|
+
// });
|
|
391
|
+
// }
|
|
392
|
+
}
|
|
393
|
+
}, {
|
|
394
|
+
key: "onPropertiesUpdate",
|
|
395
|
+
value: function onPropertiesUpdate(_params) {
|
|
396
|
+
// this._checkPrivilege(props);
|
|
397
|
+
this._checkBoard();
|
|
398
|
+
}
|
|
399
|
+
}, {
|
|
400
|
+
key: "onDestroy",
|
|
401
|
+
value: function onDestroy(params) {
|
|
402
|
+
var _this$_ownerUser;
|
|
403
|
+
var _ref3 = params || {},
|
|
404
|
+
operatorUser = _ref3.operatorUser;
|
|
405
|
+
if (this._securityStore.hasStartScreenSharePermission() && (operatorUser === null || operatorUser === void 0 ? void 0 : operatorUser.userId) !== this._localUser.userId) {
|
|
406
|
+
this._uiEventStore.showToast({
|
|
407
|
+
message: this._isMyBoard ? (0, _i18n.transI18n)('fmt_screenshare_whiteboard_tips_stoppedboard') : (0, _i18n.transI18n)('fmt_screenshare_whiteboard_tips_stopped'),
|
|
408
|
+
type: 'info'
|
|
409
|
+
});
|
|
410
|
+
} else if (operatorUser && [(_type2.FcrUserRole.HOST, _type2.FcrUserRole.COHOST)].includes(operatorUser === null || operatorUser === void 0 ? void 0 : operatorUser.userRole) && operatorUser.userId !== ((_this$_ownerUser = this._ownerUser) === null || _this$_ownerUser === void 0 ? void 0 : _this$_ownerUser.userId)) {
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
if (!this._joined) return;
|
|
414
|
+
this._isActive = false;
|
|
415
|
+
// this._close();
|
|
416
|
+
this.unmount();
|
|
417
|
+
this.unload();
|
|
418
|
+
this._disposers.forEach(function (d) {
|
|
419
|
+
return d();
|
|
420
|
+
});
|
|
421
|
+
this._disposers = [];
|
|
422
|
+
window.removeEventListener('resize', this._resetCanvasPosition);
|
|
423
|
+
}
|
|
424
|
+
}, {
|
|
425
|
+
key: "mount",
|
|
426
|
+
value: function mount() {
|
|
427
|
+
var _boardMainWindow = this._boardMainWindow,
|
|
428
|
+
_boardDom = this._boardDom;
|
|
429
|
+
if (_boardDom && _boardMainWindow && !this._mounted) {
|
|
430
|
+
this._mounted = true;
|
|
431
|
+
var aspectRatio = this._initHeight / this._initWidth;
|
|
432
|
+
var view = _boardMainWindow.getContentView();
|
|
433
|
+
_boardDom.appendChild(view);
|
|
434
|
+
_boardMainWindow.setContainerSizeRatio(aspectRatio);
|
|
435
|
+
this._addDisposers();
|
|
436
|
+
this._resetToolIfNeed();
|
|
437
|
+
this._repositionToolbar();
|
|
438
|
+
if (this._boardMainWindow) {
|
|
439
|
+
var _this$_ownerUser2, _this$_localUser, _this$_boardStore2, _this$_boardStore3;
|
|
440
|
+
this._setBackground(this._whiteboardControl.getBackgroundColor() || this._boardBackground);
|
|
441
|
+
this._toolbarStore.observables.layoutReady = [_type.LonelyWindowState.CLOSE, _type.LonelyWindowState.DEFAULT].includes(this._lonelyWindowState);
|
|
442
|
+
var activeInfo = this._whiteboardControl.getBoardActiveInfo();
|
|
443
|
+
this._ownerUser = this._userControl.getUser(activeInfo.ownerUserId);
|
|
444
|
+
this._isMyBoard = ((_this$_ownerUser2 = this._ownerUser) === null || _this$_ownerUser2 === void 0 ? void 0 : _this$_ownerUser2.userId) === ((_this$_localUser = this._localUser) === null || _this$_localUser === void 0 ? void 0 : _this$_localUser.userId);
|
|
445
|
+
(_this$_boardStore2 = this._boardStore) === null || _this$_boardStore2 === void 0 || _this$_boardStore2.setPrivilege(this._isMyBoard || this._isHost);
|
|
446
|
+
(_this$_boardStore3 = this._boardStore) === null || _this$_boardStore3 === void 0 || _this$_boardStore3.setWriteEnable(this._isMyBoard || this._isHost);
|
|
447
|
+
this._uiEventStore.sendEvent(_constant.UIAction.WHITEBOARD_CHANGED, {
|
|
448
|
+
action: _type.WhiteboardBaseEvents.SET_OWNER_USER_ID,
|
|
449
|
+
payload: activeInfo.ownerUserId
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}, {
|
|
455
|
+
key: "unmount",
|
|
456
|
+
value: function unmount() {
|
|
457
|
+
if (this._mounted && this._boardMainWindow) {
|
|
458
|
+
var _this$_boardDom;
|
|
459
|
+
(_this$_boardDom = this._boardDom) === null || _this$_boardDom === void 0 || _this$_boardDom.removeChild(this._boardMainWindow.getContentView());
|
|
460
|
+
this._boardMainWindow = undefined;
|
|
461
|
+
if (this._lonelyWindowState === _type.LonelyWindowState.OPEN) {
|
|
462
|
+
this._openLonelyWindow();
|
|
463
|
+
}
|
|
464
|
+
if (this._lonelyWindowState === _type.LonelyWindowState.CLOSE) {
|
|
465
|
+
this._open();
|
|
466
|
+
}
|
|
467
|
+
this._uiEventStore.sendEvent(_constant.UIAction.WHITEBOARD_CHANGED, {
|
|
468
|
+
action: _type.WhiteboardBaseEvents.SET_OWNER_USER_ID,
|
|
469
|
+
payload: null
|
|
470
|
+
});
|
|
471
|
+
this._ownerUser = undefined;
|
|
472
|
+
this._initialized = false;
|
|
473
|
+
this._close();
|
|
474
|
+
}
|
|
475
|
+
this._mounted = false;
|
|
476
|
+
if (this._timer) clearTimeout(this._timer);
|
|
477
|
+
}
|
|
478
|
+
}, {
|
|
479
|
+
key: "unload",
|
|
480
|
+
value: function unload() {
|
|
481
|
+
var _this$_streamControl;
|
|
482
|
+
if (this._outerDom) {
|
|
483
|
+
_reactDom["default"].unmountComponentAtNode(this._outerDom);
|
|
484
|
+
this._outerDom = undefined;
|
|
485
|
+
}
|
|
486
|
+
(_this$_streamControl = this._streamControl) === null || _this$_streamControl === void 0 || _this$_streamControl.removeObserver(this._streamObserver);
|
|
487
|
+
this._userControl.removeObserver(this._userObserver);
|
|
488
|
+
this._uiEventStore.removeObserver(this._eventObserver);
|
|
489
|
+
this._whiteboardControl.removeObserver(this._boardObservble());
|
|
490
|
+
}
|
|
491
|
+
}, {
|
|
492
|
+
key: "_setBackground",
|
|
493
|
+
value: function _setBackground() {
|
|
494
|
+
var bgColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '#ffffff';
|
|
495
|
+
if (this._boardMainWindow) {
|
|
496
|
+
var _this$_boardMainWindo;
|
|
497
|
+
var themes = (0, _libs["default"])(this._t);
|
|
498
|
+
var _ref4 = themes.find(function (theme) {
|
|
499
|
+
return theme.background === bgColor;
|
|
500
|
+
}) || {
|
|
501
|
+
colors: []
|
|
502
|
+
},
|
|
503
|
+
colors = _ref4.colors;
|
|
504
|
+
(_this$_boardMainWindo = this._boardMainWindow) === null || _this$_boardMainWindo === void 0 || _this$_boardMainWindo.setBackgroundColor(bgColor);
|
|
505
|
+
if (colors && colors.length > 0) {
|
|
506
|
+
this._toolbarStore.observables.colors = colors;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}, {
|
|
511
|
+
key: "_handleStreamsRemoved",
|
|
512
|
+
value: function _handleStreamsRemoved(_roomId, events) {
|
|
513
|
+
var _this2 = this;
|
|
514
|
+
var isReplaced = events.find(function (event) {
|
|
515
|
+
var _event$cause;
|
|
516
|
+
return ((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.data.reason) === _types.FcrBoardInactiveReason.SEIZE;
|
|
517
|
+
});
|
|
518
|
+
var isMyStream = events.some(function (event) {
|
|
519
|
+
return event.modifiedStream.owner.userId === _this2._localUser.userId;
|
|
520
|
+
});
|
|
521
|
+
if (isReplaced && isMyStream) {
|
|
522
|
+
this._alertWhenReplace(isReplaced === null || isReplaced === void 0 ? void 0 : isReplaced.operatorUser);
|
|
523
|
+
}
|
|
524
|
+
if (isReplaced && !isMyStream) {
|
|
525
|
+
var _isReplaced$operatorU;
|
|
526
|
+
this._uiEventStore.showToast({
|
|
527
|
+
type: 'info',
|
|
528
|
+
message: "".concat(isReplaced === null || isReplaced === void 0 || (_isReplaced$operatorU = isReplaced.operatorUser) === null || _isReplaced$operatorU === void 0 ? void 0 : _isReplaced$operatorU.userName, " ").concat((0, _i18n.transI18n)('fmt_screenshare_whiteboard_lables_newshare'))
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
if (isReplaced && isMyStream && !this._isActive) {
|
|
532
|
+
this._uiEventStore.sendEvent(_constant.UIAction.STOP_SCREEN_CAPTURE);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}, {
|
|
536
|
+
key: "_handleUserInfoUpdated",
|
|
537
|
+
value: function _handleUserInfoUpdated(_, event) {
|
|
538
|
+
if (event.modifiedUser.userId === this._localUser.userId) {
|
|
539
|
+
this._localUser = event.modifiedUser;
|
|
540
|
+
this._isHost = [_type2.FcrUserRole.HOST, _type2.FcrUserRole.COHOST].includes(this._localUser.userRole);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}, {
|
|
544
|
+
key: "_resetToolIfNeed",
|
|
545
|
+
value: function _resetToolIfNeed() {
|
|
546
|
+
var _this$_toolbarContext, _this$_toolbarContext2, _this$_toolbarContext3;
|
|
547
|
+
// if (this._boardMainWindow?.mounted) {
|
|
548
|
+
var _this$_defaultBoardSt = this._defaultBoardState,
|
|
549
|
+
strokeColor = _this$_defaultBoardSt.strokeColor,
|
|
550
|
+
strokeWidth = _this$_defaultBoardSt.strokeWidth,
|
|
551
|
+
tool = _this$_defaultBoardSt.tool;
|
|
552
|
+
(_this$_toolbarContext = this._toolbarContext) === null || _this$_toolbarContext === void 0 || _this$_toolbarContext.setStrokeColor(strokeColor);
|
|
553
|
+
(_this$_toolbarContext2 = this._toolbarContext) === null || _this$_toolbarContext2 === void 0 || _this$_toolbarContext2.setStrokeWidth(strokeWidth);
|
|
554
|
+
(_this$_toolbarContext3 = this._toolbarContext) === null || _this$_toolbarContext3 === void 0 || _this$_toolbarContext3.setTool(tool);
|
|
555
|
+
// }
|
|
556
|
+
}
|
|
557
|
+
}, {
|
|
558
|
+
key: "_checkBoard",
|
|
559
|
+
value: function _checkBoard() {
|
|
560
|
+
if (!this._initialized) {
|
|
561
|
+
this._open();
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}, {
|
|
565
|
+
key: "_boardUIEvents",
|
|
566
|
+
value: function _boardUIEvents(observables) {
|
|
567
|
+
var _this3 = this;
|
|
568
|
+
return {
|
|
569
|
+
handleBoardDomLoad: function handleBoardDomLoad(ref) {
|
|
570
|
+
_this3._boardDom = ref;
|
|
571
|
+
if (_this3._boardDom) {
|
|
572
|
+
_this3.mount();
|
|
573
|
+
} else {
|
|
574
|
+
_this3._mounted = false;
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
handleCollectorDomLoad: function handleCollectorDomLoad(ref) {
|
|
578
|
+
_this3._collectorDom = ref;
|
|
579
|
+
},
|
|
580
|
+
handleClose: function handleClose() {
|
|
581
|
+
// this._close();
|
|
582
|
+
// this._isActive = false;
|
|
583
|
+
// this.unmount();
|
|
584
|
+
// console.log('whiteboard close');
|
|
585
|
+
},
|
|
586
|
+
handleOpen: function handleOpen() {
|
|
587
|
+
// console.log('whiteboard open');
|
|
588
|
+
// !this._initialized && this._open();
|
|
589
|
+
},
|
|
590
|
+
setPrivilege: function setPrivilege(_canOperate) {
|
|
591
|
+
observables.canOperate = false;
|
|
592
|
+
},
|
|
593
|
+
setWriteEnable: function setWriteEnable(_enable) {
|
|
594
|
+
observables.writeEnabled = false;
|
|
595
|
+
observables.canOperate = false;
|
|
596
|
+
// this._repositionToolbar();
|
|
597
|
+
},
|
|
598
|
+
setWhiteboardVisible: function setWhiteboardVisible(visible) {
|
|
599
|
+
observables.whiteboardVisible = visible;
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
}, {
|
|
604
|
+
key: "_setCanvasBound",
|
|
605
|
+
value: function _setCanvasBound(oprate) {
|
|
606
|
+
if (!Object.values(_type.WhiteboardControlbarEvents).includes(oprate) || oprate === _type.WhiteboardControlbarEvents.ENABLE_CONTROL) return;
|
|
607
|
+
if (this._boardDom && this._boardMainWindow) {
|
|
608
|
+
var contianHeight = this._boardDom.parentElement.clientHeight;
|
|
609
|
+
var ratio = contianHeight / this._initHeight;
|
|
610
|
+
var origin = this._initHeight / contianHeight;
|
|
611
|
+
var thatStyle = this._boardDom.style;
|
|
612
|
+
thatStyle.transition = 'transform ease .5s';
|
|
613
|
+
var scaleValue = this._controlbarStore.scaleValue;
|
|
614
|
+
if (_utils.ZOOM_IN_CANVAS) {
|
|
615
|
+
// this._boardMainWindow.setViewMode(ViewMode.Freedom);
|
|
616
|
+
}
|
|
617
|
+
this._resetScaleState();
|
|
618
|
+
if (oprate === _type.WhiteboardControlbarEvents.ZOOMIN) {
|
|
619
|
+
if (scaleValue < this._initHeight / contianHeight) {
|
|
620
|
+
var calcValue = scaleValue + ratio;
|
|
621
|
+
this._controlbarStore.isMaxmum = false;
|
|
622
|
+
this._controlbarStore.scaleValue = calcValue > origin ? origin : calcValue;
|
|
623
|
+
} else {
|
|
624
|
+
this._controlbarStore.isMaxmum = true;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
if (oprate === _type.WhiteboardControlbarEvents.ZOOMOUT) {
|
|
628
|
+
if (scaleValue > 1) {
|
|
629
|
+
var _calcValue = scaleValue - ratio;
|
|
630
|
+
this._controlbarStore.isMinimum = false;
|
|
631
|
+
this._controlbarStore.scaleValue = _calcValue > 1 ? _calcValue : 1;
|
|
632
|
+
} else {
|
|
633
|
+
this._controlbarStore.isMinimum = true;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
if (oprate === _type.WhiteboardControlbarEvents.ORIGIN) {
|
|
637
|
+
this._controlbarStore.isOriginal = true;
|
|
638
|
+
this._controlbarStore.scaleValue = origin;
|
|
639
|
+
}
|
|
640
|
+
if (oprate === _type.WhiteboardControlbarEvents.ADAPTIVE) {
|
|
641
|
+
this._controlbarStore.isAdaptived = true;
|
|
642
|
+
this._controlbarStore.scaleValue = 1;
|
|
643
|
+
}
|
|
644
|
+
var value = this._controlbarStore.scaleValue;
|
|
645
|
+
if (!_utils.ZOOM_IN_CANVAS) {
|
|
646
|
+
thatStyle.transform = "scale(".concat(value, ")");
|
|
647
|
+
} else {
|
|
648
|
+
// this._boardMainWindow.zoom(value);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
}, {
|
|
653
|
+
key: "_resetCanvasPosition",
|
|
654
|
+
value: function _resetCanvasPosition() {
|
|
655
|
+
var _this4 = this;
|
|
656
|
+
if (this._timer) clearTimeout(this._timer);
|
|
657
|
+
this._timer = setTimeout(function () {
|
|
658
|
+
if (!_this4._boardDom) return;
|
|
659
|
+
_this4._repositionToolbar();
|
|
660
|
+
var thatStyle = _this4._boardDom.style;
|
|
661
|
+
_this4._controlbarStore.scaleValue = 1;
|
|
662
|
+
thatStyle.transform = "scale(1)";
|
|
663
|
+
}, 300);
|
|
664
|
+
}
|
|
665
|
+
}, {
|
|
666
|
+
key: "_resetScaleState",
|
|
667
|
+
value: function _resetScaleState() {
|
|
668
|
+
this._controlbarStore.isAdaptived = false;
|
|
669
|
+
this._controlbarStore.isMaxmum = false;
|
|
670
|
+
this._controlbarStore.isMinimum = false;
|
|
671
|
+
this._controlbarStore.isOriginal = false;
|
|
672
|
+
}
|
|
673
|
+
}, {
|
|
674
|
+
key: "_createBoardUIContext",
|
|
675
|
+
value: function _createBoardUIContext() {
|
|
676
|
+
var observables = (0, _mobx.observable)({
|
|
677
|
+
canOperate: false,
|
|
678
|
+
minimized: false,
|
|
679
|
+
contentAreaSize: this.contentAreaSize,
|
|
680
|
+
connectionState: this._connectionState,
|
|
681
|
+
joinSuccessed: this._joinSuccessed,
|
|
682
|
+
progress: 0,
|
|
683
|
+
writeEnabled: false,
|
|
684
|
+
whiteboardVisible: false
|
|
685
|
+
});
|
|
686
|
+
return _objectSpread({
|
|
687
|
+
observables: observables
|
|
688
|
+
}, this._boardUIEvents(observables));
|
|
689
|
+
}
|
|
690
|
+
}, {
|
|
691
|
+
key: "_createToolbarUIContext",
|
|
692
|
+
value: function _createToolbarUIContext() {
|
|
693
|
+
var _this5 = this;
|
|
694
|
+
var observables = this._toolbarStore.observables;
|
|
695
|
+
this._toolbarContext = {
|
|
696
|
+
observables: observables,
|
|
697
|
+
redo: function redo() {
|
|
698
|
+
var _this5$_boardMainWind;
|
|
699
|
+
return (_this5$_boardMainWind = _this5._boardMainWindow) === null || _this5$_boardMainWind === void 0 ? void 0 : _this5$_boardMainWind.redo();
|
|
700
|
+
},
|
|
701
|
+
undo: function undo() {
|
|
702
|
+
var _this5$_boardMainWind2;
|
|
703
|
+
return (_this5$_boardMainWind2 = _this5._boardMainWindow) === null || _this5$_boardMainWind2 === void 0 ? void 0 : _this5$_boardMainWind2.undo();
|
|
704
|
+
},
|
|
705
|
+
clean: function clean() {
|
|
706
|
+
var _this5$_boardMainWind3;
|
|
707
|
+
return (_this5$_boardMainWind3 = _this5._boardMainWindow) === null || _this5$_boardMainWind3 === void 0 ? void 0 : _this5$_boardMainWind3.clean();
|
|
708
|
+
},
|
|
709
|
+
saveDraft: function saveDraft() {
|
|
710
|
+
return _this5._getSnapshotImage();
|
|
711
|
+
},
|
|
712
|
+
clickExpansionTool: function clickExpansionTool() {},
|
|
713
|
+
setToolbarPosition: function setToolbarPosition(pos) {
|
|
714
|
+
return observables.toolbarPosition = pos;
|
|
715
|
+
},
|
|
716
|
+
dragToolbar: function dragToolbar() {
|
|
717
|
+
return observables.toolbarReleased = false;
|
|
718
|
+
},
|
|
719
|
+
setTool: function setTool(tool) {
|
|
720
|
+
var _this5$_boardMainWind4;
|
|
721
|
+
observables.currentTool = tool;
|
|
722
|
+
observables.currentShape = undefined;
|
|
723
|
+
(_this5$_boardMainWind4 = _this5._boardMainWindow) === null || _this5$_boardMainWind4 === void 0 || _this5$_boardMainWind4.setToolType(tool);
|
|
724
|
+
},
|
|
725
|
+
setPen: function setPen(shape) {
|
|
726
|
+
var _this5$_boardMainWind5, _this5$_boardMainWind6, _this5$_boardMainWind7;
|
|
727
|
+
observables.currentShape = shape;
|
|
728
|
+
observables.lastPen = shape;
|
|
729
|
+
observables.currentTool = undefined;
|
|
730
|
+
(_this5$_boardMainWind5 = _this5._boardMainWindow) === null || _this5$_boardMainWind5 === void 0 || _this5$_boardMainWind5.setToolType(_this5._convertShapeToBoardToolType(shape));
|
|
731
|
+
(_this5$_boardMainWind6 = _this5._boardMainWindow) === null || _this5$_boardMainWind6 === void 0 || _this5$_boardMainWind6.setStrokeWidth(observables.currentStrokeWidth);
|
|
732
|
+
(_this5$_boardMainWind7 = _this5._boardMainWindow) === null || _this5$_boardMainWind7 === void 0 || _this5$_boardMainWind7.setStrokeColor((0, _tinycolor["default"])(observables.currentColor).toRgb());
|
|
733
|
+
},
|
|
734
|
+
setShape: function setShape(shape) {
|
|
735
|
+
var _this5$_boardMainWind8, _this5$_boardMainWind9, _this5$_boardMainWind10;
|
|
736
|
+
observables.currentShape = shape;
|
|
737
|
+
observables.lastShape = shape;
|
|
738
|
+
observables.currentTool = undefined;
|
|
739
|
+
(_this5$_boardMainWind8 = _this5._boardMainWindow) === null || _this5$_boardMainWind8 === void 0 || _this5$_boardMainWind8.setToolType(_this5._convertShapeToBoardToolType(shape));
|
|
740
|
+
(_this5$_boardMainWind9 = _this5._boardMainWindow) === null || _this5$_boardMainWind9 === void 0 || _this5$_boardMainWind9.setStrokeWidth(observables.currentStrokeWidth);
|
|
741
|
+
(_this5$_boardMainWind10 = _this5._boardMainWindow) === null || _this5$_boardMainWind10 === void 0 || _this5$_boardMainWind10.setStrokeColor((0, _tinycolor["default"])(observables.currentColor).toRgb());
|
|
742
|
+
},
|
|
743
|
+
setStrokeColor: function setStrokeColor(color) {
|
|
744
|
+
var _this5$_boardMainWind11;
|
|
745
|
+
observables.currentColor = color;
|
|
746
|
+
(_this5$_boardMainWind11 = _this5._boardMainWindow) === null || _this5$_boardMainWind11 === void 0 || _this5$_boardMainWind11.setStrokeColor((0, _tinycolor["default"])(color).toRgb());
|
|
747
|
+
},
|
|
748
|
+
setStrokeWidth: function setStrokeWidth(strokeWidth) {
|
|
749
|
+
var _this5$_boardMainWind12;
|
|
750
|
+
observables.currentStrokeWidth = strokeWidth;
|
|
751
|
+
(_this5$_boardMainWind12 = _this5._boardMainWindow) === null || _this5$_boardMainWind12 === void 0 || _this5$_boardMainWind12.setStrokeWidth(strokeWidth);
|
|
752
|
+
},
|
|
753
|
+
releaseToolbar: function releaseToolbar() {
|
|
754
|
+
observables.toolbarReleased = true;
|
|
755
|
+
_this5._updateDockPlacement();
|
|
756
|
+
_this5._repositionToolbar();
|
|
757
|
+
},
|
|
758
|
+
captureScreen: function captureScreen() {
|
|
759
|
+
var _hideWindow = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
760
|
+
} // window.runtime.captureScreen({
|
|
761
|
+
// hideWindow,
|
|
762
|
+
// });
|
|
763
|
+
,
|
|
764
|
+
setTheme: (0, _mobx.action)(function (theme) {
|
|
765
|
+
_this5._setBackgroundColor(theme.background);
|
|
766
|
+
observables.colors = theme.colors;
|
|
767
|
+
observables.currentThemeType = theme;
|
|
768
|
+
}),
|
|
769
|
+
setCommonColor: (0, _mobx.action)(function (color) {
|
|
770
|
+
var commonColors = observables.commonColors;
|
|
771
|
+
if (commonColors.length < 2) commonColors.push(color);
|
|
772
|
+
if (commonColors.length === 2 && commonColors[0]) {
|
|
773
|
+
observables.commonColors = [color, commonColors[0]];
|
|
774
|
+
}
|
|
775
|
+
})
|
|
776
|
+
};
|
|
777
|
+
return this._toolbarContext;
|
|
778
|
+
}
|
|
779
|
+
}, {
|
|
780
|
+
key: "_updateDockPosition",
|
|
781
|
+
value: function _updateDockPosition() {
|
|
782
|
+
if (this._toolbarContext) {
|
|
783
|
+
var toolbarDom = document.querySelector(".".concat(_utils.toolbarClassName));
|
|
784
|
+
var containerDom = document.querySelector(".".concat(_utils.windowClassName));
|
|
785
|
+
if (containerDom && toolbarDom) {
|
|
786
|
+
var containerClientRect = containerDom.getBoundingClientRect();
|
|
787
|
+
var toolbarClientRect = toolbarDom.getBoundingClientRect();
|
|
788
|
+
/* scene page bar 42 px height */
|
|
789
|
+
var toolbarOffsetTop = 42; //(containerClientRect.height - toolbarDom.clientHeight - 42) / 2;
|
|
790
|
+
var toolbarContext = this._toolbarContext;
|
|
791
|
+
(0, _mobx.runInAction)(function () {
|
|
792
|
+
if (toolbarContext.observables.toolbarDockPosition.placement === 'right') {
|
|
793
|
+
// right
|
|
794
|
+
toolbarContext.observables.toolbarDockPosition = {
|
|
795
|
+
x: containerClientRect.width - toolbarClientRect.width,
|
|
796
|
+
y: toolbarOffsetTop + _utils.sceneNavHeight / 2,
|
|
797
|
+
placement: 'right'
|
|
798
|
+
};
|
|
799
|
+
} else {
|
|
800
|
+
// left
|
|
801
|
+
toolbarContext.observables.toolbarDockPosition = {
|
|
802
|
+
x: 0,
|
|
803
|
+
y: toolbarOffsetTop,
|
|
804
|
+
placement: 'left'
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
}, {
|
|
812
|
+
key: "_updateDockPlacement",
|
|
813
|
+
value: function _updateDockPlacement() {
|
|
814
|
+
if (this._toolbarContext) {
|
|
815
|
+
var toolbarDom = document.querySelector(".".concat(_utils.toolbarClassName));
|
|
816
|
+
var containerDom = document.querySelector(".".concat(_utils.windowClassName));
|
|
817
|
+
if (containerDom && toolbarDom) {
|
|
818
|
+
var containerClientRect = containerDom.getBoundingClientRect();
|
|
819
|
+
var toolbarClientRect = toolbarDom.getBoundingClientRect();
|
|
820
|
+
var toolbarCenterPos = toolbarClientRect.left - containerClientRect.left + toolbarClientRect.width / 2;
|
|
821
|
+
var toolbarContext = this._toolbarContext;
|
|
822
|
+
(0, _mobx.runInAction)(function () {
|
|
823
|
+
if (toolbarCenterPos > containerClientRect.width / 2) {
|
|
824
|
+
// right
|
|
825
|
+
toolbarContext.observables.toolbarDockPosition.placement = 'right';
|
|
826
|
+
} else {
|
|
827
|
+
// left
|
|
828
|
+
toolbarContext.observables.toolbarDockPosition.placement = 'left';
|
|
829
|
+
}
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
}, {
|
|
835
|
+
key: "_repositionToolbar",
|
|
836
|
+
value: function _repositionToolbar() {
|
|
837
|
+
if (this._toolbarContext) {
|
|
838
|
+
var toolbarDom = document.querySelector(".".concat(_utils.toolbarClassName));
|
|
839
|
+
var containerDom = document.querySelector(".".concat(_utils.windowClassName));
|
|
840
|
+
if (containerDom && toolbarDom) {
|
|
841
|
+
setTimeout(this._updateMaxVisibleTools);
|
|
842
|
+
// wait until the UI rerenders, then actual dimensions can be obtained
|
|
843
|
+
setTimeout(this._updateDockPosition);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
}, {
|
|
848
|
+
key: "_updateMaxVisibleTools",
|
|
849
|
+
value: function _updateMaxVisibleTools() {
|
|
850
|
+
var containerDom = document.querySelector(".".concat(_utils.windowClassName));
|
|
851
|
+
if (this._toolbarContext && containerDom) {
|
|
852
|
+
var containerClientRect = containerDom.getBoundingClientRect();
|
|
853
|
+
var placement = this._toolbarContext.observables.toolbarDockPosition.placement;
|
|
854
|
+
var toolbarContext = this._toolbarContext;
|
|
855
|
+
(0, _mobx.runInAction)(function () {
|
|
856
|
+
if (placement === 'right') {
|
|
857
|
+
var availableHeight = containerClientRect.height - _utils.verticalPadding - _utils.defaultToolsRetain + _utils.sceneNavHeight;
|
|
858
|
+
toolbarContext.observables.maxCountVisibleTools = Math.floor(availableHeight / _utils.heightPerTool);
|
|
859
|
+
if (toolbarContext.observables.maxCountVisibleTools >= 9) {
|
|
860
|
+
var visibleTools = toolbarContext.observables.maxCountVisibleTools;
|
|
861
|
+
toolbarContext.observables.maxCountVisibleTools += Math.floor((availableHeight - visibleTools * _utils.heightPerTool) / _utils.heightPerColor);
|
|
862
|
+
}
|
|
863
|
+
} else {
|
|
864
|
+
var _availableHeight = containerClientRect.height - _utils.verticalPadding - _utils.defaultToolsRetain - _utils.sceneNavHeight;
|
|
865
|
+
toolbarContext.observables.maxCountVisibleTools = Math.floor(_availableHeight / _utils.heightPerTool);
|
|
866
|
+
if (toolbarContext.observables.maxCountVisibleTools >= 9) {
|
|
867
|
+
var _visibleTools = toolbarContext.observables.maxCountVisibleTools;
|
|
868
|
+
toolbarContext.observables.maxCountVisibleTools += Math.floor((_availableHeight - _visibleTools * _utils.heightPerTool) / _utils.heightPerColor);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
});
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
}, {
|
|
875
|
+
key: "_setBackgroundColor",
|
|
876
|
+
value: function _setBackgroundColor(bgColor) {
|
|
877
|
+
var _this$_whiteboardCont3;
|
|
878
|
+
var color = bgColor || 'white';
|
|
879
|
+
(_this$_whiteboardCont3 = this._whiteboardControl) === null || _this$_whiteboardCont3 === void 0 || _this$_whiteboardCont3.setBackgroundColor(color);
|
|
880
|
+
}
|
|
881
|
+
}, {
|
|
882
|
+
key: "_updateRedo",
|
|
883
|
+
value: function _updateRedo(steps) {
|
|
884
|
+
if (this._toolbarContext) {
|
|
885
|
+
this._toolbarContext.observables.redoSteps = steps;
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
}, {
|
|
889
|
+
key: "_updateUndo",
|
|
890
|
+
value: function _updateUndo(steps) {
|
|
891
|
+
if (this._toolbarContext) {
|
|
892
|
+
this._toolbarContext.observables.undoSteps = steps;
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
}, {
|
|
896
|
+
key: "_setConnectionState",
|
|
897
|
+
value: function _setConnectionState(state) {
|
|
898
|
+
this._connectionState = state;
|
|
899
|
+
if (this._boardStore) {
|
|
900
|
+
this._boardStore.observables.connectionState = state;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
}, {
|
|
904
|
+
key: "_open",
|
|
905
|
+
value: function _open() {
|
|
906
|
+
var _this$_whiteboardCont4;
|
|
907
|
+
this._joined = true;
|
|
908
|
+
this._initialized = true;
|
|
909
|
+
(_this$_whiteboardCont4 = this._whiteboardControl) === null || _this$_whiteboardCont4 === void 0 || _this$_whiteboardCont4.open();
|
|
910
|
+
}
|
|
911
|
+
}, {
|
|
912
|
+
key: "_close",
|
|
913
|
+
value: function _close() {
|
|
914
|
+
this._joined = false;
|
|
915
|
+
this._setJoinSuccessed(false);
|
|
916
|
+
if (this._whiteboardControl) {
|
|
917
|
+
this._whiteboardControl.close();
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
}, {
|
|
921
|
+
key: "_getSnapshotImage",
|
|
922
|
+
value: function () {
|
|
923
|
+
var _getSnapshotImage2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
924
|
+
var _this6 = this;
|
|
925
|
+
var mainWindow, _this$_roomControl$ge, progress, imageData, fileName;
|
|
926
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
927
|
+
while (1) switch (_context.prev = _context.next) {
|
|
928
|
+
case 0:
|
|
929
|
+
mainWindow = this._boardMainWindow;
|
|
930
|
+
if (!mainWindow) {
|
|
931
|
+
_context.next = 11;
|
|
932
|
+
break;
|
|
933
|
+
}
|
|
934
|
+
progress = setInterval(function () {
|
|
935
|
+
if (_this6._boardStore && _this6._boardStore.observables.progress < 100) {
|
|
936
|
+
_this6._boardStore.observables.progress += 1;
|
|
937
|
+
} else {
|
|
938
|
+
clearInterval(progress);
|
|
939
|
+
}
|
|
940
|
+
}, 10);
|
|
941
|
+
_context.next = 5;
|
|
942
|
+
return mainWindow.getSnapshotImage();
|
|
943
|
+
case 5:
|
|
944
|
+
imageData = _context.sent;
|
|
945
|
+
this._boardStore.observables.progress = 100;
|
|
946
|
+
clearInterval(progress);
|
|
947
|
+
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");
|
|
948
|
+
(0, _utils.downloadImageData)(imageData, fileName);
|
|
949
|
+
this._uiEventStore.showToast({
|
|
950
|
+
type: 'info',
|
|
951
|
+
message: (0, _i18n.transI18n)('fmt_screenshare_whiteboard_tips_savedsuccessfully')
|
|
952
|
+
});
|
|
953
|
+
case 11:
|
|
954
|
+
case "end":
|
|
955
|
+
return _context.stop();
|
|
956
|
+
}
|
|
957
|
+
}, _callee, this);
|
|
958
|
+
}));
|
|
959
|
+
function _getSnapshotImage() {
|
|
960
|
+
return _getSnapshotImage2.apply(this, arguments);
|
|
961
|
+
}
|
|
962
|
+
return _getSnapshotImage;
|
|
963
|
+
}()
|
|
964
|
+
}, {
|
|
965
|
+
key: "_openLonelyWindow",
|
|
966
|
+
value: function _openLonelyWindow() {
|
|
967
|
+
this._uiEventStore.openDialog(_constant.DialogKey.WHITEBOARD);
|
|
968
|
+
this._uiEventStore.openDialog(_constant.DialogKey.TOOLBAR);
|
|
969
|
+
this._toolbarStore.observables.layoutReady = false;
|
|
970
|
+
this._open();
|
|
971
|
+
}
|
|
972
|
+
}, {
|
|
973
|
+
key: "_setJoinSuccessed",
|
|
974
|
+
value: function _setJoinSuccessed(joinSuccessed) {
|
|
975
|
+
if (this._boardStore) {
|
|
976
|
+
this._boardStore.observables.joinSuccessed = joinSuccessed;
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
}, {
|
|
980
|
+
key: "_boardObservble",
|
|
981
|
+
value: function _boardObservble() {
|
|
982
|
+
var _this7 = this;
|
|
983
|
+
return {
|
|
984
|
+
onConnectionStateUpdated: function () {
|
|
985
|
+
var _onConnectionStateUpdated = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(state) {
|
|
986
|
+
var _this7$_whiteboardCon, mainWindow, _this7$_whiteboardCon2, ownerUserId, ownerUser;
|
|
987
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
988
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
989
|
+
case 0:
|
|
990
|
+
_this7.logger.info('Fcr board connection state changed to', state);
|
|
991
|
+
_this7._setConnectionState(state);
|
|
992
|
+
if (state === _fcrCore.FcrConnectionState.DISCONNECTED) {
|
|
993
|
+
if (_this7._joined) {
|
|
994
|
+
(_this7$_whiteboardCon = _this7._whiteboardControl) === null || _this7$_whiteboardCon === void 0 || _this7$_whiteboardCon.open();
|
|
995
|
+
} else {
|
|
996
|
+
_this7.unmount();
|
|
997
|
+
_this7.unload();
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
if (state === _fcrCore.FcrConnectionState.CONNECTED) {
|
|
1001
|
+
_this7._setJoinSuccessed(true);
|
|
1002
|
+
mainWindow = _this7._whiteboardControl.getMainWindow();
|
|
1003
|
+
_this7.logger.info('Fcr board join success');
|
|
1004
|
+
if (_this7._whiteboardControl) {
|
|
1005
|
+
_this7$_whiteboardCon2 = _this7._whiteboardControl.getBoardActiveInfo(), ownerUserId = _this7$_whiteboardCon2.ownerUserId;
|
|
1006
|
+
ownerUser = _this7._userControl.getUser(ownerUserId);
|
|
1007
|
+
_this7._controlbarStore.ownerUser = ownerUser;
|
|
1008
|
+
}
|
|
1009
|
+
mainWindow.addObserver({
|
|
1010
|
+
onRedoStateUpdated: _this7._updateRedo,
|
|
1011
|
+
onUndoStateUpdated: _this7._updateUndo
|
|
1012
|
+
});
|
|
1013
|
+
_this7._boardMainWindow = mainWindow;
|
|
1014
|
+
_this7.mount();
|
|
1015
|
+
}
|
|
1016
|
+
case 4:
|
|
1017
|
+
case "end":
|
|
1018
|
+
return _context2.stop();
|
|
1019
|
+
}
|
|
1020
|
+
}, _callee2);
|
|
1021
|
+
}));
|
|
1022
|
+
function onConnectionStateUpdated(_x) {
|
|
1023
|
+
return _onConnectionStateUpdated.apply(this, arguments);
|
|
1024
|
+
}
|
|
1025
|
+
return onConnectionStateUpdated;
|
|
1026
|
+
}(),
|
|
1027
|
+
onActive: function onActive(_ownerId, operatorUser) {
|
|
1028
|
+
_this7.onPropertiesUpdate({
|
|
1029
|
+
operatorUser: operatorUser
|
|
1030
|
+
});
|
|
1031
|
+
},
|
|
1032
|
+
onInactive: function onInactive(reason, operatorUser) {
|
|
1033
|
+
var _this7$_ownerUser;
|
|
1034
|
+
var currentUserId = _this7._localUser.userId;
|
|
1035
|
+
if (reason === _types.FcrBoardInactiveReason.SEIZE && (operatorUser === null || operatorUser === void 0 ? void 0 : operatorUser.userId) !== currentUserId && ((_this7$_ownerUser = _this7._ownerUser) === null || _this7$_ownerUser === void 0 ? void 0 : _this7$_ownerUser.userId) === currentUserId) {
|
|
1036
|
+
_this7._alertWhenReplace(operatorUser);
|
|
1037
|
+
return;
|
|
1038
|
+
}
|
|
1039
|
+
_this7.onDestroy({
|
|
1040
|
+
operatorUser: operatorUser
|
|
1041
|
+
});
|
|
1042
|
+
},
|
|
1043
|
+
onBackgroundColorUpdated: function onBackgroundColorUpdated(color) {
|
|
1044
|
+
_this7._setBackground(color);
|
|
1045
|
+
}
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1048
|
+
}, {
|
|
1049
|
+
key: "_addDisposers",
|
|
1050
|
+
value: function _addDisposers() {
|
|
1051
|
+
var _this8 = this;
|
|
1052
|
+
this._disposers.push((0, _mobx.reaction)(function () {
|
|
1053
|
+
return _this8.hasPrivilege;
|
|
1054
|
+
}, function (privilege) {
|
|
1055
|
+
var _this8$_boardStore, _this8$_boardStore2;
|
|
1056
|
+
var p = privilege || _this8._isHost || _this8._isMyBoard;
|
|
1057
|
+
(_this8$_boardStore = _this8._boardStore) === null || _this8$_boardStore === void 0 || _this8$_boardStore.setWriteEnable(_this8._isHost || _this8._isMyBoard);
|
|
1058
|
+
(_this8$_boardStore2 = _this8._boardStore) === null || _this8$_boardStore2 === void 0 || _this8$_boardStore2.setPrivilege(p);
|
|
1059
|
+
}), (0, _mobx.reaction)(function () {
|
|
1060
|
+
return _this8._boardStore.observables.writeEnabled;
|
|
1061
|
+
}, function (writeEnabled) {
|
|
1062
|
+
if (writeEnabled) setTimeout(_this8._repositionToolbar, 0);
|
|
1063
|
+
}), (0, _mobx.reaction)(function () {
|
|
1064
|
+
return _this8._localUser;
|
|
1065
|
+
}, function (user) {
|
|
1066
|
+
var _this8$_boardStore3;
|
|
1067
|
+
_this8._isHost = [_type2.FcrUserRole.HOST, _type2.FcrUserRole.COHOST].includes(user.userRole);
|
|
1068
|
+
var hasPrivilege = _this8.hasPrivilege || _this8._isHost || _this8._isMyBoard;
|
|
1069
|
+
(_this8$_boardStore3 = _this8._boardStore) === null || _this8$_boardStore3 === void 0 || _this8$_boardStore3.setPrivilege(hasPrivilege);
|
|
1070
|
+
_this8._boardStore.setWriteEnable(_this8._isHost || _this8._isMyBoard);
|
|
1071
|
+
}));
|
|
1072
|
+
}
|
|
1073
|
+
}, {
|
|
1074
|
+
key: "_alertWhenReplace",
|
|
1075
|
+
value: function _alertWhenReplace(userInfo) {
|
|
1076
|
+
var _this9 = this;
|
|
1077
|
+
var userRole = userInfo.userRole,
|
|
1078
|
+
userName = userInfo.userName;
|
|
1079
|
+
var dialogId = this._uiEventStore.openConfirmDialog({
|
|
1080
|
+
title: (0, _i18n.transI18n)('fmt_screenshare_whiteboard_tips_stoppedboard'),
|
|
1081
|
+
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')),
|
|
1082
|
+
okText: (0, _i18n.transI18n)('fmt_screenshare_whiteboard_button_gotit'),
|
|
1083
|
+
showCancel: false,
|
|
1084
|
+
icon: _type3.FcrIconType.FCR_SCREENSHARING,
|
|
1085
|
+
onOk: function onOk() {
|
|
1086
|
+
_this9._uiEventStore.closeDialog(dialogId);
|
|
1087
|
+
},
|
|
1088
|
+
onCancel: function onCancel() {
|
|
1089
|
+
_this9._uiEventStore.closeDialog(dialogId);
|
|
1090
|
+
}
|
|
1091
|
+
});
|
|
1092
|
+
}
|
|
1093
|
+
}, {
|
|
1094
|
+
key: "_convertShapeToBoardToolType",
|
|
1095
|
+
value: function _convertShapeToBoardToolType(shape) {
|
|
1096
|
+
switch (shape) {
|
|
1097
|
+
case _enums.FcrBoardShape.Arrow:
|
|
1098
|
+
return _enums.FcrBoardToolType.ARROW;
|
|
1099
|
+
case _enums.FcrBoardShape.Curve:
|
|
1100
|
+
return _enums.FcrBoardToolType.CURVE;
|
|
1101
|
+
case _enums.FcrBoardShape.Ellipse:
|
|
1102
|
+
return _enums.FcrBoardToolType.ELLIPSE;
|
|
1103
|
+
case _enums.FcrBoardShape.Pentagram:
|
|
1104
|
+
return _enums.FcrBoardToolType.PENTAGRAM;
|
|
1105
|
+
case _enums.FcrBoardShape.Rectangle:
|
|
1106
|
+
return _enums.FcrBoardToolType.RECTANGLE;
|
|
1107
|
+
case _enums.FcrBoardShape.Rhombus:
|
|
1108
|
+
return _enums.FcrBoardToolType.RHOMBUS;
|
|
1109
|
+
case _enums.FcrBoardShape.Straight:
|
|
1110
|
+
return _enums.FcrBoardToolType.STRAIGHT;
|
|
1111
|
+
case _enums.FcrBoardShape.Triangle:
|
|
1112
|
+
return _enums.FcrBoardToolType.TRIANGLE;
|
|
1113
|
+
default:
|
|
1114
|
+
return _enums.FcrBoardToolType.NONE;
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
}, {
|
|
1118
|
+
key: "release",
|
|
1119
|
+
value: function release() {
|
|
1120
|
+
this.unmount();
|
|
1121
|
+
this.unload();
|
|
1122
|
+
}
|
|
1123
|
+
}]);
|
|
1124
|
+
}(_base.UIModule);
|
|
1125
|
+
_FcrWhiteboardUIModule = FcrWhiteboardUIModule;
|
|
1126
|
+
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;
|
|
1127
|
+
var _applyDecs$e2 = (0, _slicedToArray2["default"])(_applyDecs$e, 6);
|
|
1128
|
+
_init__lonelyWindowState = _applyDecs$e2[0];
|
|
1129
|
+
_init__ownerUser = _applyDecs$e2[1];
|
|
1130
|
+
_init__isHost = _applyDecs$e2[2];
|
|
1131
|
+
_init__boardBackground = _applyDecs$e2[3];
|
|
1132
|
+
_init__localUser = _applyDecs$e2[4];
|
|
1133
|
+
_initProto = _applyDecs$e2[5];
|
|
1134
|
+
_applyDecs$e;
|