From 93406bb12c4cc9bc9d891fc2a1b0eeae3e3bb6eb Mon Sep 17 00:00:00 2001 From: Mihaela Dumitru Date: Fri, 30 Sep 2022 17:50:45 +0300 Subject: [PATCH] feat(whiteboard) add initial implementation (#12185) --- Makefile | 16 +- config.js | 9 + css/_popover.scss | 4 + css/filmstrip/_tile_view_overrides.scss | 1 + index.html | 1 + lang/main.json | 5 +- package-lock.json | 15 ++ package.json | 1 + react/features/app/middlewares.web.js | 1 + react/features/app/reducers.web.js | 2 + react/features/app/types.ts | 2 + react/features/base/config/configType.ts | 4 + react/features/base/config/configWhitelist.ts | 3 +- react/features/base/config/constants.ts | 3 +- react/features/base/icons/svg/index.ts | 2 + .../base/icons/svg/whiteboard-hide.svg | 4 + .../base/icons/svg/whiteboard-show.svg | 3 + react/features/base/participants/actions.ts | 1 + react/features/base/participants/constants.ts | 7 +- react/features/base/participants/functions.ts | 10 +- .../features/base/participants/middleware.ts | 8 +- react/features/base/participants/reducer.ts | 2 + react/features/base/participants/types.ts | 1 + .../web/StageParticipantNameLabel.tsx | 7 +- react/features/external-api/middleware.js | 4 +- .../filmstrip/components/web/Thumbnail.tsx | 6 +- .../components/web/ThumbnailTopIndicators.tsx | 8 +- .../large-video/components/LargeVideo.web.js | 18 +- react/features/notifications/middleware.ts | 4 +- .../web/MeetingParticipantContextMenu.js | 33 ++-- .../components/web/MeetingParticipantItem.js | 10 +- .../toolbox/components/web/Toolbox.tsx | 20 ++- react/features/toolbox/functions.web.ts | 11 +- .../web/FakeParticipantContextMenu.tsx | 160 ++++++++++++++++++ .../components/web/ParticipantContextMenu.tsx | 74 +++----- .../web/RemoteVideoMenuTriggerButton.tsx | 36 +++- react/features/whiteboard/actionTypes.ts | 25 +++ react/features/whiteboard/actions.ts | 52 ++++++ .../whiteboard/components/web/Whiteboard.tsx | 142 ++++++++++++++++ .../components/web/WhiteboardButton.tsx | 88 ++++++++++ react/features/whiteboard/constants.ts | 54 ++++++ react/features/whiteboard/functions.ts | 95 +++++++++++ react/features/whiteboard/middleware.ts | 127 ++++++++++++++ react/features/whiteboard/reducer.ts | 53 ++++++ webpack.config.js | 4 +- 45 files changed, 1036 insertions(+), 100 deletions(-) create mode 100644 react/features/base/icons/svg/whiteboard-hide.svg create mode 100644 react/features/base/icons/svg/whiteboard-show.svg create mode 100644 react/features/video-menu/components/web/FakeParticipantContextMenu.tsx create mode 100644 react/features/whiteboard/actionTypes.ts create mode 100644 react/features/whiteboard/actions.ts create mode 100644 react/features/whiteboard/components/web/Whiteboard.tsx create mode 100644 react/features/whiteboard/components/web/WhiteboardButton.tsx create mode 100644 react/features/whiteboard/constants.ts create mode 100644 react/features/whiteboard/functions.ts create mode 100644 react/features/whiteboard/middleware.ts create mode 100644 react/features/whiteboard/reducer.ts diff --git a/Makefile b/Makefile index f729721a2..2c4e26763 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ LIBJITSIMEET_DIR = node_modules/lib-jitsi-meet OLM_DIR = node_modules/@matrix-org/olm TF_WASM_DIR = node_modules/@tensorflow/tfjs-backend-wasm/dist/ RNNOISE_WASM_DIR = node_modules/@jitsi/rnnoise-wasm/dist +EXCALIDRAW_DIR = node_modules/@jitsi/excalidraw/dist/excalidraw-assets +EXCALIDRAW_DIR_DEV = node_modules/@jitsi/excalidraw/dist/excalidraw-assets-dev TFLITE_WASM = react/features/stream-effects/virtual-background/vendor/tflite MEET_MODELS_DIR = react/features/stream-effects/virtual-background/vendor/models FACE_MODELS_DIR = node_modules/@vladmandic/human-models/models @@ -27,7 +29,7 @@ clean: rm -fr $(BUILD_DIR) .NOTPARALLEL: -deploy: deploy-init deploy-appbundle deploy-rnnoise-binary deploy-tflite deploy-meet-models deploy-lib-jitsi-meet deploy-olm deploy-tf-wasm deploy-css deploy-local deploy-face-landmarks +deploy: deploy-init deploy-appbundle deploy-rnnoise-binary deploy-excalidraw deploy-tflite deploy-meet-models deploy-lib-jitsi-meet deploy-olm deploy-tf-wasm deploy-css deploy-local deploy-face-landmarks deploy-init: rm -fr $(DEPLOY_DIR) @@ -87,6 +89,16 @@ deploy-tflite: $(TFLITE_WASM)/*.wasm \ $(DEPLOY_DIR) +deploy-excalidraw: + cp -R \ + $(EXCALIDRAW_DIR) \ + $(DEPLOY_DIR)/ + +deploy-excalidraw-dev: + cp -R \ + $(EXCALIDRAW_DIR_DEV) \ + $(DEPLOY_DIR)/ + deploy-meet-models: cp \ $(MEET_MODELS_DIR)/*.tflite \ @@ -109,7 +121,7 @@ deploy-local: ([ ! -x deploy-local.sh ] || ./deploy-local.sh) .NOTPARALLEL: -dev: deploy-init deploy-css deploy-rnnoise-binary deploy-tflite deploy-meet-models deploy-lib-jitsi-meet deploy-olm deploy-tf-wasm deploy-face-landmarks +dev: deploy-init deploy-css deploy-rnnoise-binary deploy-tflite deploy-meet-models deploy-lib-jitsi-meet deploy-olm deploy-tf-wasm deploy-excalidraw-dev deploy-face-landmarks $(WEBPACK_DEV_SERVER) source-package: diff --git a/config.js b/config.js index dd16737ac..2d2e42a95 100644 --- a/config.js +++ b/config.js @@ -1502,6 +1502,15 @@ var config = { // Application logo url // defaultLogoUrl: 'images/watermark.svg', + + // Settings for the Excalidraw whiteboard integration. + // whiteboard: { + // // Whether the feature is enabled or not. + // enabled: true, + // // The server used to support whiteboard collaboration. + // // https://github.com/jitsi/excalidraw-backend + // collabServerBaseUrl: 'https://excalidraw-backend.example.com', + // }, }; // Set the default values for JaaS customers diff --git a/css/_popover.scss b/css/_popover.scss index ff9aed51f..b94607027 100644 --- a/css/_popover.scss +++ b/css/_popover.scss @@ -45,3 +45,7 @@ margin: -16px -24px; z-index: $popoverZ; } + +.excalidraw .popover { + margin: 0; +} diff --git a/css/filmstrip/_tile_view_overrides.scss b/css/filmstrip/_tile_view_overrides.scss index 853d771a7..8c53dffa4 100644 --- a/css/filmstrip/_tile_view_overrides.scss +++ b/css/filmstrip/_tile_view_overrides.scss @@ -3,6 +3,7 @@ * tiled thumbnail experience. */ .tile-view, +.whiteboard-container, .stage-filmstrip { /** * Let the avatar grow with the tile. diff --git a/index.html b/index.html index de935d5dd..f52251694 100644 --- a/index.html +++ b/index.html @@ -13,6 +13,7 @@