fcr-ui-scene 3.6.1 → 3.6.3
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/creator.d.ts +6 -0
- package/lib/creator.js +125 -24
- package/lib/electron/app.js +5 -4
- package/lib/electron/bootstrap-dev.js +3 -0
- package/lib/electron/bootstrap-sdk.js +4 -0
- package/lib/electron/injections.d.ts +5 -0
- package/lib/electron/injections.js +36 -8
- package/lib/electron/ipc/ipc.d.ts +1 -0
- package/lib/electron/ipc/ipc.js +4 -0
- package/lib/electron/main.js +16 -8
- package/lib/electron/plugins/screenshot.js +4 -2
- package/lib/electron/preload.js +7 -2
- package/lib/electron/window.js +4 -6
- package/lib/fragments/annotation/index.d.ts +11 -0
- package/lib/fragments/annotation/index.js +121 -0
- package/lib/fragments/annotation/libs.d.ts +55 -0
- package/lib/fragments/annotation/libs.js +93 -0
- package/lib/fragments/annotation/store.d.ts +30 -0
- package/lib/fragments/annotation/store.js +565 -0
- package/lib/fragments/annotation/view.d.ts +3 -0
- package/lib/fragments/annotation/view.js +31 -0
- package/lib/fragments/base.d.ts +10 -0
- package/lib/fragments/base.js +44 -0
- package/lib/modules/action-bar/components/screen-share/submenu.js +7 -6
- package/lib/modules/action-bar/index.css +11 -0
- package/lib/modules/action-bar/index.d.ts +2 -0
- package/lib/modules/action-bar/index.js +1 -0
- package/lib/modules/action-bar/store.d.ts +7 -9
- package/lib/modules/action-bar/store.js +49 -90
- package/lib/modules/annotation/board-cursor.css +76 -0
- package/lib/modules/annotation/components/control-bar/index.css +48 -0
- package/lib/modules/annotation/components/control-bar/index.d.ts +3 -0
- package/lib/modules/annotation/components/control-bar/index.js +141 -0
- package/lib/modules/annotation/components/toolbar/components/color-tool/color-panel/index.d.ts +3 -0
- package/lib/modules/annotation/components/toolbar/components/color-tool/color-panel/index.js +46 -0
- package/lib/modules/annotation/components/toolbar/components/color-tool/index.d.ts +1 -0
- package/lib/modules/annotation/components/toolbar/components/color-tool/index.js +52 -0
- package/lib/modules/annotation/components/toolbar/components/graphic-tool/graphic-panel/index.d.ts +3 -0
- package/lib/modules/annotation/components/toolbar/components/graphic-tool/graphic-panel/index.js +61 -0
- package/lib/modules/annotation/components/toolbar/components/graphic-tool/graphic-panel/libs.d.ts +12 -0
- package/lib/modules/annotation/components/toolbar/components/graphic-tool/graphic-panel/libs.js +65 -0
- package/lib/modules/annotation/components/toolbar/components/graphic-tool/index.d.ts +1 -0
- package/lib/modules/annotation/components/toolbar/components/graphic-tool/index.js +68 -0
- package/lib/modules/annotation/components/toolbar/components/item/item.d.ts +18 -0
- package/lib/modules/annotation/components/toolbar/components/item/item.js +116 -0
- package/lib/modules/annotation/components/toolbar/components/item/style.css +43 -0
- package/lib/modules/annotation/components/toolbar/components/panel/index.d.ts +5 -0
- package/lib/modules/annotation/components/toolbar/components/panel/index.js +22 -0
- package/lib/modules/annotation/components/toolbar/components/panel/style.css +24 -0
- package/lib/modules/annotation/components/toolbar/components/pen-tool/index.d.ts +1 -0
- package/lib/modules/annotation/components/toolbar/components/pen-tool/index.js +58 -0
- package/lib/modules/annotation/components/toolbar/components/pen-tool/pen-panel/index.d.ts +3 -0
- package/lib/modules/annotation/components/toolbar/components/pen-tool/pen-panel/index.js +34 -0
- package/lib/modules/annotation/components/toolbar/components/tips/index.d.ts +2 -0
- package/lib/modules/annotation/components/toolbar/components/tips/index.js +25 -0
- package/lib/modules/annotation/components/toolbar/components/tips/style.css +19 -0
- package/lib/modules/annotation/components/toolbar/index.d.ts +0 -0
- package/lib/modules/annotation/components/toolbar/index.js +1 -0
- package/lib/modules/annotation/components/toolbar/store.d.ts +40 -0
- package/lib/modules/annotation/components/toolbar/store.js +279 -0
- package/lib/modules/annotation/components/toolbar/style.css +55 -0
- package/lib/modules/annotation/components/toolbar/view.d.ts +2 -0
- package/lib/modules/annotation/components/toolbar/view.js +120 -0
- package/lib/modules/annotation/index.d.ts +38 -0
- package/lib/modules/annotation/index.js +169 -0
- package/lib/modules/annotation/store.d.ts +93 -0
- package/lib/modules/annotation/store.js +673 -0
- package/lib/modules/annotation/style.css +26 -0
- package/lib/modules/annotation/view.d.ts +3 -0
- package/lib/modules/annotation/view.js +49 -0
- package/lib/modules/chat/view.js +112 -100
- package/lib/modules/components/annotation-menu/index.d.ts +7 -0
- package/lib/modules/components/annotation-menu/index.js +119 -0
- package/lib/modules/components/leave-meeting/components/assign-host.js +26 -23
- package/lib/modules/components/member-window/components/member-actions/components/audio-control.d.ts +0 -1
- package/lib/modules/components/member-window/components/member-actions/components/audio-control.js +10 -4
- package/lib/modules/components/member-window/components/member-actions/components/icon-buttons/index.d.ts +4 -2
- package/lib/modules/components/member-window/components/member-actions/components/icon-buttons/index.js +10 -6
- package/lib/modules/components/member-window/components/member-actions/components/icon-status.d.ts +0 -2
- package/lib/modules/components/member-window/components/member-actions/components/icon-status.js +3 -4
- package/lib/modules/components/member-window/components/member-actions/components/more-actions.d.ts +0 -3
- package/lib/modules/components/member-window/components/member-actions/components/more-actions.js +6 -32
- package/lib/modules/components/member-window/components/member-actions/components/share-status.js +11 -3
- package/lib/modules/components/member-window/components/member-actions/components/user-info.d.ts +0 -1
- package/lib/modules/components/member-window/components/member-actions/components/user-info.js +7 -10
- package/lib/modules/components/member-window/components/member-actions/components/user-tag.d.ts +0 -1
- package/lib/modules/components/member-window/components/member-actions/components/user-tag.js +0 -2
- package/lib/modules/components/member-window/components/member-actions/index.js +1 -32
- package/lib/modules/components/member-window/components/member-actions/store.d.ts +38 -1
- package/lib/modules/components/member-window/components/member-actions/store.js +130 -23
- package/lib/modules/components/member-window/components/video-player/components/remote-video-player.d.ts +2 -1
- package/lib/modules/components/member-window/components/video-player/components/remote-video-player.js +6 -1
- package/lib/modules/components/member-window/components/video-player/index.d.ts +1 -0
- package/lib/modules/components/member-window/index.css +37 -0
- package/lib/modules/components/member-window/index.d.ts +1 -1
- package/lib/modules/components/member-window/index.js +8 -5
- package/lib/modules/components/member-window/types.d.ts +2 -0
- package/lib/modules/components/security-menu/index.js +7 -6
- package/lib/modules/control-bar/components/annotation-button/index.d.ts +1 -0
- package/lib/modules/control-bar/components/annotation-button/index.js +59 -0
- package/lib/modules/control-bar/index.d.ts +6 -6
- package/lib/modules/control-bar/index.js +5 -34
- package/lib/modules/control-bar/store.d.ts +27 -13
- package/lib/modules/control-bar/store.js +121 -126
- package/lib/modules/control-bar/view.js +50 -4
- package/lib/modules/dialog/components/annotation-tool/index.d.ts +4 -0
- package/lib/modules/dialog/components/annotation-tool/index.js +53 -0
- package/lib/modules/dialog/components/chat/index.js +1 -1
- package/lib/modules/dialog/components/control-bar/index.d.ts +0 -2
- package/lib/modules/dialog/components/control-bar/index.js +1 -3
- package/lib/modules/dialog/components/host-area-container/index.d.ts +12 -0
- package/lib/modules/dialog/components/host-area-container/index.js +214 -0
- package/lib/modules/dialog/components/participant/index.js +1 -1
- package/lib/modules/dialog/components/system-preference/index.js +1 -1
- package/lib/modules/dialog/components/video-window/index.js +1 -0
- package/lib/modules/dialog/hooks/use-popover-watcher.d.ts +14 -0
- package/lib/modules/dialog/hooks/use-popover-watcher.js +112 -0
- package/lib/modules/dialog/hooks/useElectron.d.ts +1 -0
- package/lib/modules/dialog/hooks/useElectron.js +13 -3
- package/lib/modules/dialog/index.d.ts +2 -3
- package/lib/modules/dialog/index.js +3 -26
- package/lib/modules/dialog/store.d.ts +14 -9
- package/lib/modules/dialog/store.js +56 -50
- package/lib/modules/event-confirm/components/window/index.d.ts +7 -0
- package/lib/modules/event-confirm/components/window/index.js +188 -0
- package/lib/modules/event-confirm/index.d.ts +4 -4
- package/lib/modules/event-confirm/index.js +6 -4
- package/lib/modules/event-confirm/store.d.ts +4 -5
- package/lib/modules/event-confirm/store.js +35 -26
- package/lib/modules/event-confirm/view.js +23 -171
- package/lib/modules/event-sound/index.js +1 -1
- package/lib/modules/layout/components/CommonVideoRenderer.js +33 -16
- package/lib/modules/layout/index.d.ts +4 -0
- package/lib/modules/layout/index.js +2 -0
- package/lib/modules/layout/store.d.ts +14 -2
- package/lib/modules/layout/store.js +77 -45
- package/lib/modules/layout/type.d.ts +7 -0
- package/lib/modules/participant/index.d.ts +2 -0
- package/lib/modules/participant/index.js +2 -1
- package/lib/modules/participant/store.d.ts +5 -2
- package/lib/modules/participant/store.js +73 -25
- package/lib/modules/setting/audio-settings/audio-settings.js +3 -14
- package/lib/modules/setting/index.d.ts +2 -0
- package/lib/modules/setting/index.js +3 -3
- package/lib/modules/setting/store.d.ts +8 -10
- package/lib/modules/setting/store.js +22 -20
- package/lib/modules/share-screen/components/selection/index.js +18 -42
- package/lib/modules/share-screen/index.d.ts +6 -2
- package/lib/modules/share-screen/index.js +4 -2
- package/lib/modules/share-screen/store.d.ts +41 -46
- package/lib/modules/share-screen/store.js +297 -718
- package/lib/modules/share-screen/view.js +2 -2
- package/lib/modules/state-bar/assets/fcr_grid_big.svg +1 -1
- package/lib/modules/state-bar/assets/fcr_listontop_big.svg +1 -1
- package/lib/modules/state-bar/index.css +8 -6
- package/lib/modules/state-bar/index.d.ts +4 -0
- package/lib/modules/state-bar/index.js +3 -1
- package/lib/modules/state-bar/layout-config.d.ts +1 -0
- package/lib/modules/state-bar/layout-config.js +15 -5
- package/lib/modules/state-bar/store.d.ts +9 -1
- package/lib/modules/state-bar/store.js +17 -2
- package/lib/modules/state-bar/view.js +9 -4
- package/lib/modules/video-window/components/members/index.js +2 -1
- package/lib/modules/waiting-room-layout/store.js +1 -1
- package/lib/modules/whiteboard/components/control-bar/store.d.ts +5 -1
- package/lib/modules/whiteboard/components/control-bar/store.js +10 -1
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/picker.js +16 -5
- package/lib/modules/whiteboard/components/toolbar/components/eraser-picker.js +67 -12
- package/lib/modules/whiteboard/components/toolbar/components/expansion/index.js +22 -2
- package/lib/modules/whiteboard/components/toolbar/components/history.js +46 -14
- package/lib/modules/whiteboard/components/toolbar/components/item/index.js +3 -2
- package/lib/modules/whiteboard/components/toolbar/components/move-handle.js +1 -1
- package/lib/modules/whiteboard/components/toolbar/components/pen-picker.js +58 -16
- package/lib/modules/whiteboard/components/toolbar/components/screen-capture-picker.js +15 -4
- package/lib/modules/whiteboard/components/toolbar/components/shape-picker.js +45 -2
- package/lib/modules/whiteboard/components/toolbar/hooks/index.d.ts +14 -0
- package/lib/modules/whiteboard/components/toolbar/hooks/index.js +235 -7
- package/lib/modules/whiteboard/components/toolbar/index.d.ts +1 -1
- package/lib/modules/whiteboard/components/toolbar/index.js +1 -1
- package/lib/modules/whiteboard/components/toolbar/store.d.ts +13 -2
- package/lib/modules/whiteboard/components/toolbar/store.js +74 -24
- package/lib/modules/whiteboard/components/toolbar/{ style.css → style.css} +1 -0
- package/lib/modules/whiteboard/index.d.ts +2 -0
- package/lib/modules/whiteboard/index.js +22 -21
- package/lib/modules/whiteboard/style.css +0 -4
- package/lib/modules/whiteboard/view.js +8 -2
- package/lib/plugins/browser-runtime-plugin.js +10 -1
- package/lib/providers/annotation-provider.d.ts +128 -0
- package/lib/providers/annotation-provider.js +421 -0
- package/lib/providers/device-provider.d.ts +3 -3
- package/lib/providers/device-provider.js +8 -6
- package/lib/providers/event-provider.d.ts +3 -3
- package/lib/providers/interpreter-provider.d.ts +1 -0
- package/lib/providers/interpreter-provider.js +182 -154
- package/lib/providers/privilege-provider.d.ts +35 -6
- package/lib/providers/privilege-provider.js +105 -49
- package/lib/providers/renderer-provider.js +3 -7
- package/lib/providers/room-provider.d.ts +13 -1
- package/lib/providers/room-provider.js +21 -7
- package/lib/providers/screen-share-provider.d.ts +131 -34
- package/lib/providers/screen-share-provider.js +554 -173
- package/lib/providers/sharing-provider.d.ts +37 -0
- package/lib/{shared-data-source/screen-share-data-source.js → providers/sharing-provider.js} +102 -39
- package/lib/providers/user-setting-storage-provider.d.ts +20 -0
- package/lib/providers/user-setting-storage-provider.js +74 -0
- package/lib/runtime.d.ts +6 -1
- package/lib/scenes/main-scene.d.ts +7 -2
- package/lib/scenes/main-scene.js +55 -27
- package/lib/scenes/waiting-scene.d.ts +6 -0
- package/lib/scenes/waiting-scene.js +15 -5
- package/lib/shared-data-source/config.d.ts +1 -5
- package/lib/shared-data-source/config.js +11 -81
- package/lib/shared-data-source/member-data.d.ts +21 -5
- package/lib/shared-data-source/member-data.js +69 -17
- package/lib/shared-data-source/screen-share-data.d.ts +274 -0
- package/lib/shared-data-source/screen-share-data.js +390 -0
- package/lib/shared-data-source/security-data.d.ts +4 -1
- package/lib/shared-data-source/security-data.js +5 -2
- package/lib/shared-data-source/setting.d.ts +13 -13
- package/lib/shared-data-source/setting.js +16 -10
- package/lib/shared-data-source/video-window.d.ts +2 -1
- package/lib/shared-data-source/video-window.js +56 -36
- package/lib/translations/enUS.d.ts +8 -0
- package/lib/translations/enUS.js +9 -1
- package/lib/translations/zhCN.d.ts +8 -0
- package/lib/translations/zhCN.js +11 -3
- package/lib/type.d.ts +55 -1
- package/lib/ui-manager.d.ts +3 -2
- package/lib/ui-manager.js +6 -4
- package/lib/ui-scene.js +70 -50
- package/lib/utilities/constant.d.ts +10 -2
- package/lib/utilities/constant.js +8 -0
- package/lib/utilities/logger.d.ts +4 -0
- package/lib/utilities/logger.js +8 -1
- package/lib/utilities/renderer-event.d.ts +3 -0
- package/lib/utilities/renderer-event.js +14 -1
- package/lib/utilities/screen.js +2 -1
- package/lib/utilities/setting-config-storage.d.ts +5 -6
- package/lib/utilities/setting-config-storage.js +33 -39
- package/lib/utilities/tools.d.ts +19 -1
- package/lib/utilities/tools.js +51 -4
- package/package.json +9 -7
- package/public/assets/cursors/fcr_whiteboard_input.ico +0 -0
- package/public/assets/cursors/fcr_whiteboard_pen.ico +0 -0
- package/public/assets/cursors/fcr_whiteboard_shape_-straightline.ico +0 -0
- package/public/assets/cursors/fcr_whiteboard_shape_arrow.ico +0 -0
- package/public/assets/cursors/fcr_whiteboard_shape_circle.ico +0 -0
- package/public/assets/cursors/fcr_whiteboard_shape_rectangle.ico +0 -0
- package/public/assets/cursors/fcr_whiteboard_shape_triangle.ico +0 -0
- package/public/assets/fcr_chat_reddot.svg +3 -3
- package/public/assets/fcr_grid_big.svg +1 -1
- package/public/assets/fcr_leave2.svg +14 -14
- package/public/assets/fcr_listontop_big.svg +1 -1
- package/public/assets/step-gradient.svg +1 -1
- package/public/fragment.html +10 -0
- package/public/index.html +3 -1
- package/lib/shared-data-source/screen-share-data-source.d.ts +0 -37
|
@@ -0,0 +1,565 @@
|
|
|
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.for-each.js");
|
|
10
|
+
require("core-js/modules/es.array.is-array.js");
|
|
11
|
+
require("core-js/modules/es.array.push.js");
|
|
12
|
+
require("core-js/modules/es.date.to-primitive.js");
|
|
13
|
+
require("core-js/modules/es.function.bind.js");
|
|
14
|
+
require("core-js/modules/es.function.name.js");
|
|
15
|
+
require("core-js/modules/es.map.js");
|
|
16
|
+
require("core-js/modules/es.number.constructor.js");
|
|
17
|
+
require("core-js/modules/es.object.create.js");
|
|
18
|
+
require("core-js/modules/es.object.define-properties.js");
|
|
19
|
+
require("core-js/modules/es.object.define-property.js");
|
|
20
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
21
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
22
|
+
require("core-js/modules/esnext.async-iterator.filter.js");
|
|
23
|
+
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
24
|
+
require("core-js/modules/esnext.function.metadata.js");
|
|
25
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
26
|
+
require("core-js/modules/esnext.iterator.filter.js");
|
|
27
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
|
28
|
+
require("core-js/modules/esnext.map.delete-all.js");
|
|
29
|
+
require("core-js/modules/esnext.map.emplace.js");
|
|
30
|
+
require("core-js/modules/esnext.map.every.js");
|
|
31
|
+
require("core-js/modules/esnext.map.filter.js");
|
|
32
|
+
require("core-js/modules/esnext.map.find.js");
|
|
33
|
+
require("core-js/modules/esnext.map.find-key.js");
|
|
34
|
+
require("core-js/modules/esnext.map.includes.js");
|
|
35
|
+
require("core-js/modules/esnext.map.key-of.js");
|
|
36
|
+
require("core-js/modules/esnext.map.map-keys.js");
|
|
37
|
+
require("core-js/modules/esnext.map.map-values.js");
|
|
38
|
+
require("core-js/modules/esnext.map.merge.js");
|
|
39
|
+
require("core-js/modules/esnext.map.reduce.js");
|
|
40
|
+
require("core-js/modules/esnext.map.some.js");
|
|
41
|
+
require("core-js/modules/esnext.map.update.js");
|
|
42
|
+
require("core-js/modules/esnext.symbol.metadata.js");
|
|
43
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
44
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
45
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
46
|
+
Object.defineProperty(exports, "__esModule", {
|
|
47
|
+
value: true
|
|
48
|
+
});
|
|
49
|
+
exports["default"] = exports.AnnotationStoreContext = void 0;
|
|
50
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
51
|
+
require("core-js/modules/es.array.concat.js");
|
|
52
|
+
require("core-js/modules/es.array.iterator.js");
|
|
53
|
+
require("core-js/modules/es.date.to-json.js");
|
|
54
|
+
require("core-js/modules/es.json.stringify.js");
|
|
55
|
+
require("core-js/modules/es.object.keys.js");
|
|
56
|
+
require("core-js/modules/es.object.to-string.js");
|
|
57
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
58
|
+
require("core-js/modules/es.string.iterator.js");
|
|
59
|
+
require("core-js/modules/es.weak-map.js");
|
|
60
|
+
require("core-js/modules/esnext.json.parse.js");
|
|
61
|
+
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
62
|
+
require("core-js/modules/esnext.weak-map.emplace.js");
|
|
63
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
64
|
+
require("core-js/modules/web.timers.js");
|
|
65
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
66
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
67
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
68
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
69
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
70
|
+
var _react = require("react");
|
|
71
|
+
var _forgeRoom = require("@netless/forge-room");
|
|
72
|
+
var _forgeWhiteboard = require("@netless/forge-whiteboard");
|
|
73
|
+
var _forgeRtm = require("@netless/forge-rtm");
|
|
74
|
+
var _mobx = require("mobx");
|
|
75
|
+
var _type = require("../../modules/whiteboard/type");
|
|
76
|
+
var _fcrCore = require("fcr-core");
|
|
77
|
+
var _decorator = require("agora-foundation/lib/decorator");
|
|
78
|
+
var _libs = require("./libs");
|
|
79
|
+
var _rendererEvent = require("../../utilities/renderer-event");
|
|
80
|
+
var _constant = require("../../utilities/constant");
|
|
81
|
+
var _asyncRetry = require("agora-foundation/lib/utilities/async-retry");
|
|
82
|
+
var _logger = require("../../utilities/logger");
|
|
83
|
+
var _platform = require("../../utilities/platform");
|
|
84
|
+
var _AnnotationStore;
|
|
85
|
+
var _initProto, _init_joined, _init_bounds, _init_currentTool, _handleBoardDomLoadDecs, _closeDecs, _handleSetToolDecs, _ref;
|
|
86
|
+
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; }
|
|
87
|
+
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; }
|
|
88
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
89
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
90
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
91
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
92
|
+
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
|
+
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)]; } }; }
|
|
94
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
95
|
+
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); }
|
|
96
|
+
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; }
|
|
97
|
+
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; }
|
|
98
|
+
var _A = /*#__PURE__*/new WeakMap();
|
|
99
|
+
var _B = /*#__PURE__*/new WeakMap();
|
|
100
|
+
var _C = /*#__PURE__*/new WeakMap();
|
|
101
|
+
_ref = (_handleBoardDomLoadDecs = [_mobx.action, _mobx.action.bound], _closeDecs = [_mobx.action, _mobx.action.bound], _handleSetToolDecs = [(0, _decorator.debounced)(300), _decorator.bound], "logger");
|
|
102
|
+
var AnnotationStore = /*#__PURE__*/function () {
|
|
103
|
+
function AnnotationStore() {
|
|
104
|
+
(0, _classCallCheck2["default"])(this, AnnotationStore);
|
|
105
|
+
(0, _defineProperty2["default"])(this, _ref, (_initProto(this), (0, _logger.createFragmentLogger)({
|
|
106
|
+
prefix: 'AnnotationFragmentStore'
|
|
107
|
+
})));
|
|
108
|
+
(0, _defineProperty2["default"])(this, "_engine", null);
|
|
109
|
+
(0, _defineProperty2["default"])(this, "_FORGE_WHITEBOARD_APP_ID", 'Annotation');
|
|
110
|
+
(0, _defineProperty2["default"])(this, "_boardInstance", null);
|
|
111
|
+
(0, _defineProperty2["default"])(this, "_boardRoom", null);
|
|
112
|
+
(0, _defineProperty2["default"])(this, "_boardView", document.createElement('div'));
|
|
113
|
+
_classPrivateFieldInitSpec(this, _A, _init_joined(this, false));
|
|
114
|
+
_classPrivateFieldInitSpec(this, _B, _init_bounds(this, {
|
|
115
|
+
x: 0,
|
|
116
|
+
y: 0,
|
|
117
|
+
width: 800,
|
|
118
|
+
height: 600
|
|
119
|
+
}));
|
|
120
|
+
_classPrivateFieldInitSpec(this, _C, _init_currentTool(this, 'none'));
|
|
121
|
+
(0, _defineProperty2["default"])(this, "timer", null);
|
|
122
|
+
var annotationRtmAppId = localStorage.getItem('annotation_rtm_app_id') || '';
|
|
123
|
+
var boardOptions = localStorage.getItem('board_options');
|
|
124
|
+
var appId = JSON.parse(annotationRtmAppId);
|
|
125
|
+
this.logger.info("annotationRtmAppId => ".concat(appId));
|
|
126
|
+
var _JSON$parse = JSON.parse(boardOptions || '{}'),
|
|
127
|
+
boardAppId = _JSON$parse.boardAppId,
|
|
128
|
+
boardId = _JSON$parse.boardId,
|
|
129
|
+
boardRegion = _JSON$parse.boardRegion,
|
|
130
|
+
boardToken = _JSON$parse.boardToken,
|
|
131
|
+
boardUserToken = _JSON$parse.boardUserToken,
|
|
132
|
+
userId = _JSON$parse.boardUserUuid;
|
|
133
|
+
this._config = {
|
|
134
|
+
appId: appId,
|
|
135
|
+
userId: userId,
|
|
136
|
+
region: boardRegion,
|
|
137
|
+
appIdentifier: boardAppId,
|
|
138
|
+
boardId: boardId,
|
|
139
|
+
boardToken: boardToken
|
|
140
|
+
};
|
|
141
|
+
this.logger.info("boardinfo => ".concat(JSON.stringify(this._config)));
|
|
142
|
+
this._init(this._initEngine({
|
|
143
|
+
userId: userId,
|
|
144
|
+
roomToken: boardUserToken,
|
|
145
|
+
appId: appId
|
|
146
|
+
}));
|
|
147
|
+
}
|
|
148
|
+
return (0, _createClass2["default"])(AnnotationStore, [{
|
|
149
|
+
key: "joined",
|
|
150
|
+
get: function get() {
|
|
151
|
+
return _classPrivateFieldGet(_A, this);
|
|
152
|
+
},
|
|
153
|
+
set: function set(v) {
|
|
154
|
+
_classPrivateFieldSet(_A, this, v);
|
|
155
|
+
}
|
|
156
|
+
}, {
|
|
157
|
+
key: "bounds",
|
|
158
|
+
get: function get() {
|
|
159
|
+
return _classPrivateFieldGet(_B, this);
|
|
160
|
+
},
|
|
161
|
+
set: function set(v) {
|
|
162
|
+
_classPrivateFieldSet(_B, this, v);
|
|
163
|
+
}
|
|
164
|
+
}, {
|
|
165
|
+
key: "currentTool",
|
|
166
|
+
get: function get() {
|
|
167
|
+
return _classPrivateFieldGet(_C, this);
|
|
168
|
+
},
|
|
169
|
+
set: function set(v) {
|
|
170
|
+
_classPrivateFieldSet(_C, this, v);
|
|
171
|
+
}
|
|
172
|
+
}, {
|
|
173
|
+
key: "open",
|
|
174
|
+
value: function () {
|
|
175
|
+
var _open = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
176
|
+
var visible, whiteboard, _this$_boardDom;
|
|
177
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
178
|
+
while (1) switch (_context.prev = _context.next) {
|
|
179
|
+
case 0:
|
|
180
|
+
this.logger.info("[annotation][open]: open method is called, the init bounds is =>, ".concat(JSON.stringify(this.bounds)));
|
|
181
|
+
this.currentTool = 'curve';
|
|
182
|
+
window.runtime.browserWindow.setAlwaysOnTop(true, 'pop-up-menu');
|
|
183
|
+
(0, _platform.isWindows)() && window.runtime.browserWindow.blur();
|
|
184
|
+
this.setIgnore(true);
|
|
185
|
+
visible = window.runtime.browserWindow.isVisible();
|
|
186
|
+
this.logger.info("[annotation][open]: the annotation window visible is =>\n ".concat(visible, ", open process is ").concat(visible ? 'return' : 'continue...'));
|
|
187
|
+
if (!window.runtime.browserWindow.isVisible()) {
|
|
188
|
+
_context.next = 9;
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
return _context.abrupt("return");
|
|
192
|
+
case 9:
|
|
193
|
+
if (this._engine) {
|
|
194
|
+
_context.next = 14;
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
this.logger.info('[annotation][open]: this._engine is null');
|
|
198
|
+
return _context.abrupt("return");
|
|
199
|
+
case 14:
|
|
200
|
+
this.logger.info('[annotation][open]: this._engine is initialized, show annotation window');
|
|
201
|
+
window.runtime.browserWindow.show();
|
|
202
|
+
case 16:
|
|
203
|
+
this.logger.info("[annotation][open]: this._joined ".concat(this.joined));
|
|
204
|
+
if (!this.joined) {
|
|
205
|
+
_context.next = 19;
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
return _context.abrupt("return");
|
|
209
|
+
case 19:
|
|
210
|
+
if (this._boardRoom) {
|
|
211
|
+
_context.next = 22;
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
_context.next = 22;
|
|
215
|
+
return this._initBoardRoom();
|
|
216
|
+
case 22:
|
|
217
|
+
if (this._boardRoom) {
|
|
218
|
+
_context.next = 24;
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
return _context.abrupt("return", this.logger.error("[annotation][open]: this._boardRoom is not initialized, ".concat(this._boardRoom)));
|
|
222
|
+
case 24:
|
|
223
|
+
_context.next = 26;
|
|
224
|
+
return this._boardRoom.applicationManager.launchApplication(_forgeWhiteboard.WhiteboardApplication, {
|
|
225
|
+
width: this.bounds.width,
|
|
226
|
+
height: this.bounds.height,
|
|
227
|
+
defaultToolbarStyle: {
|
|
228
|
+
tool: 'curve',
|
|
229
|
+
strokeColor: '#FFC908',
|
|
230
|
+
strokeWidth: 2
|
|
231
|
+
}
|
|
232
|
+
}, this._FORGE_WHITEBOARD_APP_ID);
|
|
233
|
+
case 26:
|
|
234
|
+
whiteboard = _context.sent;
|
|
235
|
+
this.logger.info("[annotation][open]: whiteboard launch success");
|
|
236
|
+
if (whiteboard) {
|
|
237
|
+
this._boardView.classList.add('fcr-whiteboard-window-view');
|
|
238
|
+
this._boardView.appendChild(whiteboard.view);
|
|
239
|
+
(_this$_boardDom = this._boardDom) === null || _this$_boardDom === void 0 || _this$_boardDom.appendChild(this._boardView);
|
|
240
|
+
this._boardInstance = whiteboard;
|
|
241
|
+
this._initBoardStyle(whiteboard);
|
|
242
|
+
this.joined = true;
|
|
243
|
+
this.logger.info("[annotation][open]: mount success, the joined is ".concat(this.joined));
|
|
244
|
+
}
|
|
245
|
+
this._boardRoom.applicationManager.on('launch', this._launchHandler);
|
|
246
|
+
this._boardRoom.applicationManager.on('terminal', this._terminalHandler);
|
|
247
|
+
case 31:
|
|
248
|
+
case "end":
|
|
249
|
+
return _context.stop();
|
|
250
|
+
}
|
|
251
|
+
}, _callee, this);
|
|
252
|
+
}));
|
|
253
|
+
function open() {
|
|
254
|
+
return _open.apply(this, arguments);
|
|
255
|
+
}
|
|
256
|
+
return open;
|
|
257
|
+
}()
|
|
258
|
+
}, {
|
|
259
|
+
key: "handleBoardDomLoad",
|
|
260
|
+
value: function handleBoardDomLoad(dom) {
|
|
261
|
+
this._boardDom = dom;
|
|
262
|
+
}
|
|
263
|
+
}, {
|
|
264
|
+
key: "close",
|
|
265
|
+
value: function () {
|
|
266
|
+
var _close = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
267
|
+
var _this$_boardInstance, _this$_boardInstance2, _this$_boardInstance3, _this$_boardRoom, _this$_boardRoom2, _this$_boardRoom3, _this$_boardRoom4;
|
|
268
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
269
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
270
|
+
case 0:
|
|
271
|
+
this.joined = false;
|
|
272
|
+
this.currentTool = 'curve';
|
|
273
|
+
(_this$_boardInstance = this._boardInstance) === null || _this$_boardInstance === void 0 || _this$_boardInstance.clearPage();
|
|
274
|
+
((_this$_boardInstance2 = this._boardInstance) === null || _this$_boardInstance2 === void 0 ? void 0 : _this$_boardInstance2.view) && this._boardView.removeChild((_this$_boardInstance3 = this._boardInstance) === null || _this$_boardInstance3 === void 0 ? void 0 : _this$_boardInstance3.view);
|
|
275
|
+
(_this$_boardRoom = this._boardRoom) === null || _this$_boardRoom === void 0 || _this$_boardRoom.applicationManager.removeListener('launch', this._launchHandler);
|
|
276
|
+
(_this$_boardRoom2 = this._boardRoom) === null || _this$_boardRoom2 === void 0 || _this$_boardRoom2.applicationManager.removeListener('terminal', this._terminalHandler);
|
|
277
|
+
(_this$_boardRoom3 = this._boardRoom) === null || _this$_boardRoom3 === void 0 || _this$_boardRoom3.applicationManager.terminateApplication(this._FORGE_WHITEBOARD_APP_ID);
|
|
278
|
+
_context2.next = 9;
|
|
279
|
+
return (_this$_boardRoom4 = this._boardRoom) === null || _this$_boardRoom4 === void 0 ? void 0 : _this$_boardRoom4.leaveRoom();
|
|
280
|
+
case 9:
|
|
281
|
+
this._boardRoom = null;
|
|
282
|
+
this._boardInstance = null;
|
|
283
|
+
window.runtime.browserWindow.hide();
|
|
284
|
+
this.logger.info('[annotation][open]: close annotation window');
|
|
285
|
+
case 13:
|
|
286
|
+
case "end":
|
|
287
|
+
return _context2.stop();
|
|
288
|
+
}
|
|
289
|
+
}, _callee2, this);
|
|
290
|
+
}));
|
|
291
|
+
function close() {
|
|
292
|
+
return _close.apply(this, arguments);
|
|
293
|
+
}
|
|
294
|
+
return close;
|
|
295
|
+
}()
|
|
296
|
+
}, {
|
|
297
|
+
key: "setBounds",
|
|
298
|
+
value: function setBounds(bounds) {
|
|
299
|
+
this.bounds = bounds;
|
|
300
|
+
this.logger.info("[annotation][setBounds]: bounds is changed =>, ".concat(JSON.stringify(bounds)));
|
|
301
|
+
window.runtime.browserWindow.setBounds(bounds);
|
|
302
|
+
}
|
|
303
|
+
}, {
|
|
304
|
+
key: "setIgnore",
|
|
305
|
+
value: function setIgnore(ignore) {
|
|
306
|
+
this.logger.info("[annotation][setIgnore]: setIgnore method is called, the ignore is => ".concat(ignore));
|
|
307
|
+
window.runtime.browserWindow.setIgnoreMouseEvents(ignore);
|
|
308
|
+
}
|
|
309
|
+
}, {
|
|
310
|
+
key: "toolChanged",
|
|
311
|
+
value: function toolChanged(event) {
|
|
312
|
+
if (!this._boardInstance) return;
|
|
313
|
+
this.logger.info("[annotation][toolChanged]: toolChanged method is called, the event is => ".concat(JSON.stringify(event)));
|
|
314
|
+
var board = this._boardInstance;
|
|
315
|
+
var payload = event.payload;
|
|
316
|
+
switch (event.action) {
|
|
317
|
+
case _type.ToolbarEvents.SET_TOOL:
|
|
318
|
+
this._handleSetTool(payload);
|
|
319
|
+
break;
|
|
320
|
+
case _type.ToolbarEvents.SET_STROKE_COLOR:
|
|
321
|
+
board.strokeColor = payload;
|
|
322
|
+
break;
|
|
323
|
+
case _type.ToolbarEvents.SET_STROKE_WIDTH:
|
|
324
|
+
this._boardInstance.strokeWidth = payload;
|
|
325
|
+
break;
|
|
326
|
+
case _type.ToolbarEvents.CLEAN:
|
|
327
|
+
board.clearPage();
|
|
328
|
+
break;
|
|
329
|
+
case _type.ToolbarEvents.REDO:
|
|
330
|
+
board.redo();
|
|
331
|
+
break;
|
|
332
|
+
case _type.ToolbarEvents.UNDO:
|
|
333
|
+
board.undo();
|
|
334
|
+
break;
|
|
335
|
+
case _type.ToolbarEvents.SET_PEN:
|
|
336
|
+
board.setInputType('pen');
|
|
337
|
+
break;
|
|
338
|
+
case _type.ToolbarEvents.SET_SHAPE:
|
|
339
|
+
board.setCurrentTool((0, _libs.convertTool)(payload));
|
|
340
|
+
break;
|
|
341
|
+
// case ToolbarEvents.CAPTURE_SCREEN:
|
|
342
|
+
// window.runtime.captureScreen({ hideWindow: true });
|
|
343
|
+
// break;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}, {
|
|
347
|
+
key: "_initBoardStyle",
|
|
348
|
+
value: function _initBoardStyle(whiteboard) {
|
|
349
|
+
var _this$_boardDom2, _this$_boardDom3;
|
|
350
|
+
var frameWidth = (_this$_boardDom2 = this._boardDom) === null || _this$_boardDom2 === void 0 ? void 0 : _this$_boardDom2.offsetWidth;
|
|
351
|
+
var frameHeight = (_this$_boardDom3 = this._boardDom) === null || _this$_boardDom3 === void 0 ? void 0 : _this$_boardDom3.offsetHeight;
|
|
352
|
+
this._boardView.style.width = "".concat(frameWidth, "px");
|
|
353
|
+
this._boardView.style.height = "".concat(frameHeight, "px");
|
|
354
|
+
whiteboard.view.style.height = "".concat(frameHeight, "px");
|
|
355
|
+
whiteboard.view.style.width = "".concat(frameWidth, "px");
|
|
356
|
+
whiteboard.setCanvasBackgroundColor('rgba(0, 0, 0, 0)');
|
|
357
|
+
whiteboard.enableCameraByMouse = false;
|
|
358
|
+
whiteboard.enableCameraByTouch = false;
|
|
359
|
+
// whiteboard.cameraBoundaryColor = 'rgba(0, 0, 0, 0)';
|
|
360
|
+
whiteboard.enableCameraBoundaryHighlight = false;
|
|
361
|
+
whiteboard.strokeColor = '#FFC908';
|
|
362
|
+
whiteboard.setCurrentTool('curve');
|
|
363
|
+
whiteboard.on('undoStackLength', function (steps) {
|
|
364
|
+
(0, _platform.isWindows)() && window.runtime.browserWindow.blur();
|
|
365
|
+
(0, _rendererEvent.sendEvent)({
|
|
366
|
+
action: _constant.FcrUIRendererEventAction.SET_ANNOTATION_UNDO,
|
|
367
|
+
payload: steps > 0
|
|
368
|
+
});
|
|
369
|
+
});
|
|
370
|
+
whiteboard.on('redoStackLength', function (steps) {
|
|
371
|
+
(0, _platform.isWindows)() && window.runtime.browserWindow.blur();
|
|
372
|
+
(0, _rendererEvent.sendEvent)({
|
|
373
|
+
action: _constant.FcrUIRendererEventAction.SET_ANNOTATION_REDO,
|
|
374
|
+
payload: steps > 0
|
|
375
|
+
});
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
}, {
|
|
379
|
+
key: "_handleSetTool",
|
|
380
|
+
value: function _handleSetTool(payload) {
|
|
381
|
+
var _this = this;
|
|
382
|
+
var board = this._boardInstance;
|
|
383
|
+
this.currentTool = 'none';
|
|
384
|
+
var currentTool = (0, _libs.convertTool)(payload);
|
|
385
|
+
if (board) {
|
|
386
|
+
board.setCurrentTool(currentTool);
|
|
387
|
+
var timber = setTimeout(function () {
|
|
388
|
+
var _this$_boardDom4;
|
|
389
|
+
(_this$_boardDom4 = _this._boardDom) === null || _this$_boardDom4 === void 0 || _this$_boardDom4.getBoundingClientRect();
|
|
390
|
+
_this.currentTool = currentTool;
|
|
391
|
+
clearTimeout(timber);
|
|
392
|
+
}, 600);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}, {
|
|
396
|
+
key: "_init",
|
|
397
|
+
value: function () {
|
|
398
|
+
var _init2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(engine) {
|
|
399
|
+
var _this2 = this;
|
|
400
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
401
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
402
|
+
case 0:
|
|
403
|
+
engine.login();
|
|
404
|
+
engine.addObserver({
|
|
405
|
+
onConnectionStateUpdated: function onConnectionStateUpdated(state) {
|
|
406
|
+
if (state === _fcrCore.FcrConnectionState.CONNECTED) {
|
|
407
|
+
_this2._engine = engine;
|
|
408
|
+
_this2.logger.info("[annotation][initEngine]: engine connection state updated => CONNECTED");
|
|
409
|
+
}
|
|
410
|
+
if (state === _fcrCore.FcrConnectionState.DISCONNECTED) {
|
|
411
|
+
_this2.logger.info("[annotation][initEngine]: engine connection state updated => DISCONNECTED, the engine is ".concat(_this2._engine));
|
|
412
|
+
!_this2._engine && engine.login();
|
|
413
|
+
}
|
|
414
|
+
if (state === _fcrCore.FcrConnectionState.CONNECTING) {
|
|
415
|
+
_this2.logger.info("[annotation][initEngine]: engine connection state updated => CONNECTING");
|
|
416
|
+
}
|
|
417
|
+
if (state === _fcrCore.FcrConnectionState.RECONNECTING) {
|
|
418
|
+
_this2.logger.info("[annotation][initEngine]: engine connection state updated => RECONNECTING");
|
|
419
|
+
}
|
|
420
|
+
if (state === _fcrCore.FcrConnectionState.ABORTED) {
|
|
421
|
+
_this2.logger.info("[annotation][initEngine]: engine connection state updated => ABORTED, the engine is ".concat(_this2._engine));
|
|
422
|
+
!_this2._engine && engine.login();
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
case 2:
|
|
427
|
+
case "end":
|
|
428
|
+
return _context3.stop();
|
|
429
|
+
}
|
|
430
|
+
}, _callee3);
|
|
431
|
+
}));
|
|
432
|
+
function _init(_x) {
|
|
433
|
+
return _init2.apply(this, arguments);
|
|
434
|
+
}
|
|
435
|
+
return _init;
|
|
436
|
+
}()
|
|
437
|
+
}, {
|
|
438
|
+
key: "_initBoardRoom",
|
|
439
|
+
value: function () {
|
|
440
|
+
var _initBoardRoom2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6() {
|
|
441
|
+
var _this3 = this;
|
|
442
|
+
var _this$_config, userId, boardToken, region, appIdentifier, boardId, nickName, rtmClient, rtmProvider, wbRoom, retriesMax;
|
|
443
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
444
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
445
|
+
case 0:
|
|
446
|
+
_this$_config = this._config, userId = _this$_config.userId, boardToken = _this$_config.boardToken, region = _this$_config.region, appIdentifier = _this$_config.appIdentifier, boardId = _this$_config.boardId;
|
|
447
|
+
nickName = localStorage.getItem('annotation_nickname') || '';
|
|
448
|
+
this.logger.info("[annotation][initBoardRoom]: start init board room with config => ".concat(JSON.stringify(this._config), " - ").concat(nickName));
|
|
449
|
+
// @ts-ignore
|
|
450
|
+
rtmClient = this._engine._rteEngine._rtmClient._client;
|
|
451
|
+
rtmProvider = new _forgeRtm.RTMProvider_2_2(rtmClient);
|
|
452
|
+
wbRoom = new _forgeRoom.Room(boardId, rtmProvider);
|
|
453
|
+
this._boardRoom = wbRoom;
|
|
454
|
+
wbRoom.applicationManager.registerApplication(_forgeWhiteboard.WhiteboardApplication);
|
|
455
|
+
this.logger.info("[annotation][initBoardRoom]: bordRoom instance is created, start join room");
|
|
456
|
+
_context6.prev = 9;
|
|
457
|
+
retriesMax = 10;
|
|
458
|
+
_context6.next = 13;
|
|
459
|
+
return (0, _asyncRetry.retryAttempt)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
460
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
461
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
462
|
+
case 0:
|
|
463
|
+
_context4.next = 2;
|
|
464
|
+
return wbRoom.joinRoom({
|
|
465
|
+
userId: userId,
|
|
466
|
+
nickName: nickName,
|
|
467
|
+
roomToken: boardToken,
|
|
468
|
+
sdkConfig: {
|
|
469
|
+
// @ts-ignore
|
|
470
|
+
region: region,
|
|
471
|
+
appIdentifier: appIdentifier
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
case 2:
|
|
475
|
+
_this3.logger.info("[annotation][initBoardRoom]: join room success");
|
|
476
|
+
case 3:
|
|
477
|
+
case "end":
|
|
478
|
+
return _context4.stop();
|
|
479
|
+
}
|
|
480
|
+
}, _callee4);
|
|
481
|
+
})), [], {
|
|
482
|
+
retriesMax: retriesMax
|
|
483
|
+
}).fail(/*#__PURE__*/function () {
|
|
484
|
+
var _ref4 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(_ref3) {
|
|
485
|
+
var error, timeFn, currentRetry;
|
|
486
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
487
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
488
|
+
case 0:
|
|
489
|
+
error = _ref3.error, timeFn = _ref3.timeFn, currentRetry = _ref3.currentRetry;
|
|
490
|
+
_this3.logger.info("[annotation][initBoardRoom]: retry to join board room, ".concat(error.message, ", retry ").concat(currentRetry, " times"));
|
|
491
|
+
_context5.next = 4;
|
|
492
|
+
return timeFn();
|
|
493
|
+
case 4:
|
|
494
|
+
return _context5.abrupt("return", true);
|
|
495
|
+
case 5:
|
|
496
|
+
case "end":
|
|
497
|
+
return _context5.stop();
|
|
498
|
+
}
|
|
499
|
+
}, _callee5);
|
|
500
|
+
}));
|
|
501
|
+
return function (_x2) {
|
|
502
|
+
return _ref4.apply(this, arguments);
|
|
503
|
+
};
|
|
504
|
+
}()).exec();
|
|
505
|
+
case 13:
|
|
506
|
+
_context6.next = 18;
|
|
507
|
+
break;
|
|
508
|
+
case 15:
|
|
509
|
+
_context6.prev = 15;
|
|
510
|
+
_context6.t0 = _context6["catch"](9);
|
|
511
|
+
this.logger.error("[annotation][initBoardRoom]: join room failed");
|
|
512
|
+
case 18:
|
|
513
|
+
case "end":
|
|
514
|
+
return _context6.stop();
|
|
515
|
+
}
|
|
516
|
+
}, _callee6, this, [[9, 15]]);
|
|
517
|
+
}));
|
|
518
|
+
function _initBoardRoom() {
|
|
519
|
+
return _initBoardRoom2.apply(this, arguments);
|
|
520
|
+
}
|
|
521
|
+
return _initBoardRoom;
|
|
522
|
+
}()
|
|
523
|
+
}, {
|
|
524
|
+
key: "_initEngine",
|
|
525
|
+
value: function _initEngine(config) {
|
|
526
|
+
var userId = config.userId,
|
|
527
|
+
token = config.roomToken,
|
|
528
|
+
appId = config.appId;
|
|
529
|
+
this.logger.info("[annotation][initEngine]: init engine with config => ".concat(JSON.stringify(config)));
|
|
530
|
+
return new _fcrCore.FcrCoreEngine(_objectSpread({
|
|
531
|
+
appId: appId,
|
|
532
|
+
token: token,
|
|
533
|
+
userId: userId,
|
|
534
|
+
region: _fcrCore.FcrRegion.CN
|
|
535
|
+
}, _libs.engineRestConfig));
|
|
536
|
+
}
|
|
537
|
+
}, {
|
|
538
|
+
key: "_launchHandler",
|
|
539
|
+
value: function _launchHandler(appId, app) {
|
|
540
|
+
if (appId === this._FORGE_WHITEBOARD_APP_ID) {
|
|
541
|
+
var _this$_boardView;
|
|
542
|
+
this.logger.info("[annotation][event]: launch event is triggered => ".concat(app.selfUserId));
|
|
543
|
+
app.view && ((_this$_boardView = this._boardView) === null || _this$_boardView === void 0 ? void 0 : _this$_boardView.appendChild(app.view));
|
|
544
|
+
this._initBoardStyle(app);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}, {
|
|
548
|
+
key: "_terminalHandler",
|
|
549
|
+
value: function _terminalHandler(appId, app) {
|
|
550
|
+
if (appId === this._FORGE_WHITEBOARD_APP_ID) {
|
|
551
|
+
var _this$_boardView2;
|
|
552
|
+
this.logger.info("[annotation][event]: terminal event is triggered => ".concat(app.selfUserId));
|
|
553
|
+
app.view && this._boardView.hasChildNodes() && ((_this$_boardView2 = this._boardView) === null || _this$_boardView2 === void 0 ? void 0 : _this$_boardView2.removeChild(app.view));
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}]);
|
|
557
|
+
}();
|
|
558
|
+
_AnnotationStore = AnnotationStore;
|
|
559
|
+
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_AnnotationStore, [[_mobx.observable, 1, "joined"], [_mobx.observable, 1, "bounds"], [_mobx.observable, 1, "currentTool"], [_decorator.bound, 2, "open"], [_handleBoardDomLoadDecs, 18, "handleBoardDomLoad"], [_closeDecs, 18, "close"], [_decorator.bound, 2, "setIgnore"], [_decorator.bound, 2, "toolChanged"], [_decorator.bound, 2, "_initBoardStyle"], [_handleSetToolDecs, 2, "_handleSetTool"], [_decorator.bound, 2, "_init"], [_decorator.bound, 2, "_initBoardRoom"], [_decorator.bound, 2, "_launchHandler"], [_decorator.bound, 2, "_terminalHandler"]], []).e, 4);
|
|
560
|
+
_init_joined = _applyDecs$e[0];
|
|
561
|
+
_init_bounds = _applyDecs$e[1];
|
|
562
|
+
_init_currentTool = _applyDecs$e[2];
|
|
563
|
+
_initProto = _applyDecs$e[3];
|
|
564
|
+
var _default = exports["default"] = AnnotationStore;
|
|
565
|
+
var AnnotationStoreContext = exports.AnnotationStoreContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _mobxReact = require("mobx-react");
|
|
10
|
+
var _react = require("react");
|
|
11
|
+
var _store = require("./store");
|
|
12
|
+
require("../../modules/annotation/board-cursor.css");
|
|
13
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
var View = (0, _mobxReact.observer)(function () {
|
|
16
|
+
var _useContext = (0, _react.useContext)(_store.AnnotationStoreContext),
|
|
17
|
+
handleBoardDomLoad = _useContext.handleBoardDomLoad,
|
|
18
|
+
currentTool = _useContext.currentTool;
|
|
19
|
+
var cursorClassname = "board-widget-cursor-".concat(currentTool);
|
|
20
|
+
var boardWidgetAppCls = (0, _classnames["default"])('board-widget-app', cursorClassname.toLowerCase());
|
|
21
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
22
|
+
className: boardWidgetAppCls,
|
|
23
|
+
style: {
|
|
24
|
+
width: '100vw',
|
|
25
|
+
height: '100vh',
|
|
26
|
+
overflow: 'hidden'
|
|
27
|
+
},
|
|
28
|
+
ref: handleBoardDomLoad
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
var _default = exports["default"] = View;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare abstract class BaseFragment implements Fragment {
|
|
2
|
+
protected runtime: Runtime;
|
|
3
|
+
protected logger: import("agora-foundation/lib/logger").Logger;
|
|
4
|
+
constructor(runtime: Runtime);
|
|
5
|
+
abstract get name(): string;
|
|
6
|
+
abstract get component(): JSX.Element;
|
|
7
|
+
protected sendEvent(event: RendererCustomEvent): void;
|
|
8
|
+
protected onEvent(event: RendererCustomEvent): void;
|
|
9
|
+
private _onLoad;
|
|
10
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.BaseFragment = void 0;
|
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
+
var _i18n = require("agora-ui-foundation/lib/i18n");
|
|
13
|
+
var _tools = require("../utilities/tools");
|
|
14
|
+
var _logger = require("agora-foundation/lib/logger");
|
|
15
|
+
var BaseFragment = exports.BaseFragment = /*#__PURE__*/function () {
|
|
16
|
+
function BaseFragment(runtime) {
|
|
17
|
+
(0, _classCallCheck2["default"])(this, BaseFragment);
|
|
18
|
+
(0, _defineProperty2["default"])(this, "logger", (0, _logger.getLogger)());
|
|
19
|
+
this.runtime = runtime;
|
|
20
|
+
this._onLoad();
|
|
21
|
+
}
|
|
22
|
+
return (0, _createClass2["default"])(BaseFragment, [{
|
|
23
|
+
key: "sendEvent",
|
|
24
|
+
value: function sendEvent(event) {
|
|
25
|
+
this.runtime.sendEvent(event);
|
|
26
|
+
}
|
|
27
|
+
}, {
|
|
28
|
+
key: "onEvent",
|
|
29
|
+
value: function onEvent(event) {}
|
|
30
|
+
}, {
|
|
31
|
+
key: "_onLoad",
|
|
32
|
+
value: function _onLoad() {
|
|
33
|
+
var _this = this;
|
|
34
|
+
var language = (0, _tools.getLanguage)();
|
|
35
|
+
if (language) {
|
|
36
|
+
this.logger.info('set language to:', language);
|
|
37
|
+
(0, _i18n.changeLanguage)(language);
|
|
38
|
+
}
|
|
39
|
+
this.runtime.addEventListener(function (_, event) {
|
|
40
|
+
_this.onEvent(event);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}]);
|
|
44
|
+
}();
|