feat(whiteboard) expose the excalidraw api (#13974)

pull/13977/head jitsi-meet_9040
Mihaela Dumitru 2 years ago committed by GitHub
parent 97e5f00dae
commit 1a39315001
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      package-lock.json
  2. 2
      package.json
  3. 11
      react/features/whiteboard/components/web/Whiteboard.tsx

12
package-lock.json generated

@ -16,7 +16,7 @@
"@giphy/js-fetch-api": "4.7.1",
"@giphy/react-components": "6.8.1",
"@giphy/react-native-sdk": "2.3.0",
"@jitsi/excalidraw": "https://github.com/jitsi/excalidraw/releases/download/v0.0.14/jitsi-excalidraw-0.0.14.tgz",
"@jitsi/excalidraw": "https://github.com/jitsi/excalidraw/releases/download/v0.0.15/jitsi-excalidraw-0.0.15.tgz",
"@jitsi/js-utils": "2.2.1",
"@jitsi/logger": "2.0.2",
"@jitsi/rnnoise-wasm": "0.1.0",
@ -3142,9 +3142,9 @@
}
},
"node_modules/@jitsi/excalidraw": {
"version": "0.0.14",
"resolved": "https://github.com/jitsi/excalidraw/releases/download/v0.0.14/jitsi-excalidraw-0.0.14.tgz",
"integrity": "sha512-iK7p7i6qJFOkjTVZhWDvurDW1u+eMoOhAVgpab9CZEqCTX+W4Ih4AOPrUpf+mjaAHK5XqmQZSc5nVEpMg+xIGQ==",
"version": "0.0.15",
"resolved": "https://github.com/jitsi/excalidraw/releases/download/v0.0.15/jitsi-excalidraw-0.0.15.tgz",
"integrity": "sha512-vBQcfXVFipVfsQO70im3QOxlbG/QGH9bCDxFlkiAmeOH5m3tZ5Br8f6b46y6s4NgnydMlHNJ52XQpQvAo/ajnA==",
"license": "MIT",
"peerDependencies": {
"react": "^17.0.2 || ^18.2.0",
@ -22560,8 +22560,8 @@
"dev": true
},
"@jitsi/excalidraw": {
"version": "https://github.com/jitsi/excalidraw/releases/download/v0.0.14/jitsi-excalidraw-0.0.14.tgz",
"integrity": "sha512-iK7p7i6qJFOkjTVZhWDvurDW1u+eMoOhAVgpab9CZEqCTX+W4Ih4AOPrUpf+mjaAHK5XqmQZSc5nVEpMg+xIGQ=="
"version": "https://github.com/jitsi/excalidraw/releases/download/v0.0.15/jitsi-excalidraw-0.0.15.tgz",
"integrity": "sha512-vBQcfXVFipVfsQO70im3QOxlbG/QGH9bCDxFlkiAmeOH5m3tZ5Br8f6b46y6s4NgnydMlHNJ52XQpQvAo/ajnA=="
},
"@jitsi/js-utils": {
"version": "2.2.1",

@ -22,7 +22,7 @@
"@giphy/js-fetch-api": "4.7.1",
"@giphy/react-components": "6.8.1",
"@giphy/react-native-sdk": "2.3.0",
"@jitsi/excalidraw": "https://github.com/jitsi/excalidraw/releases/download/v0.0.14/jitsi-excalidraw-0.0.14.tgz",
"@jitsi/excalidraw": "https://github.com/jitsi/excalidraw/releases/download/v0.0.15/jitsi-excalidraw-0.0.15.tgz",
"@jitsi/js-utils": "2.2.1",
"@jitsi/logger": "2.0.2",
"@jitsi/rnnoise-wasm": "0.1.0",

@ -42,6 +42,7 @@ interface IDimensions {
*/
const Whiteboard = (props: WithTranslation): JSX.Element => {
const excalidrawRef = useRef<any>(null);
const excalidrawAPIRef = useRef<any>(null);
const collabAPIRef = useRef<any>(null);
const isOpen = useSelector(isWhiteboardOpen);
@ -94,6 +95,13 @@ const Whiteboard = (props: WithTranslation): JSX.Element => {
};
};
const getExcalidrawAPI = useCallback(excalidrawAPI => {
if (excalidrawAPIRef.current) {
return;
}
excalidrawAPIRef.current = excalidrawAPI;
}, []);
const getCollabAPI = useCallback(collabAPI => {
if (collabAPIRef.current) {
return;
@ -141,7 +149,8 @@ const Whiteboard = (props: WithTranslation): JSX.Element => {
theme: 'light',
UIOptions: WHITEBOARD_UI_OPTIONS
}}
getCollabAPI = { getCollabAPI } />
getCollabAPI = { getCollabAPI }
getExcalidrawAPI = { getExcalidrawAPI } />
</div>
)
}

Loading…
Cancel
Save